- Table of Contents
- ๐กFeatures
- ๐ System Design
- ๐งโ๐ป Installation Steps
- Licence
- ๐จโ๐ปAuthor
Here are some of the project's best features:
-
Hitmen ๐ต๏ธ
- List Hitmen โ
- Deactivate Hitman if the hitman is retired or die in a mission โ
-
Users ๐งโ๐ผ๐ฉโ๐ผ
- Register user into the platform โ
- Login user into the system using JWT to provide a token to users โ
-
Hits ๐ฏ
- List hits โ
- Hit detail โ
- Create a Hit โ
- Assign a Hitman toa Hit โ
- Update Hit status - options(failed, completed) โ
- Assign a hitman to a Manager โ
- Use of container technology (Docker) to package code โ
- Override of the user to create instances of Hitman an Manager โ
- Implement JWT for manage authentication โ
- Implement Swagger documentation โ
In order to develop the API, I separated responsibilities for each one of them by authentication, hits and hitmen, which were the main entities.
In addition to this, I added an illustrative section of permissions by colors to which each of the system roles could access, being green for ls hitman, blue for the manager and red for the big boss.
For a local enviroment I package the project using techonolgies like:
- Docker ๐
- Docker compose ๐ณ
The idea is create an isole enviroment in which can separate the services like th app and the database and connect them in an easy way through environment variables and be ready for deploy.
- Clone the repository
git clone git@github.com:javieramayapat/zebrands-api.git
- Create the env file in the root of the project
.env
and copy the content of the.env.example
to configurate environment variables. - You can run the following command to buil the image.
$ docker-compose build
- Once the image is built, run the container:
$ docker-compose up -d
- Run the migrations with
docker-compose run app sh -c "python manage.py migrate
- Create a superuser with the command
docker-compose run app sh -c "python manage.py createsuperuser
- Load the seed data files using the command
docker-compose run app sh -c "python manage.py seed
- Now go to http://127.0.0.1:8000/docs and enjoy the app.
To use the API endpoint you need to be authenticated
-
Authenticated with your credential into
auth/login/
endpoint with your username and password to get your token and request information from the API. -
Copy you your
access token
-
Use the
Authorize button
at the top of the documentation, in the value field add the prefixToken
+your_token
with a space in between for proper authentication. -
Apply the authorization and start playing with the API which is the fun part of it ๐.
This project is licensed under the MIT License
Made with ๐ by javieramayapat