Easemedic est une solution de stockage d'ordonnance et de rappel de celles-ci.
Each subfolder contains its own README.md
.
├── server - Back-end server with business logic of EaseMedic Server
└── docs - OpenAPI 3.0.2 specification of EaseMedic Server APIIf you want to develop on the server, here is how to get started.
Here comes a little surprise: You need Node.JS and docker-compose.
$ npm install
$ cd server && npm install
$ cd docs && npm installIn the docker-compose.yml, in the db service, add a field ports to expose the default database port.
Attention, DON'T expose the database port in the production environment, so DON'T commit and push this.
The default PostgreSQL port is 5432.
ports:
- '8081:5432'$ docker-compose up --build db$ cd server
$ npm run devWhen you have setup the controllers header you can run this command:
$ docker-compose up --build docsThe documentation will be available at http://localhost:8082/docs/
Attention, check that the database port is not exposed.
ENV=prod docker-compose up --buildBased on docker-compose.yml :
- Server is running on localhost:8080
- API documention is running on localhost:8082
Migrations are generated with sequilize-cli. In order to run the following commands you have to install npx by running
npm i -g npxWhen updating a model you need to generate a new migration with the command
npx sequelize migration:create --name [name-of-the-migration].
It will generate a new file under the directory migrations. You then need to update it accordingly with the updates made to the model.
Finaly you need to run the command
npx sequelize db:migrateto execute the new migration .
npm run commit, prompt you to fill out any required commit fields at commit time, to format your commits messages. With husky and lint-staged, it also run linters on git staged files.
npm run prettify, lint all files following rules wrote in .prettierrc.
npm run release, automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org.