/trybe-futebol-clube

Website for managing football championships info. RESTful API developed with TypeScript (OOP), Node.js, Sequelize (for MySQL) and Docker.

Primary LanguageTypeScript

Project Trybe Futebol Clube

Description

Trybe Futebol Clube is a complete website built on its front-end, back-end and database layers. The application is made for managing football championships info. It has features such as the visualization of teams, matches and leaderboards, besides adding and updating new matches - which change the leaderboards.

We had to build the application's back-end from scratch during the project while the Trybe team provided the front-end. Among other developed structures, we have the main one, which is a RESTful API that connects the two ends of the application using OOP and SOLID. It is responsible for authenticating and authorizing users to use different CRUD endpoints and is organized in an MSC (model, service and control) architecture.

The back-end was mainly made using TypeScript, Node.js and Express.js. To handle the database (and structure it with migrations), we built the MSC model layer using the ORM tool Sequelize, which also facilitates future changes to the code and database. Users authentications and authorizations were made using JWT (JSON Web Token). Finally, the project has more than 80% test coverage, developed using Mocha, Chai and Sinon.


Main used technologies:

TypeScript (with OOP)

Node.js

Express.js

JSON Web Token (JWT)

Sequelize

MySQL

Mocha, Chai and Sinon

Docker


Instructions to utilize the application

To run the application on your machine, you need to have Docker installed.

Once the repository is cloned, get inside the application's root directory and use the command npm install, then enter the directory app and use the command docker-compose up -d to run the orchestrated docker. From that point on, you can access and utilize the application (via the front-end) locally in your browser using Port 3000.

After running docker-compose, you can go into the back-end directory and use the npm run dev command to use it. For the front-end, enter the front-end directory and use the npm start command. To check the test coverage, use the command npm run test:coverage inside the back-end directory.


You can interact with the backend API through an HTTP client (Insomnia, Postman, HTTPie, etc.) and make requests to it. Down below is a list of the endpoints.

Endpoint for Login
  • post('/');
  • post('/validate');
Endpoints for Teams
  • get('/');
  • get('/:id');
Endpoints for Matches
  • post('/');
  • get('/');
  • get('/:id');
  • get('/:id/finish');
Endpoints for Leaderboards
  • get('/');
  • get('/home');
  • get('/away');

Commit history

You can check the entire commit history to see how the project was developed step by step. All commits were based on the Conventional Commits guide, keeping an organization and accurate description of what was done with each change.

Contact

You can get in touch with me at pedronerislc@gmail.com or by Linkedin.