API that serves the latest score of fixtures of matches in a “Mock Premier League”
- Node JS
- Express
- ESLint
- Babel
- MongoDB
- Redis
- POSTMAN
- Jest
To work with this project, you need to have the following setup on your local machine
$ git clone https://github.com/Baystef/mock-premier-league.git
$ cd Mock-PL
$ npm i
$ npm run seed
$ npm run start:dev
If redis has been successfully installed and configured (For windows users)
$ start redis-server.exe redis.windows.conf
$ start redis-cli.exe
On the redis-cli, send a
$ ping
you should get a
- PONG
response this means redis port is live and ready.
To see changes in real time, send
$ monitor
$ npm test
// login as admin
{
email: "admin@mockpl.com",
password: "password"
}
// login as user
{
email: "mason@manutd.com",
password: "password"
}
API BASE URL https://mock-pl.herokuapp.com/.
method | route | description | data |
---|---|---|---|
POST | /users/signup | Sign Up | {first_name, last_name, email, password} |
POST | /users/signin | Sign In | {email, password} |
POST | /users/logout | Logout |
method | route | description | data |
---|---|---|---|
GET | /users | Get all users | |
PATCH | /users/admin/:email | Create Admin |
method | route | description | data |
---|---|---|---|
POST | /teams | Add a team | {teamName, noOfPlayers, coach} |
GET | /teams | Get all teams | |
GET | /teams?teamName | Get team by name | |
GET | /teams?coach | Get team by coach | |
PUT | /teams/:teamName | Update a team | {teamName, noOfPlayers, coach} |
DELETE | /teams/:teamName | Delete a team |
method | route | description | data |
---|---|---|---|
POST | /fixtures | Create a fixture | { homeTeam, awayTeam, fixtureDate } |
GET | /fixtures | Get all fixtures | |
GET | /fixtures?status | Get pending or completed fixtures | |
GET | /fixtures?fixtureLink | Get a fixture | |
PUT | /fixtures/:fixtureLink | Update a fixture | { homeTeam, awayTeam, fixtureDate } |
DELETE | /fixtures?fixtureLink | Delete a fixture | |
PATCH | /fixtures/play/:fixtureLink | Complete a fixture |
method | route | description | data |
---|---|---|---|
POST | /search?term | Robust search with home or away team as term query |
method | route | description |
---|---|---|
GET | /users | Get all users |
PATCH | /users/admin/:email | Create Admin |
POST | /teams | Add a team |
PUT | /teams/:teamName | Update a team |
DELETE | /teams/:teamName | Delete a team |
POST | /fixtures | Create a fixture |
PUT | /fixtures/:fixtureLink | Update a fixture |
PATCH | /fixtures/play/:fixtureLink | Complete a fixture |
DELETE | /fixtures?fixtureLink | Delete a fixture |
https://documenter.getpostman.com/view/7629676/SVn2Pvxo
https://mock-pl.herokuapp.com/
Daramola Adebayo
The code in this project is licensed under MIT license.