To install the required packages, run the following command in a virtual environment:
pip install -r requirements.txt
To start the backend system, run the following commands:
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
So far, the backend system consists of three Django apps:
-
authen:
- Handles user authentication and authorization.
- Implements multi-factor authentication.
-
devices:
- Manages device metadata, including CRUD operations.
-
users:
- Endpoints for permission verification.
- Implements role-based access control.
-
admin (TODO):
- Manages user accounts and roles.
-
/users/
- GET: Retrieve a list of all users
-
/users/register/
- POST: Create a new user.
-
/users/<int:pk>/
- PUT: Update details of a specific user.
- DELETE: Delete a specific user.
-
/inventory/
- GET: Retrieve a list of all devices with pagination and filtering.
- POST: Create a new device.
-
/inventory/<uuid:pk>/
- PUT: Update details of a specific device.
- DELETE: Delete a specific device.
-
/inventory/locations/
- GET: Retrieve a list of all locations.
- POST: Create a new location.
-
/inventory/locations/<int:pk>/
- PUT: Update details of a specific location.
- DELETE: Delete a specific location.
-
/inventory/donors/
- GET: Retrieve a list of all donors or create a new donor.
- POST: Create a new donor.
-
/inventory/donors/<int:pk>/
- PUT: Update details of a specific donor.
- DELETE: Delete a specific donor.
-
/login/
- POST: Authenticate a user and return a JWT