This section provides a detailed overview of the internal architecture and important modules used in the NavigoLearn API. This is primarily meant for developers who wish to understand the inner workings of the API or contribute to its development.
- Internal Architecture
- Table of Contents
- Scripts
- Controllers
- Types
- Helpers
- Routes
- Middleware
- Utilities
- SQL
Scripts are used to perform various tasks, such as starting the server or running tests.
- Further Reading: Scripts Documentation (To be added)
Controllers are the handlers that respond to various HTTP requests. Each controller has different tasks, such as handling user authorization or dealing with specific database records.
- Further Reading: Controllers Documentation (To be added)
Types are used to define the structure of various data entities (like Users or Events) and their relationships.
Models define the structure of the various data entities (like Users or Events), their relationships, and also the methods to interact with the database.
- Further Reading: Models Classes Documentation (To be added)
Responses classes are used to send data back to the client in a consistent format.
- Further Reading: Responses Classes Documentation (To be added)
Helpers are used to perform various tasks so that the controllers are not bloated with code that might change.
- Further Reading: Helpers Documentation (To be added)
Database management helpers are used to perform various tasks related to the database.
- Further Reading: Database Management Documentation (To be added)
Response management helpers are used to format the response JSON sent back to the client. This usually uses Responses classes
Routes decide how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (GET, POST, and so on).
This uses Controllers
- Further Reading: Routes Documentation (To be added)
Middleware functions have access to the request object (req), the response object (res), and the next function in the application’s request-response cycle.
- Further Reading: Middleware Documentation (To be added)
Validators are middlewares used to check the integrity of incoming data before it's processed by the application.
- Further Reading: Validators Documentation (To be added)
Utility functions and classes provide useful features used across the application.
- Further Reading: Utility Documentation (To be added)
Remember, understanding the codebase's architecture is crucial for making meaningful contributions or understanding how to resolve issues. You are encouraged to explore each section in detail.
SQL files are used to create and update the database schema. They are also used to create stored procedures and functions for creating dummy data.
- Further Reading: SQL Documentation