- DEMO (GraphQL Playground): https://fastify-rest-graphql-api.herokuapp.com/graphql
- DEMO (Swagger REST docs): https://fastify-rest-graphql-api.herokuapp.com/docs/static/index.html
Note: in demo, I disabled email
Built with π
- User Auth functionality (Signup, Login, Forgot Password, Reset Password)
- JWT Authentication
- REST API
- Dependency injection
- Configs via environmental variables
- Email notification (Welcome email, Reset password email)
- Knex with Postgres implementation
- Unit tests
- Travis CI
- Badges (coverage, opesn source, MIT, up-to-date dependencies)
- MIT LICENSE
- GraphQL API
- GraphQL playground
- Swagger REST API documentation
- Diagram
- ? Auto migration (optional via env var)
component diagram
swagger
graphql playground
Envronmental variables, see ./config
.
You can customize the ./config/default.json
and ./config/custom-environment-variables.json
.
You can put .env
in root of repo as well
MAILGUN_API_KEY=key-b9jksfh8s9843uhfsdhds
MAILGUN_DOMAIN=xxxxx.mailgun.org
LOG_LEVEL=info
APP_DB_TYPE=postgres
APP_DB_HOST=localhost
APP_DB_PORT=5432
APP_DB_DB=my-db
APP_DB_USER=local-user
APP_DB_PASSWORD=password
JWT_SECRET=secret
JWT_EXPIRES_IN=3h
ENV=development
APP_PORT=3000
APP_HOST=http://localhost
Run
# Terminal 1
docker-compose up # docker-compose up (Run postgres)
docker-compose down # docker-compose down (Shutdown postgres)
# Terminal 2
yarn migrate # Migrate DB
yarn rollback # Rollback migration
yarn dev # Run application
yarn test # Run unit tests (lint & format code as well)
yarn build # Build application
You can see graphql playground at http:/localhost:3000/graphql
once application is up and running.
You can see swagger REST API docs at http:/localhost:3000/docs
once application is up and running.
See more commands in ./package.json