https://github.com/morzhanov/graphql-nodejs-boilerplate
GraphQL NodeJS Boilerplate allows you to start new server side web project from scratch using NodeJS, Express, GraphQL and Typescript.
https://github.com/morzhanov/graphql-nodejs-boilerplate
express express-graphql graphql jsonwebtoken lodash nodejs postgresql typeorm typescript
Last synced: 10 months ago
JSON representation
GraphQL NodeJS Boilerplate allows you to start new server side web project from scratch using NodeJS, Express, GraphQL and Typescript.
- Host: GitHub
- URL: https://github.com/morzhanov/graphql-nodejs-boilerplate
- Owner: morzhanov
- License: mit
- Created: 2018-05-19T10:15:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-12T10:36:28.000Z (about 7 years ago)
- Last Synced: 2024-12-30T04:19:13.267Z (12 months ago)
- Topics: express, express-graphql, graphql, jsonwebtoken, lodash, nodejs, postgresql, typeorm, typescript
- Language: TypeScript
- Homepage:
- Size: 233 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GraphQL NodeJS Boilerplate

GraphQL NodeJS Boilerplate allows you to start new server side web project from scratch using NodeJS, Express, GraphQL and Typescript.
Also this boilerplate contains babel configuration to use all lates ES7+ features.
This is a backend part of GraphQL boilerplate projects. You can also review graphql-react-boilerplate to see how things works on the client side.
## Installation
Use these steps to install project
### Postgres DB
This boilerplate based on PostgreSQL database, but you can easily change it to any other preferable database. Project uses TypeORM as ORM for your database.
You can install Docker postgress image:
> docker run -p 5434:5434 --name graphql_boilerplate_db -d postgres:latest
Than you should create database `graphql_boilerplate`
Dont forget to add Postgres connection credentials to .env file
Example .env file:
```
DB_HOST=localhost
DB_PORT=32768
DB_USERNAME=postgres
DB_PASSWORD=
DB_DATABASE=graphql_boilerplate
```
For local development use: `yarn run start`
To build project run: `yarn run build`
To serve built files run: `yarn run serve`
## Usage
In this project you can review how could be designed and developed such basic parts of an application:
- Authentication using JWT based on GraphQL mutations.
- All API calls are secured with access token. You can manage live time of access token and refresh it with additional refresh token.
- GraphQL mutations and queries using expres-graphql
- All parts of application developed using Typescript, you can review how to use GraphQL with NodeJS and Typescript.
- Project uses TypeOrm ORM to easily manage Postgress database from your NodeJS application.
## Main technologies and libraries
- NodeJS
- GraphQL
- PostgreSQL
- TypeORM
- ExpressJS
- Typescript
- JWT
- Lodash
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
## Author
Vlad Morzhanov
## License
#### (The MIT License)
Copyright (c) 2018 Vlad Morzhanov.
You can review license in the LICENSE file.