Fullstack starter template.
Stack:
- 100% Typescript
- Next.js
- React with context API only (no Redux)
- TailwindCSS
- Node.js
- Graphql
- Mongodb
- Example authorization login/register.
- Graphql subscriptions.
- Example todo list CRUD.
- node v14.16 https://nodejs.org/
- mongodb https://www.mongodb.com/
Create .env
file under api
.
Example:
PORT=4000
MONGODB_URI=mongodb://localhost:27017
MONGODB_DB_NAME=app
Create .env.local
file under app
.
Example:
NEXT_PUBLIC_API_URL=http://localhost:4000
Under root directory:
yarn run generate
oryarn run g
- generate grahpql files. Runyarn run g --watch
for watch mode.yarn run lint
- check lint errors.yarn run tsc
- check tsc errors.
Under api
directory:
yarn run dev
- run in dev mode.yarn run start
- run in prod mode.
Under app
directory:
yarn run dev
- run in dev mode.yarn run build
- build app for prod mode.yarn run start
- run in prod mode.
install plop npm i -g plop
plop collection
- add a new mongodb collection to APIplop feature
- add a new feature to APP with a module based on the Context API.plop feature2
- add a new feature to APP (simplified).plop module
- add a new Context API module to APP.plop resolver
- add a resolved to API.
context-api
- a simple helper for creating Context API modules.mongodb2
- a wrapper for originalmongodb
packages with small improvements.
MIT