(earn 200 dollars)
TFC is an website about football matches and ranking. If you are logged in, it is possible to edit and register new matches, as long as you are an admin user (authentication and authorization).
It is running on a DigitalOcean Droplet. Three services (backend, frontend, and MySQL database) are running in Docker containers. It was set up using Bash. Link demo:
http://projects.pimentel.live/tfc/
URL to the client application: http://projects.pimentel.live/tfc
Use the admin user to login
email: [email protected]
password: secret_admin
Endpoints GET: /teams /teams/:id /matches matches/:id /leaderboard /leaderboard/home /leaderboard/away
You also can see the server side running: http://projects.pimentel.live:3001
Endpoints GET: /teams /teams/:id /matches matches/:id /leaderboard /leaderboard/home /leaderboard/away
(e.g. http://projects.pimentel.live:3001/matches
)
- Dockerization
- Data Modeling - ORM
- API RESTful Development
- CRUD with TypeScript
- SOLID Principles
- Layered Architecture
This project utilizes Docker for containerization, including the Dockerization of apps, network, volume, and compose.
Data modeling is achieved using MySQL in conjunction with Sequelize. This involves the creation and association of tables using Sequelize models.
The project involves the construction of a RESTful API with endpoints to consume the models created during data modeling.
A CRUD (Create, Read, Update, Delete) functionality is implemented using TypeScript, with the support of an Object-Relational Mapping (ORM) for efficient data manipulation.
The project follows the SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) to promote maintainability, >scalability, and readability in the codebase.
The project adopts a layered architecture, organizing code into distinct layers (e.g., presentation, business logic, data access) to enhance modularity, flexibility, and >maintainability (Controller, Service and Model).
This project is dockerized and uses data modeling through Sequelize. The API is consumed by a pre-provided front-end.
- The frontend of this project was developed and provide by Trybe(https://www.betrybe.com). All rights reserved.
Before you begin, ensure you have the following prerequisites installed:
- Node.js (16.14.0 LTS or higher):
bash nvm use 16.14
- Docker (2.5 or higher):
bash docker-compose --version
- Choose how to clone the Repository:
# Clone using HTTPS git clone https://github.com/dopimentel/back-end-trybe-futebol-clube.git # Clone using SSH git clone [email protected]:dopimentel/back-end-trybe-futebol-clube.git
- Acess the project root folder:
cd back-end-trybe-futebol-clube
-
You can run the entire application with only one command! Open an integrated terminal on root directory and run this command:
npm run compose:up
Wait a while (to make sure the container has finished loading) then you can access the application in your browser at
localhost:3000
to use the client application orlocalhost:3001
to see the server side through endpoints (/matches, /teams, /leaderboard) (e.g: http://localhost:3001/leaderboard/).
-
Use this user to log in as an administrator:
email: [email protected] password: secret_admin
-
When you finish, you can remove these containers with:
npm run compose:down
Make sure you are in /backend folder
npm run test