Reporting-System is a robust Django-based RESTful API designed to facilitate a modern reporting system. It integrates essential features including secure JWT authentication, OTP-based email login for heightened security, advanced media file management capabilities, and efficient CRUD operations across various data entities. Developed with PostgreSQL as the database backend, the project follows the Model-View-Controller (MVC) architectural pattern, ensuring scalability, maintainability, and optimal performance.
- 🔒 JWT Authentication: Securely authenticate users and authorize access.
- 📧 Email Login with OTP: Authenticate users via email using OTP for added security.
- 🖼️ Media File Handling: Upload, retrieve, update, and delete media files (photos, videos, PDFs).
- 🔄 CRUD Operations: Perform CRUD (Create, Read, Update, Delete) operations for users, reports, and media files.
- Register: Allows users to create a new account using username, email, and password.
- OTP Login: Authenticate users via email OTP for login.
- Profile Management: Update user profile information including full name, date of birth, gender, address, and national ID.
- Upload Media: Upload various types of media files (photos, videos, PDFs) to the system.
- List Media: Retrieve a list of all media files uploaded by the authenticated user.
- Media Detail: View details of a specific media file, update its contents, or delete it.
- Create Report: Generate reports detailing incidents, including textual description and associated media files.
- List Reports: Retrieve a list of reports submitted by the authenticated user.
- Report Detail: View, update, or delete a specific report including its description and associated media files.
- Python 3.x
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/AbdullahBakir97/Django-Reporting-System/.git cd Django-Reporting-System
-
Install dependencies:
pip install -r requirements.txt
-
Configure the database in project/settings.py.
-
Run migrations:
python manage.py makemigrations python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Start the development server:
python manage.py runserver
- Build and run the Docker containers:
docker-compose up --build
- The application will be accessible at http://localhost:8000.
API documentation is available using Swagger UI. After starting the development server or Docker containers, navigate to http://localhost:8000/swagger/ to interactively explore and test the API endpoints.
- Method: POST
- Endpoint:
/api/register/
- Description: Register a new user.
- Method: POST
- Endpoint:
/api/otp-login/
- Description: Request an OTP for login.
- Method: PUT
- Endpoint:
/api/otp-login/
- Description: Verify OTP and login.
- Method: POST
- Endpoint:
/api/media/
- Description: Upload a new media file.
- Method: GET
- Endpoint:
/api/media/
- Description: List all media files of the logged-in user.
- Method: GET, PUT, DELETE
- Endpoint:
/api/media/<id>/
- Description: Retrieve, update, or delete a media file by ID.
- Method: POST
- Endpoint:
/api/reports/
- Description: Create a new report with multiple media files.
- Method: GET
- Endpoint:
/api/reports/
- Description: List all reports of the logged-in user.
- Method: GET, PUT, DELETE
- Endpoint:
/api/reports/<id>/
- Description: Retrieve, update, or delete a report by ID.