This is the dragon ball rest api, an idea to provide to anyone, relevant information about the anime. The application is compound of the following features:
- SSL support
- Data caching with Redis
- Clustering via pm2 package
- JWT authentication and routes protection
- Fancy OAPI Front-end
- Notifications through AWS's SES
As a side note endpoint tests via mocha and supertest packages were added for major robustness.
This is the list of endpoints currently available:
Verb | Resource | Description | Scope |
---|---|---|---|
GET | /swagger | Swagger UI | Public |
POST | /auth | Authentication resource | Public |
GET | /characters | Get the list of characters | Public |
GET | /characters/:name | Get a single character | Public |
POST | /characters | Create a character | Protected |
DELETE | /characters/:id | Delete a character | Protected |
PATCH | /characters/:id | Update a character | Protected |
GET | /sagas | Get the list of sagas | Public |
GET | /sagas/:name | Get a single saga | Public |
POST | /sagas | Create a saga | Protected |
DELETE | /sagas/:id | Delete a saga | Protected |
GET | /films | Get a list of related films | Public |
GET | /films/:name | Get info about a single film | Public |
POST | /films | Create a film | Protected |
DELETE | /films/:id | Delete a film | Protected |
There's a OAPI resource to test all the endpoints, you have to log yourself in in order to test those endpoints who are protected. This is how the swagger page looks like:
Before doing anything you should clone the repo:
foo@bar:~$ git clone https://github.com/wwleak/dragonball.git
You should first install docker and docker compose by running:
foo@bar:~$ sudo apt-get install docker.io docker-compose
Then log into your docker hub account by typing:
foo@bar:~$ docker login
If for any reason, you come across with the following error while trying to log in (as i did) ...
`Error saving credentials: error storing credentials - err: exit status 1, out: `Error calling StartServiceByName for org.freedesktop.secrets: Timeout was reached``
... I could solve that by installing the following packages:
foo@bar:~$ sudo apt install gnupg2 pass
Finally run compose:
foo@bar:~$ docker-compose up
Enjoy life!
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE.md file for details
MADE WITH ❤ BY ABRAHAM