Closed danielordaan closed 2 years ago
The following features have been tested:
Merge conflicts btw?
When registering
Post pagination code is outdated
Giving a negative page number gives an unhandled error
Liked by doesn't work anymore
Likely because of very cryptic response from back-end
closes #316 closes #317 closes #319 closes #320 closes #321
What is it supposed to do
All backend functionality as of commit b677675a6733adcaedfeb44513724176584781d4 has been refactored for it to use the NestJS Framework.
Structural changes
The logical backend architecture consisted of the following path: Routes -> Optional Middlewares -> Controllers -> Daos
In the new backend architecture this has been refactored to the following architecture: Optional Guards -> Controllers -> Services -> Repositories
The guards allow or disallow access to the routes which are defined in the controllers. Routes are guarded by default but can be anonymized by using the
@AllowAny()
decorator. Request parameters and body attributes are from now on also encapsulated by decorators like@Param()
and@Body()
. Larger data structures have been defined in thedtos
folder.To use the DIP, NestJS uses a module driven architecture. Each module has one controller but can provide an arbitrary amount of services. Repositories that are used in these services must be declared via the
imports
array which contains the TypeOrm Entity references.On compilation environment variables are checked for their presence. This is defined in the
config.schema.ts
file. To view complete API documentation of the backend, run the backend withNODE_ENV=development
and go tohttp://localhost:8000/docs
.How can we test your branch
The new backend should seamlessly fit onto the existing frontend. The only changes made to the frontend were some route names. Tests can be ran by running
npm run test
. To get a quick view of all the endpoints, use the swagger documentation.1. General checklist
2. If relevant, front-end checklist
3. If relevant, back-end checklist
4. If relevant, test these browsers