-
GET /api/v1/*
-> This is just a placeholder to show how a request and response JSON looks like.Sample Request Body
{ "data": { "type": "replies", "attributes": { } } }
Sample Response Body
{ "meta": {}, "data": { "type": "reply", "attributes": { } } }
Create a mysql db and update the configs accordingly. Build the project
yarn build
Runs the migrations
yarn db migration:run
Start the server in watch mode
yarn start
Run tests
yarn test
yarn test:coverage #for test coverage report
Linting
yarn lint
yarn lint --fix #for fixing all the lint errors
src
├── controllers # All the controllers
├── db # Migrations and orm config
├── entity # Typeorm entities
├── errors # Custom errors
├── lib # Any third party and first party integrations
├── middlewares # Just middlewarawes
├── routes # Register all the controller with express
├── schema # Joi schema definitions
├── serializers # JSONAPI serilizer files
├── services # Core business logic
├── types # Type definitions
└── config files
-
- Follows REST standarads.
- Future scope for versioning of APIs.
- I wanted to write something more standardised so I chose to follow https://jsonapi.org standards. The API expects and also reponds back accoding to the jsonapi standards.
-
- Joiful schema is used to validate the requests and any repsonses from third part APIs.
-
- Currenlty there's one workflow, which is triggered on push to master, to build and run the tests in github actions
- Logging
- Authorization
- Dockerize the application
- API documentation (Swagger)
- Deployment strategy
- Rate limiting
- Load testing