Backend service for SOC job application and search platform.
Description, Input, and Output for every API endpoint.
-
POST /auth/login
- Description: Authenticates a user and returns a JWT token.
- Input:
{ "email": "string", "password": "string" }
- Output:
{ "message": "Login success", "token": "string", "name": "string" }
-
POST /auth/register
- Description: Registers a new user and sends a verification email.
- Input:
{ "name": "string", "email": "string", "password": "string" }
- Output:
{ "message": "Verification email sent" }
-
POST /auth/admin-register
- Description: Registers a new admin user and sends a verification email.
- Input:
{ "name": "string", "email": "string", "password": "string" }
- Output:
{ "message": "Verification email sent" }
-
POST /auth/logout
- Description: Logs out the user.
- Output:
{ "message": "Logout success" }
-
POST /auth/reset
- Description: Sends a password reset email.
- Input:
{ "email": "string" }
- Output:
{ "message": "Password reset email sent" }
-
POST /auth/reset/{token}
- Description: Resets the user's password using the provided token.
- Input:
{ "password": "string" }
- Output:
{ "message": "Password reset success" }
-
POST /auth/verify/{token}
- Description: Verifies the user's email and completes the registration.
- Input:
{ "gender": "string", "address": "string", "contact": "string" }
- Output:
{ "message": "Register and email verification success", "token": "string", "name": "string" }
-
GET /auth/google
- Description: Redirects to the Google login page.
- Output: Redirect to Google login page
-
GET /auth/google/callback
- Description: Handles the callback from Google after authentication.
- Output: Redirect to
/auth/google/success/{token}
-
GET /auth/google/protected
- Description: Endpoint called after successful Google authentication.
- Output:
{ "message": "Login success", "token": "string" }
-
GET /auth/google/success/{token}
- Description: Endpoint called after successful Google authentication.
- Output:
{ "message": "Login success", "token": "string" }
-
GET /auth/google/failure
- Description: Endpoint called when Google authentication fails.
- Output:
{ "message": "Failed to login" }
-
GET /auth/google/test
- Description: Test endpoint for authentication with Google.
- Output: HTML link to authenticate with Google
-
GET /user
- Description: Retrieves all users.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Users", "data": [...] }
-
GET /user/profile
- Description: Retrieves the profile of the authenticated user.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting User", "data": {...} }
-
GET /user/profile/{id}
- Description: Retrieves the profile of a user by ID.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting User", "data": {...} }
-
PUT /user/profile/{id}
- Description: Updates the profile of a user by ID.
- Input:
{ "name": "string", "email": "string", "password": "string", "avatar": "string", "gender": "string", "address": "string", "contact": "string", "cv": "string", "role": "string" }
- Output:
{ "code": 200, "status": "OK", "message": "Success updating User", "data": {...} }
-
GET /user/application/{id}
- Description: Retrieves all applications of a user by user ID.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Applications", "data": [...] }
-
GET /user/application
- Description: Retrieves all applications of the authenticated user.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Applications", "data": [...] }
-
POST /user/avatar
- Description: Uploads a profile picture for the authenticated user.
- Input: Form-data with
avatar
file - Output:
{ "code": 200, "status": "OK", "message": "Profile picture uploaded successfully.", "avatarPath": "string" }
-
POST /user/cv
- Description: Uploads a CV for the authenticated user.
- Input: Form-data with
cv
file - Output:
{ "code": 200, "status": "OK", "message": "CV uploaded successfully.", "cvPath": "string" }
-
GET /job
- Description: Retrieves all jobs.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Jobs", "data": [...] }
-
GET /job/{id}
- Description: Retrieves a job by ID.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Job", "data": {...} }
-
POST /job
- Description: Creates a new job.
- Input:
{ "title": "string", "job_desc": "string", "requirement": "string", "logo": "string", "quota": "number", "applicant": "number", "expId": "number", "typeId": "number", "positionId": "number", "closedAt": "date" }
- Output:
{ "code": 201, "status": "Created", "message": "Success creating Job", "data": {...} }
-
PUT /job/{id}
- Description: Updates a job by ID.
- Input:
{ "title": "string", "job_desc": "string", "requirement": "string", "logo": "string", "quota": "number", "applicant": "number", "expId": "number", "typeId": "number", "positionId": "number", "closedAt": "date" }
- Output:
{ "code": 200, "status": "OK", "message": "Success updating Job", "data": {...} }
-
DELETE /job/{id}
- Description: Deletes a job by ID.
- Output:
{ "code": 200, "status": "OK", "message": "Success deleting Job" }
-
GET /job/application/{id}
- Description: Retrieves all applications for a job by job ID.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Applications", "data": [...] }
-
GET /job/application
- Description: Retrieves all applications for all jobs.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Applications", "data": [...] }
-
GET /application
- Description: Retrieves all applications.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Applications", "data": [...] }
-
GET /application/{id}
- Description: Retrieves an application by ID.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Application", "data": {...} }
-
POST /application
- Description: Creates a new application.
- Input:
{ "userId": "number", "jobId": "number", "status": "string" }
- Output:
{ "code": 201, "status": "Created", "message": "Success creating Application", "data": {...} }
-
PUT /application/{id}
- Description: Updates an application by ID.
- Input:
{ "status": "string" }
- Output:
{ "code": 200, "status": "OK", "message": "Success updating Application", "data": {...}, "emailStatus": "string" }
-
DELETE /application/{id}
- Description: Deletes an application by ID.
- Output:
{ "code": 200, "status": "OK", "message": "Success deleting Application" }
- GET /position
- Description: Retrieves all positions.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Positions", "data": [...] }
- GET /jobType
- Description: Retrieves all job types.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Job Types", "data": [...] }
- GET /experience
- Description: Retrieves all experiences.
- Output:
{ "code": 200, "status": "OK", "message": "Success getting Experiences", "data": [...] }