From f7f0c05e12b507635c51e6beccf9a8e9322d6cc1 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Fri, 17 Jul 2020 01:03:38 -0700 Subject: [PATCH] Initial commit. --- .eslintrc.json | 21 + .gitignore | 34 + .prettierrc.json | 7 + .stylelintrc.json | 17 + README.md | 1 + components/footer.js | 5 + components/header.js | 7 + components/layout.js | 23 + jsconfig.json | 5 + lib/db.js | 65 + lib/utils.js | 72 + next.config.js | 15 + package.json | 67 + pages/404.js | 10 + pages/_app.js | 7 + pages/api/collect.js | 16 + pages/api/session.js | 28 + pages/index.js | 10 + postcss.config.js | 17 + prisma/schema.prisma | 48 + public/umami.js | 1 + rollup.config.js | 24 + scripts/umami/index.js | 39 + sql/schema.sql | 33 + styles/bootstrap-grid.css | 3981 +++++++++++++++++ styles/index.css | 25 + yarn.lock | 8450 +++++++++++++++++++++++++++++++++++++ 27 files changed, 13028 insertions(+) create mode 100644 .eslintrc.json create mode 100644 .gitignore create mode 100644 .prettierrc.json create mode 100644 .stylelintrc.json create mode 100644 README.md create mode 100644 components/footer.js create mode 100644 components/header.js create mode 100644 components/layout.js create mode 100644 jsconfig.json create mode 100644 lib/db.js create mode 100644 lib/utils.js create mode 100644 next.config.js create mode 100644 package.json create mode 100644 pages/404.js create mode 100644 pages/_app.js create mode 100644 pages/api/collect.js create mode 100644 pages/api/session.js create mode 100644 pages/index.js create mode 100644 postcss.config.js create mode 100644 prisma/schema.prisma create mode 100644 public/umami.js create mode 100644 rollup.config.js create mode 100644 scripts/umami/index.js create mode 100644 sql/schema.sql create mode 100644 styles/bootstrap-grid.css create mode 100644 styles/index.css create mode 100644 yarn.lock diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..341903f2 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,21 @@ +{ + "env": { + "browser": true, + "es2020": true + }, + "extends": ["eslint:recommended", "plugin:react/recommended", "prettier", "prettier/react"], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 11, + "sourceType": "module" + }, + "plugins": ["react"], + "rules": { + "react/react-in-jsx-scope": "off" + }, + "globals": { + "React": "writable" + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..d2f3e211 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +.idea +*.iml +.env +.env*.local + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env +.env.development.local +.env.test.local +.env.production.local diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..1193784d --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "arrowParens": "avoid", + "endOfLine": "lf", + "printWidth": 100, + "singleQuote": true, + "trailingComma": "all" +} diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 00000000..117fac2a --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,17 @@ +{ + "extends": [ + "stylelint-config-recommended", + "stylelint-config-css-modules", + "stylelint-config-prettier" + ], + "rules": { + "no-descending-specificity": null, + "selector-pseudo-class-no-unknown": [ + true, + { + "ignorePseudoClasses": ["global", "horizontal", "vertical"] + } + ] + }, + "ignoreFiles": ["**/*.js"] +} diff --git a/README.md b/README.md new file mode 100644 index 00000000..d6a77b8d --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +umami - deliciously simple web stats \ No newline at end of file diff --git a/components/footer.js b/components/footer.js new file mode 100644 index 00000000..6e59789b --- /dev/null +++ b/components/footer.js @@ -0,0 +1,5 @@ +import React from 'react'; + +export default function Footer() { + return ; +} \ No newline at end of file diff --git a/components/header.js b/components/header.js new file mode 100644 index 00000000..2d04a5d0 --- /dev/null +++ b/components/header.js @@ -0,0 +1,7 @@ +import React from 'react'; + +export default function Header() { + return
+

umami

+
; +} \ No newline at end of file diff --git a/components/layout.js b/components/layout.js new file mode 100644 index 00000000..d92d0699 --- /dev/null +++ b/components/layout.js @@ -0,0 +1,23 @@ +import React from 'react'; +import Head from 'next/head'; +import Header from 'components/header'; +import Footer from 'components/footer'; + +export default function Layout({ title, children }) { + return ( + <> + + umami{title && ` - ${title}`} + + +