This API is used for tracking numerical team data. Users can create and join groups. Creators (Admins) of groups can create sub groups called teams. Admins can also create categories for members of teams to log points under. Members can log these points for themselves. Once logged, those points belong to the user, and the team they dictate the points are for.
A Group can have many teams and teams can have many members. A member can be part of multiple teams.
(in progress)
-
Pull the repository
-
Build the docker image:
docker build -t points-api .
- Run the docker container:
docker run -p 3000:3000 points-api
(The Database is not currently hosted)
- Node
- Fastify
- Prisma ORM
- MySQL
- Docker
-
Client:
- Purpose: Initiates requests to the API. This could be a web application, mobile app, or any other client interface.
- Details: Sends HTTP requests to the server to perform actions like retrieving data, creating new entries, or updating existing ones.
-
Fastify:
- Purpose: Acts as the web server framework that handles incoming HTTP requests and routes them to the appropriate controller.
- Details: Provides a fast and efficient way to manage routing, middleware, and request/response handling.
-
Controllers:
- Purpose: Serve as intermediaries between the HTTP requests and the business logic. They validate input and call the corresponding service.
- Details: Ensure that the request is properly handled, input is validated, and the correct service is invoked.
-
Services:
- Purpose: Contain the core business logic of the application. They process data and interact with the database.
- Details: Encapsulate the business logic to keep the application modular and maintainable. They handle CRUD operations and other business processes.
-
Database (MySQL):
- Purpose: Acts as the persistent storage layer for the application data.
- Details: Stores and retrieves data efficiently, ensuring data integrity and providing support for complex queries.
-
Prisma ORM:
- Purpose: Facilitates database interactions by providing an abstraction layer over raw SQL queries.
- Details: Simplifies database operations with an intuitive API, supports migrations, and ensures type safety.
-
Docker:
- Purpose: Provides containerization for the application, ensuring consistency across different environments.
- Details: Packages the application and its dependencies into containers, making it easy to deploy and manage.
- The Client sends an HTTP request to the Fastify server.
- Fastify routes the request to the appropriate Controller.
- The Controller processes the request, validates input, and calls the corresponding Service.
- The Service performs the business logic and interacts with the Database via Prisma ORM.
- The Database retrieves or stores the necessary data.
- The Service processes the data and sends it back to the Controller.
- The Controller formats the response and sends it back to the Client through the Fastify server.