Skip to content

Commit 1d33f17

Browse files
committed
Update api/README.md
1 parent 76c6d2c commit 1d33f17

File tree

6 files changed

+16
-18
lines changed

6 files changed

+16
-18
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These are supported funding model platforms
22

3-
patreon: koistya
3+
github: koistya

api/README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ optimized for hosting in a [serverless](https://cloud.google.com/serverless)
55
environment such as [Google Cloud Functions](https://cloud.google.com/functions)
66
or [Google Cloud Run](https://cloud.google.com/run).
77

8+
---
9+
810
This project was bootstrapped with [Node.js API Starter Kit](https://github.com/kriasoft/nodejs-api-starter).
911
Be sure to join our [Discord channel](https://discord.com/invite/bSsv7XM) for
1012
assistance.
@@ -13,29 +15,31 @@ assistance.
1315

1416
- [Node.js](https://nodejs.org/) `v12`, [Yarn](https://yarnpkg.com/) `v2`, [TypeScript](https://www.typescriptlang.org/), [Babel](https://babeljs.io/), [Prettier](https://prettier.io/), [ESLint](https://eslint.org/) — core platform and dev tools
1517
- [GraphQL.js](https://github.com/graphql/graphql-js), [GraphQL.js Relay](https://github.com/graphql/graphql-relay-js), [DataLoader](https://github.com/graphql/dataloader), [Validator.js](https://github.com/validatorjs/validator.js)[GraphQL](https://graphql.org/) schema and API endpoint(s)
16-
- [PostgreSQL](https://www.postgresql.org/), [Knex](https://knexjs.org/), [pg](https://node-postgres.com/), [GCP Storage](https://cloud.google.com/storage) — data access
17-
- [Firebase Admin SDK](https://firebase.google.com/docs/admin/setup) - stateless authentication via 3rd party providers (Google, Apple, etc.)
18+
- [PostgreSQL](https://www.postgresql.org/), [Knex.js](https://knexjs.org/), [`pg`](https://node-postgres.com/), [`@google-cloud/storage`](https://googleapis.dev/nodejs/storage/latest) — data access
19+
- [`jswonwebtoken`](https://github.com/auth0/node-jsonwebtoken), [`google-auth-library`](https://github.com/googleapis/google-auth-library-nodejs) stateless JWT-based sessions and authentication
1820
- [Jest](https://jestjs.io/) - unit and snapshot testing
1921

2022
```bash
2123
.
2224
├── scripts # Automation scripts
25+
│ ├── deploy.ts # - deploys the app to Google Cloud
2326
│ ├── update-schema.ts # - generates `schema.graphql` file
2427
│ └── update-types.ts # - generates TypeScript definitions
2528
├── src #
26-
│ ├── mutations # GraphQL API mutation endpoints
27-
│ ├── queries # The top-level GraphQL API query fields
28-
│ ├── types # GrapHQL API schema types
29-
│ ├── utils # Helper functions
30-
│ ├── auth.ts # Authentication middleware
29+
│ ├── auth/ # Authentication middleware
30+
│ ├── mutations/ # GraphQL API mutation endpoints
31+
│ ├── queries/ # The top-level GraphQL API query fields
32+
│ ├── types/ # GrapHQL API schema types
33+
│ ├── utils/ # Helper functions
3134
│ ├── context.ts # GraphQL API context variable(s)
3235
│ ├── db.ts # PostgreSQL client and query builder
3336
│ ├── errors.ts # Custom error types
3437
│ ├── fields.ts # Helper functions for GraphQL fields
3538
│ ├── index.ts # GraphQL API server entry point
3639
│ ├── node.ts # GraphQL Relay Node interface
3740
│ ├── schema.ts # GraphQL API schema definition
38-
│ └── validator.ts # User input validator
41+
│ ├── validator.ts # User input validator
42+
│ └── session.ts # Stateless JWT-based session middleware
3943
├── babel.config.js # Babel.js configuration
4044
├── package.json # Node.js dependencies
4145
├── README.md # This file

api/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@
108108
"node": true
109109
},
110110
"parserOptions": {
111-
"ecmaVersion": 2019,
111+
"ecmaVersion": 2020,
112112
"sourceType": "module"
113113
},
114114
"ignorePatterns": [
115-
"lib/**"
115+
"/lib/"
116116
]
117117
},
118118
"jest": {

api/src/utils/type.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
* @copyright 2016-present Kriasoft (https://git.io/vMINh)
55
*/
66

7-
interface Entity {
8-
__type?: string;
9-
}
10-
117
export function assignType<T extends Record<string, unknown>>(type: string) {
128
return (obj?: T | null): T | null | undefined => {
139
if (obj) {

api/src/utils/username.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
import db from "../db";
88

9-
type generateUsername = (email?: string) => Promise<string>;
10-
119
const USERNAME_REGEX = /^(?=.{2,50}$)(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._]+(?<![_.])$/;
1210

1311
export function isValidUsername(username?: string): boolean {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"prettier"
7373
],
7474
"parserOptions": {
75-
"ecmaVersion": 9
75+
"ecmaVersion": 2020
7676
}
7777
},
7878
"husky": {

0 commit comments

Comments
 (0)