Skip to content

ImVictorM/Trybe-Football-Club

Repository files navigation

Trybe Football Club (TFC) ⚽

Project Context 💡

This project is an informative website about football matches and classifications. @Trybe developed the front end for this project using React.

As the back-end developer, I built an API using Typescript, Node.js, express, and Sequelize and integrated it with the front end using Docker and docker-compose. The API allows users to add new matches and update existing ones by consuming a database.

To ensure security and prevent unauthorized access, users must log in to obtain a token to add a match. The login system uses JWT authentication and verifies user credentials against a user database.

Acquired Knowledge 📖

In this project, I was able to:

  • Build and API using the Model-Service-Controller (MSC) architecture;
  • Build a CRUD with TypeScript, using Sequelize ORM;
  • Use OOP and SOLID concepts;
  • Create and associate tables using Sequelize Models and Migrations;
  • Use Docker to integrate front-end with back-end;
  • Write integration tests;
  • Write MySQL raw queries.

Back-End Main Technologies 🧰

Development

TypeScript Express Sequelize Node.JS MySQL JWT Joi Docker Insomnia
typescript express sequelize nodejs mysql jwt joi docker insomnia

Test

Mocha Chai Sinon
mocha-js chai-js sinon-js

Running the application ⚙️

You must have node, docker, and docker-compose installed

  1. Clone the repository and enter it
git clone git@github.com:ImVictorM/Trybe-Football-Club.git && cd Trybe-Football-Club
  1. Get the containers running
npm run compose:up

It can take a while for the application to be up.
The front end will be running on http://localhost:3000 (PORT 3000).
The back end will be running on http://localhost:3001 (PORT 3001).

Endpoints 🌐

Click here to export automatically:

Run in Insomnia}

Or just import the file insomniaRoutes.json inside your environment: https://docs.insomnia.rest/insomnia/import-export-data