- Install
redis
and launch it - Install
mongodb
and launch it - Install
nodejs
First, to launch the project locally create .env
file:
cp .env.example .env # to clone .env.example on .env
# edit .env file with your environment var
Finaly run the development server:
npm run dev
# or
yarn dev
An example of service exists in project :
src/services/example
:- controllers -> send response to client (no logic in the controller function)
- doc -> create open documentation
- middlewares -> process client request
- models -> create mongoose models
- routes -> create routes for services and call middlewares + controllers
- types -> only type in services scope
- validators -> validators of request
To create route documentation, you need :
- Create schema (
src/services/YOUR_SERVICE/doc/schemas/index.ts
)- export schemas to show in documentation (ex:
src/services/notifications/doc/schemas/index.ts
)
- export schemas to show in documentation (ex:
- Create Endpoints (
src/services/YOUR_SERVICE/doc/endpoints/index.ts
)- export endpoints (ex:
src/services/notifications/doc/endpoints/index.ts
)
- export endpoints (ex:
- Import Schema and Endpoints on
src/services/open-api/index.ts
- On this file you are comment with
@TODO
to add documentation schema + endpoint + some instructions
- On this file you are comment with
npx @dotmind/create-dotmind-app MY_PROJECT_NAME --example with-mongoose-openapi-mailjet-apikey
- generate public / private api key :
npm run bash:generate-keys
- generate new api key :
npm run cli:apikey
- to disable api key, you can add on
.env
:
API_KEY=0