Follow steps to execute this boilerplate.
- Clone this boilerplate
$ git clone --depth 1 https://github.com/Shyam-Chen/Fastify-Starter.git <PROJECT_NAME>
$ cd <PROJECT_NAME>
- Install dependencies
$ npm install
- Start a development server
$ yarn serve
- Produce a production-ready bundle
$ yarn build
- Lint and fix files
$ yarn lint
- Run unit tests
$ yarn unit
- Run end-to-end tests
$ yarn e2e
Note: If you see the [HMR] You need to restart the application!
message to type rs
and press Enter to restart the server. Don't forget to fix the build failure.
- Hello World
- CRUD Operations
- Authentication
- File Uploads
- Realtime Data
.
├── src
│ ├── core
│ │ └── ...
│ ├── <FEATURE> -> feature module
│ │ ├── __tests__
│ │ │ ├── controller.spec.js
│ │ │ ├── resolver.spec.js
│ │ │ ├── document.spec.js
│ │ │ ├── relational.spec.js
│ │ │ ├── service.spec.js
│ │ │ ├── rest.e2e-spec.js
│ │ │ └── graphql.e2e-spec.js
│ │ ├── controller.js -> rest controller
│ │ ├── resolver.js -> graphql resolver
│ │ ├── document.js -> mongodb odm
│ │ ├── relational.js -> postgresql orm
│ │ ├── service.js -> provider
│ │ └── index.js
│ ├── <GROUP> -> module group
│ │ └── <FEATURE> -> feature module
│ │ ├── __tests__
│ │ │ ├── controller.spec.js
│ │ │ ├── resolver.spec.js
│ │ │ ├── document.spec.js
│ │ │ ├── relational.spec.js
│ │ │ ├── service.spec.js
│ │ │ ├── rest.e2e-spec.js
│ │ │ └── graphql.e2e-spec.js
│ │ ├── controller.js -> rest controller
│ │ ├── resolver.js -> graphql resolver
│ │ ├── document.js -> mongodb odm
│ │ ├── relational.js -> postgresql orm
│ │ ├── service.js -> provider
│ │ └── index.js
│ ├── shared
│ │ └── ...
│ ├── app.js
│ └── main.js
├── .editorconfig
├── .eslintrc
├── .gitignore
├── .prettierrc
├── babel.config.js
├── circle.yml
├── docker-compose.yml
├── Dockerfile
├── env.js
├── jest.config.js
├── LICENSE
├── package.json
├── README.md
└── webpack.config.js
Microservice architecture – a variant of the service-oriented architecture structural style – arranges an application as a collection of loosely coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight.
See Server-side Micro-Fullstack for instructions on how to create microservices from source code.