ahmed-dinar / football_manager

Football Manager App (Backend)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Football Manager App (Backend)

Language Javascript (NodeJS)
Framework ExpressJS
Database MySQL
Database Name football_manager
$ npm install
$ node server.js

API Documentation

Base Url: http://localhost:3000

POST /api/signup

manager registration

headers: {
  Content-Type: 'application/x-www-form-urlencoded'
}

body: {
  email: '',
  name: ''
  password: '', 
  confirmPassword: ''
}
Success Response: 200
Error Response: 400
POST /api/signin

manager login

headers: {
  Content-Type: application/x-www-form-urlencoded
}

body: {
  email: '',
  password: ''
}
Success Response: 200
{
  access_token: '',
  payLoad: {}
}
Error Response: 401
GET /api/team/list

get current logged in managers team list

headers: {
  Content-Type: 'application/x-www-form-urlencoded',
  access_token: ''
}
Success Response: 200
[]
Error Response: 401
POST /api/team/create

create a team

headers: {
  Content-Type: 'application/x-www-form-urlencoded',
  access_token: ''
}

body: {
  name: '',
  origin: '',
  net_worth: ''
}
Success Response: 200
Error Response: 400
GET /api/team/:teamName

get a specific team details

headers: {
  Content-Type: 'application/x-www-form-urlencoded',
  access_token: ''
}
Success Response: 200
{}
Error Response: 400
GET /api/team/:teamName/players

get a specific team's player list

headers: {
  Content-Type: 'application/x-www-form-urlencoded',
  access_token: ''
}
Success Response: 200
[]
Error Response: 400
GET /api/team/:teamName/player/:playerName

get a specific team's player details

headers: {
  Content-Type: 'application/x-www-form-urlencoded',
  access_token: ''
}
Success Response: 200
{}
Error Response: 400
POST /api/team/:teamName/addplayer

add a player to a team

headers: {
  Content-Type: 'application/x-www-form-urlencoded',
  access_token: ''
}

body: {
  name: '',
  position: '',
  rating: '',
  salary: ''
}
Success Response: 200
Error Response: 400
POST /api/team/:teamName/delete/:playerName

detele a player from a team

headers: {
  Content-Type: 'application/x-www-form-urlencoded',
  access_token: ''
}
Success Response: 200
Error Response: 400
POST /api/team/:teamName/update/:playerName

update a player info of a team

headers: {
  Content-Type: 'application/x-www-form-urlencoded',
  access_token: ''
}

body: {
  position: '',
  rating: '',
  salary: ''
}
Success Response: 200
Error Response: 400

About

Football Manager App (Backend)


Languages

Language:JavaScript 100.0%