Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vinicius73/graphql-start-project
A project with opinionated architecture that is used as the basis for new projects.
https://github.com/vinicius73/graphql-start-project
apollo-server graphql starter-kit
Last synced: 18 days ago
JSON representation
A project with opinionated architecture that is used as the basis for new projects.
- Host: GitHub
- URL: https://github.com/vinicius73/graphql-start-project
- Owner: vinicius73
- License: mit
- Created: 2019-03-15T16:16:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T01:47:39.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T21:22:21.050Z (about 1 month ago)
- Topics: apollo-server, graphql, starter-kit
- Language: JavaScript
- Homepage:
- Size: 2 MB
- Stars: 40
- Watchers: 4
- Forks: 8
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GraphQL Start Project
A project with opinionated architecture that is used as the basis for new projects.## Requirements
Resources that must be installed for this project to work.- [node v10+](https://nodejs.org/en/download/)
- [yarn v1.15+](https://yarnpkg.com/lang/en/docs/install/#debian-stable)
- [docker](https://docs.docker.com/install/)
- [docker-compose](https://docs.docker.com/compose/install/)## Stack
Primary libs and resources used in this project- [Apollo Server](https://github.com/apollographql/apollo-server)
- [knex](https://knexjs.org/)
- [awilix](https://github.com/jeffijoe/awilix)
- [node-config](https://github.com/lorenwest/node-config)
- [dotenv](https://github.com/motdotla/dotenv)
- [pm2](https://pm2.io/doc/en/runtime/overview/)
- [PostgreSQL](https://www.postgresql.org/)
- [Redis](https://redis.io/)### Commit tool
This project use [gitmoji-cli](https://github.com/carloscuesta/gitmoji-cli) for commit messages## Project structure
```
src
├── directives
│ └── *.directive.js
├── index.js
├── resolvers
│ ├── fields // fields resolvers
│ ├── mutations // mutation resolvers
│ └── resources.js // for auto ganeration
├── server // server builder
├── services
│ ├── factories // services factories
│ └── index.js
├── type-defs
│ └── *.graphql
└── utils```
## Running project
This project uses docker-compose to upload all the services it depends on to work.## Environments
Copy `.env.example` to `.env````shell
cp .env.example .env
```> **APP_KEY** is very important. All tokens use this env. Do not change in production.
See `config/default.js` for more info.
### dev mode
Up service with auto reload when change source files```shell
yarn run docker:dev
```The graphql server will bi aveilable in `http://localhost:7373` by default, see PORT env for confirmation.
When docker up in dev mode, follow below commands will run.
```shell
yarn run knex:migrate
yarn run knex:seed
```This commands configure and populate the database.
See `package.json > scripts` for more info.
> If You need run commands inside container use `yarn run docker:dev:exec sh`
#### pgadmin4
When run project in development mode, pgadmin4 will be available in `http://localhost:16543`
Use `[email protected]` and value of `DB_PASSWORD` to access pgadmin4### prod mode
Up to 2 pm2 service in cluster mode.```shell
yarn run docker:prod
```