A simple api for adding appointments at the SG Tech shop. Here is a README for the page structure and what I´ve learned with this project
Author: Joshua Hawatta
- How to use *.d.ts files for custom types.
- create DTOs in a efficiently way.
- Single Responsibility Principle and Dependency Inversion Principle from SOLID.
- building from scratch a whole MongoDB and TypeScript API using a hybrid of MVC and Pack By Feature architecture.
where all of my dependencies are. Probably you don´t have it if you cloned this repo. just run "npm install" and it´s done! :)
the main directory for all the application files and sub-directories.
.env.example: enviroment vars stay here. create a ".env" file and replace all examples with your own data.
.eslintrc.json: project linting configuration.
.gitignore: all files and directories the git must ignore.
package*.json: my package managers.
README.md: documentation.
tsconfig.json: typescript configuration file.
config: where the application, mailing and multer configurations are.
database: database connection.
DTOs: where it has other 2 sub-directories for my DTOs files (User and Appointments).
entities: same 2 sub-directories of DTOs. Here is where the controllers, routing and DB schemas are. There´s also a DiskStorage entity for handling uploads.
helpers: JWT and Mailing handlers, and date-handling functions.
interfaces: the interfaces of my entities.
middlewares: my requests validations directory, a validation results getter and a JWT verifyer.
types: custom types in here.
uploads: where all uploaded images stay.
server.ts: main file for running the application.