Ajudaê is a ticket management system designed to streamline support processes. Users can create tickets targeting specific departments, and administrators can manage and redirect tickets to the appropriate team if needed. The system supports one general administrator and one administrator per support team.
- Marketing
- Produto
- Financeiro
- Other teams (with routes for adding new teams dynamically)
The backend is built using Prisma with a PostgreSQL database. Below is the Prisma schema that defines the data models and relationships.
The system includes the following API routes:
POST /auth/login
: Authenticates a user and returns a session token.POST /auth/refresh
: Refreshes the session token.POST /auth/logout
: Revokes the session token.POST /auth/logout/all
: Revokes all sessions token
POST /user/register
: Registers a new user.GET /user
: Retrieves a list of users (admin only).GET /user/:id
: Retrieves a specific user by ID.PUT /user/:id
: Updates a user's details.DELETE /user/:id
: Deletes a user (admin only).
Users can create tickets targeting a specific department (e.g., Marketing, Produto, Financeiro). Each team has one administrator who can:
- Review tickets assigned to their team.
- Redirect tickets to another team if the category is incorrect.
- Update ticket status (
Aberto
,Em_andamento
,Fechado
) and priority (Baixa
,Média
,Alta
).
The general administrator oversees the entire system and can manage all tickets and teams.
graph TD
A[User Creates Ticket] -->|Selects Category| B{Ticket Assigned to Team}
B -->|Correct Team?| C[Team Administrator Reviews]
B -->|Incorrect Team| D[Team Administrator Redirects]
D --> E{Ticket Reassigned to Correct Team}
C --> F[Process Ticket]
E --> F
F -->|Update Status| G{Ticket Status: <br> Aberto, Em_andamento, Fechado}
G -->|Close Ticket| H[Ticket Closed]
To run the Ajudaê server, follow these steps:
- Install Docker: Ensure Docker is installed on your computer. Download and install it from Docker's official website if not already installed.
- Run the Server: Execute the following command in the project directory to start the server using Docker Compose:
This will build and run the necessary containers for the application and database.
docker compose up
- Environment Variables: Ensure a
.env
file is configured with theDATABASE_URL
for the PostgreSQL database. - Access Documentation: Once the application is online, visit the API documentation at:
http://localhost:3000/docs
- Implement ticket creation and management routes.
- Add functionality for administrators to redirect tickets.
- Enhance the UI for ticket creation and tracking.