A comprehensive ticket management system where users can raise support tickets, view their status, and administrators can manage these tickets (assign, resolve, etc.). This system comprises a Django REST API backend and a React frontend.
- User Authentication: Secure login and registration using JWT.
- Ticket Management:
- Users: Create, update, delete, and view their own tickets.
- Admins: Assign tickets, change statuses, and delete any ticket.
- Role-based Permissions:
- Admins: Manage all tickets.
- Users: Manage only their own tickets.
- Admin Dashboard: A centralized panel for managing tickets.
- User Dashboard: Personalized view for managing individual tickets.
- Backend: Django, Django REST Framework, PostgreSQL
- Frontend: React, Tailwind CSS (or Material UI)
- Authentication: JWT (JSON Web Token)
- Containerization: Docker and Docker Compose
-
Clone the repository:
git clone <repository-url> cd <project-folder>/backend
-
Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install backend dependencies:
pip install -r requirements.txt
-
Set up environment variables: Create a
.env
file in thebackend
directory with the following:SECRET_KEY='your-django-secret-key' DEBUG=False DB_NAME='ticketpro_db' DB_USER='postgres' DB_PASSWORD='your-database-password' DB_HOST='ticket-db' DB_PORT='5432' ALLOWED_HOSTS=127.0.0.1 CSRF_TRUSTED_ORIGINS=http://localhost:5173 CORS_ALLOWED_ORIGINS=http://localhost:5173
-
Run database migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
The backend will be available at http://127.0.0.1:8000
.
-
Navigate to the frontend directory:
cd ../frontend
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will be available at http://localhost:5173
.
- POST
/api/register/
: Register a new user. - POST
/api/token/
: Obtain JWT tokens (login). - POST
/api/token/refresh/
: Refresh the JWT token. - POST
/api/logout/
: Log out (invalidate refresh token).
- GET
/api/tickets/
: List all tickets. - POST
/api/tickets/
: Create a new ticket. - GET
/api/tickets/{id}/
: View details of a specific ticket. - PUT
/api/tickets/{id}/
: Update a ticket. - DELETE
/api/tickets/{id}/
: Delete a ticket.
- GET
/api/comments/
: List comments for a ticket. - POST
/api/comments/
: Add a comment to a ticket.