This repository contains the backend code for a football management system.
- Node.js
- Express
- MongoDB
- Clone this repository
- Navigate to the root directory of the project in your terminal
- Run
npm installto install the project dependencies - Create a
.envfile in the root directory and set the required environment variables (see.env.examplefor an example) - Run
npm startto start the server
The API has the following routes:
/coach: handles coach-related operations/footballer: handles footballer-related operations/stadium: handles stadium-related operations/team: handles team-related operations
Each route has its own set of supported HTTP methods and corresponding endpoints, which are described in detail below.
The /coach route handles operations related to coaches.
GET /coach/coaches: gets a list of all coachesGET /coach/coaches/:id: gets a coach by IDPOST /coach/coaches: adds a new coachPUT /coach/coaches/:id: updates a coach by IDDELETE /coach/coaches:id: deletes a coach by ID
The /footballer route handles operations related to footballers.
GET /footballer/footballers: gets a list of all footballersGET /footballer/footballers/:id: gets a footballer by IDPOST /footballer/footballers: adds a new footballerPUT /footballer/footballers/:id: updates a footballer by IDDELETE /footballer/footballers/:id: deletes a footballer by ID
The /stadium route handles operations related to stadiums.
GET /stadium/stadiums: gets a list of all stadiumsGET /stadium/stadiums/:id: gets a stadium by IDPOST /stadium/stadiums: adds a new stadiumPUT /stadium/stadiums/:id: updates a stadium by IDDELETE /stadium/stadiums/:id: deletes a stadium by ID
The /team route handles operations related to teams.
GET /team/teams: gets a list of all teamsGET /team/teams/:id: gets a team by IDPOST /team/teams: adds a new teamPUT /team/teams/:id: updates a team by IDDELETE /team/teams/:id: deletes a team by ID