nx-node-apollo-grahql-mongo
nx-node-apollo-grahql-mongo copied to clipboard
Nx Nodejs Apollo - TypegraphQL / GraphQL / Express / MongoDB - Typegoose API Boilerplate
Nx-Nodejs-Apollo/GraphQL/Express/MongoDB Boilerplate
Try out GraphQL IDE live at https://node-graphql-mongo.herokuapp.com/graphql
This project was generated using Nx.
🐞 Bug Report
📢 Feature Request
Tech Stack
🔎 Nx is a set of Extensible Dev Tools for Monorepos.
- Node.js, Apollo, TypeScript , Nx, Prettier— core platforms.
- Typegraphql - Typescript Wrapper for Apollo GraphQL.
- MongoDB , typegoose — data access and db automation.
- Jest - unit and snapshot testing.
Folder Structure For Node GraphQL API
apps/api/
├── src
│ ├── app
│ │ ├── entity
│ │ │ ├── index.ts
│ │ │ └── user.ts
│ │ ├── index.ts
│ │ ├── loaders
│ │ │ ├── apollo.loader.ts
│ │ │ ├── dependencyInjector.ts
│ │ │ ├── index.ts
│ │ │ ├── mongoose.loader.ts
│ │ │ ├── redis.loader.ts
│ │ │ └── seedDB.ts
│ │ ├── middlewares
│ │ │ ├── isAuthenticated.ts
│ │ │ └── typegoose.middleware.ts
│ │ ├── modules
│ │ │ ├── User
│ │ │ │ └── user.resolver.ts
│ │ │ ├── index.ts
│ │ │ └── shared
│ │ └── services
│ │ └── user.service.ts
│ ├── assets
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ └── main.ts
├── jest.config.js
├── tsconfig.app.json
├── tsconfig.json
└── tsconfig.spec.json
Development
We use node version 10.15.0
nvm install 10.15.0
nvm use 10.15.0
The first time, you will need to run
npm install
Run nx serve for a dev server. Navigate to http://localhost:4000/graphql. The app will automatically reload if you change any of the source files.
Build
Run npm run build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.
Understand your workspace
Run nx dep-graph to see a diagram of the dependencies of your projects.
Further help
Visit the Nx Documentation to learn more.
Developer
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE for more information.