-
Organizations.
-
Chargepoints.
-
If you run Docker-compose use "make up" in wsl, check Makefile for context.
-
The Docker-compose container is slow in build up, bear with it please.
-
There is a Postman collection (if you prefer this) in root directory with the endpoints and a few skeletons on how request bodies should look like.
-
You can also run the application locally with NPM, instruction below.
Lously coupled API following a domain driven design architecture split into different layers following the "Inversion of Control" principle (Onion Architecture), where implementations (outer layers) depend upon specifications (inner layers).
-
Domain: holds the entities folder with the Domain objects Organization and Chargepoint. It is also the place where the specification of the CRUD operations sits (later implemented in the outer layers).
-
Application: this is the use-case layer of the API where both the bussiness logic layer (services) and the CRUD operations interfaces (previously mentioned) are implementated. The Datasource needed to run operation on the database is also set here.
-
Infrastructure: outer layer where the routing layer sits, here is where the controller endpoint classes are implemented. Input data from the Request object is validated on each route with the correspondant DTO object before accessing the Service layer.
-
npm run docker: transpiles the typescript application into a javascript module in the /dist folder and then runs the application on localhost. Datasource host on this command is set as "pg_container" to properly build the image. This command is run automatically inside the docker-compose container.
-
make up: Make script that builds the docker compose image of the application and runs it in localhost:5000.
-
make down: Make script that shuts down the current running docker compose container.
Make is a Linux CLI tool to run scripts easly. If you don't have it installed just go inside the "Makefile" that is sitting on the root folder and get the docker-compose command to run from there.
- Run --> make up.
-
npm run dev: runs ts-node + nodemon on index.ts for development purposes.
-
npm start: transpiles the typescript application into a javascript module in the /dist folder and then runs the application on localhost.
Application is launched in PORT 5000 (localhost:5000 if you wanna try in local).
- Run --> npm install.
- Make sure a Postgres server is setup.
- Run --> npm run dev or npm start.
- Testing.
- Swagger implementation.