Skip to content

Commit d2db3cf

Browse files
Initial admin setup (#73)
* Add IP address to join request * Maybe fix lint action * Maybe fix lint action * Use the IP on card creation, on join payment and on subscription payment * Fix tests * Create admin app * Move the .gitignore config * WIP * WIP * Dashboard Homepage * WIP Signed-off-by: Alexander Ivanov <[email protected]> * GraphQL goodness * WIP Signed-off-by: Alexander Ivanov <[email protected]> * Commons gql Signed-off-by: Alexander Ivanov <[email protected]> * WIP Signed-off-by: Alexander Ivanov <[email protected]> * Fix the thrid page Signed-off-by: Alexander Ivanov <[email protected]> * Common detaisl page Signed-off-by: Alexander Ivanov <[email protected]> * Theme switcher Signed-off-by: Alexander Ivanov <[email protected]> * One proposal Signed-off-by: Alexander Ivanov <[email protected]> * wip Signed-off-by: Alexander Ivanov <[email protected]> * Get commons proposals, paginated Signed-off-by: Alexander Ivanov <[email protected]> * See description * Common details page * User graphql type * User type on proposal * User type on common * User entity types moved to types package * And more :D Signed-off-by: Alexander Ivanov <[email protected]> * See description * User graphql * Added user to the propsal and common * User details page * Proposal details page * More Signed-off-by: Alexander Ivanov <[email protected]> * Placeholders Signed-off-by: Alexander Ivanov <[email protected]> * labels Signed-off-by: Alexander Ivanov <[email protected]> * Maybe fix texts * Maybe fix eslint * Remove console.logs * Rule bending
1 parent ea05c8e commit d2db3cf

File tree

89 files changed

+10605
-1817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+10605
-1817
lines changed

.eslintrc.json

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": [
4+
"*.md",
5+
"*.json",
6+
"*.yml",
7+
"*.sh",
8+
"functions/dist/**",
9+
"*.test.ts"
10+
],
11+
"parserOptions": {
12+
// Required for certain syntax usages
13+
"ecmaVersion": 2018
14+
},
15+
"env": {
16+
"amd": true,
17+
"node": true,
18+
"es6": true
19+
},
20+
"plugins": [
21+
"promise"
22+
],
23+
"extends": "eslint:recommended",
24+
"rules": {
25+
// Removed rule "disallow multiple spaces in regular expressions" from recommended eslint rules
26+
"no-regex-spaces": "off",
27+
// Removed rule "disallow the use of debugger" from recommended eslint rules
28+
"no-debugger": "off",
29+
// Removed rule "disallow unused variables" from recommended eslint rules
30+
"no-unused-vars": "off",
31+
// Removed rule "disallow mixed spaces and tabs for indentation" from recommended eslint rules
32+
"no-mixed-spaces-and-tabs": "off",
33+
// Removed rule "disallow the use of undeclared variables unless mentioned in /*global */ comments" from recommended eslint rules
34+
// Warn against template literal placeholder syntax in regular strings
35+
"no-template-curly-in-string": 1,
36+
// Warn if return statements do not either always or never specify values
37+
"consistent-return": 1,
38+
// Require the use of === and !==
39+
"eqeqeq": 2,
40+
// Disallow the use of alert, confirm, and prompt
41+
"no-alert": 2,
42+
// Disallow the use of arguments.caller or arguments.callee
43+
"no-caller": 2,
44+
// Disallow null comparisons without type-checking operators
45+
"no-eq-null": 2,
46+
// Disallow the use of eval()
47+
"no-eval": 2,
48+
// Warn against extending native types
49+
"no-extend-native": 1,
50+
// Warn against unnecessary calls to .bind()
51+
"no-extra-bind": 1,
52+
// Warn against unnecessary labels
53+
"no-extra-label": 1,
54+
// Disallow leading or trailing decimal points in numeric literals
55+
"no-floating-decimal": 2,
56+
// Warn against shorthand type conversions
57+
"no-implicit-coercion": 1,
58+
// Warn against function declarations and expressions inside loop statements
59+
"no-loop-func": 1,
60+
// Disallow new operators with the Function object
61+
"no-new-func": 2,
62+
// Warn against new operators with the String, Number, and Boolean objects
63+
"no-new-wrappers": 1,
64+
// Disallow throwing literals as exceptions
65+
"no-throw-literal": 2,
66+
// Require using Error objects as Promise rejection reasons
67+
"prefer-promise-reject-errors": 2,
68+
// Enforce “for” loop update clause moving the counter in the right direction
69+
"for-direction": 2,
70+
// Enforce return statements in getters
71+
"getter-return": 2,
72+
// Disallow await inside of loops
73+
"no-await-in-loop": 2,
74+
// Disallow comparing against -0
75+
"no-compare-neg-zero": 2,
76+
// Warn against catch clause parameters from shadowing variables in the outer scope
77+
"no-catch-shadow": 1,
78+
// Disallow identifiers from shadowing restricted names
79+
"no-shadow-restricted-names": 2,
80+
// Enforce return statements in callbacks of array methods
81+
"callback-return": 2,
82+
// Require error handling in callbacks
83+
"handle-callback-err": 2,
84+
// Warn against string concatenation with __dirname and __filename
85+
"no-path-concat": 1,
86+
// Prefer using arrow functions for callbacks
87+
"prefer-arrow-callback": 1,
88+
// Return inside each then() to create readable and reusable Promise chains.
89+
// Forces developers to return console logs and http calls in promises.
90+
"promise/always-return": 2,
91+
//Enforces the use of catch() on un-returned promises
92+
"promise/catch-or-return": 2,
93+
// Warn against nested then() or catch() statements
94+
"promise/no-nesting": 1,
95+
96+
// This is temporary rule that we should remove on later stage
97+
"@typescript-eslint/no-var-requires": 0,
98+
99+
// Console usage is not allowed. Use logger instead
100+
"no-console": 2
101+
},
102+
"overrides": [
103+
{
104+
"files": [
105+
"**/*.ts",
106+
"**/*.tsx"
107+
],
108+
"parser": "@typescript-eslint/parser",
109+
"plugins": [
110+
"@typescript-eslint"
111+
],
112+
"extends": [
113+
"eslint:recommended",
114+
"plugin:@typescript-eslint/recommended"
115+
],
116+
"rules": {
117+
"@typescript-eslint/no-explicit-any": 0
118+
}
119+
}
120+
]
121+
}

.github/labeler.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ types:
1111
- packages/types/**/*
1212

1313
app:
14-
- packages/app/**/*
14+
- packages/app/**/*
15+
16+
admin:
17+
- packages/admin/**/*
18+
- packages/firebase/functions/src/core/admin/**/*

.github/labels.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"color": "5319E7",
55
"description": "The item is related to the firebase code"
66
},
7+
{
8+
"name": "admin",
9+
"color": "5319E7",
10+
"description": "The item is related to the admin frontend or backend code"
11+
},
712
{
813
"name": "app",
914
"color": "0E8A16",

.github/workflows/firebase-lint-worflow.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,13 @@ on:
44
push:
55
paths:
66
- 'packages/firebase/**'
7-
- 'packages/types/**'
87
branches:
98
- main
10-
- main/firebase
11-
- main/app
129
pull_request:
1310
paths:
1411
- 'packages/firebase/**'
15-
- 'packages/types/**'
1612
branches:
1713
- main
18-
- main/firebase
19-
- main/app
2014

2115
jobs:
2216
eslint:
@@ -44,5 +38,6 @@ jobs:
4438
- name: Lint
4539
uses: bradennapier/[email protected]
4640
with:
41+
rulePaths: packages/firebase/
4742
includeGlob: "packages/firebase/**/*"
4843
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,4 +537,25 @@ $RECYCLE.BIN/
537537
**/firestore/data/firestore_export
538538

539539
# Web Ignores
540-
packages/build
540+
packages/build
541+
542+
.pnp
543+
.pnp.js
544+
545+
# testing
546+
/coverage
547+
548+
# next.js
549+
.next/
550+
551+
# production
552+
build
553+
554+
# local env files
555+
.env.local
556+
.env.development.local
557+
.env.test.local
558+
.env.production.local
559+
560+
# vercel
561+
.vercel

packages/admin/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
```
12+
13+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
14+
15+
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
16+
17+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
18+
19+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
20+
21+
## Learn More
22+
23+
To learn more about Next.js, take a look at the following resources:
24+
25+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
26+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
27+
28+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
29+
30+
## Deploy on Vercel
31+
32+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
33+
34+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

packages/admin/codegen.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
overwrite: true
2+
schema: "./schema.gql"
3+
documents: "src/**/*.tsx"
4+
generates:
5+
src/graphql.tsx:
6+
plugins:
7+
- "typescript"
8+
- "typescript-operations"
9+
- "typescript-react-apollo"
10+
config:
11+
withHooks: true

packages/admin/next-env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/types/global" />

packages/admin/package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "admin",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"codegen": "graphql-codegen --config codegen.yml"
10+
},
11+
"dependencies": {
12+
"@apollo/client": "^3.3.8",
13+
"@geist-ui/react": "^2.1.0-canary.2",
14+
"@geist-ui/react-icons": "^1.0.1",
15+
"graphql": "^15.5.0",
16+
"next": "10.0.6",
17+
"react": "17.0.1",
18+
"react-dom": "17.0.1",
19+
"react-loading-skeleton": "^2.1.1"
20+
},
21+
"eslintConfig": {
22+
"extends": [
23+
"eslint:recommended",
24+
"plugin:react/recommended"
25+
],
26+
"rules": {
27+
"react/display-name": 0,
28+
"react/prop-types": 0,
29+
"@typescript-eslint/interface-name-prefix": 0
30+
}
31+
},
32+
"devDependencies": {
33+
"@graphql-codegen/cli": "1.20.1",
34+
"@graphql-codegen/typescript": "1.20.2",
35+
"@graphql-codegen/typescript-operations": "1.17.14",
36+
"@graphql-codegen/typescript-react-apollo": "2.2.1"
37+
}
38+
}

packages/admin/public/favicon.ico

14.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)