bug2progress is a RESTful API aimed at anyone trying to build a bugtracker, specially for project tracker for educational organizations.
The repository for frontend (in porgress).
Often times, the teammates with low to zero contribution gets away- and often it is hard to make them use the industry standard solutions because of various contraints. So a project like this could be a customized (for each institutions) entry point for students.
pnpm
, prisma
is required to run this project. Make sure there is node.js
and docker
is installed beforehand.
npm install -g pnpm
Clone the repository.
git clone https://github.com/snh1999/bug2progress
cd bug2progress
pnpm install
Docker compose to manage database. [Note- make sure you check the docker-compose.yml
file for port, passowrd and other customizations].
docker compose up db -d
for prisma migration (make sure the database is running)
npx prisma migrate dev
finally run the server
pnpm run start:dev
to view swagger documentation, visit http://localhost:8080/api
(given you have not changed the port in main.ts
)
NOTE: The automatic tests have not been rewritten after User module.
To Run the code pnpm(Package Manager) docker(docker compose up db -d
-for database operations) needs to be installed.
This repository contains the documentation for the API endpoints of the project.
- bug2progress
- Why?
- Quickstart
- User
- Organization
- Repository
- Create Repository {orgId}
- Get All Repositories {orgId}
- View Repository {orgId}/{repositoryId}
- Delete Repository {orgId}/{repositoryId}
- Edit Repository {orgId}/{repositoryId}
- Fork Repository {orgId}/{repositoryId}/fork
- Add Collaborator {orgId}/{repositoryId}/collaborators
- Remove Collaborator {orgId}/{repositoryId}/collaborators/{username}
- View Collaborators {orgId}/{repositoryId}/collaborators
- List Branches {orgId}/{repositoryId}/branches
- Create Branch {orgId}/{repositoryId}/branches
- Delete Branch {orgId}/{repositoryId}/branches/{branchName}
- View Pull Requests {orgId}/{repositoryId}/pull-requests
- Create Pull Request {orgId}/{repositoryId}/pull-requests
- View Pull Request {orgId}/{repositoryId}/pull-requests/{pullRequestId}
- Merge Pull Request {orgId}/{repositoryId}/pull-requests/{pullRequestId}/merge
- Close Pull Request {orgId}/{repositoryId}/pull-requests/{pullRequestId}/close
- Comment on Pull Request {orgId}/{repositoryId}/pull-requests/{pullRequestId}/comments
- Get Comments {orgId}/{repositoryId}/pull-requests/{pullRequestId}/comments
- Delete Comment {orgId}/{repositoryId}/pull-requests/{pullRequestId}/comments/{commentId}
ALL PATHS START WITH api/v1
- URL:
/register
- Method:
POST
- Description: Registers a new user.
- Request Body:
- Content-Type:
application/json
- Schema:
RegisterDto
- Content-Type:
- URL:
/login
- Method:
POST
- Description: Authenticates a user and generates an access token.
- Request Body:
- Content-Type:
application/json
- Schema:
AuthDto
- Content-Type:
- URL:
/forgotPassword
- Method:
POST
- Description: Sends a password reset email to the user's email address.
- Request Headers:
host
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
PasswordForgotDto
- Content-Type:
- URL:
/resetPassword/{token}
- Method:
POST
- Description: Resets the user's password using the provided token.
- Request Parameters:
token
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
PasswordResetDto
- Content-Type:
- URL:
/logout
- Method:
POST
- Description: Logs out the authenticated user.
- URL:
/changePassword
- Method:
POST
- Description: Changes the password for the authenticated user.
- Request Body:
- Content-Type:
application/json
- Schema:
ChangePasswordDto
- Content-Type:
- URL:
/user
- Method:
GET
- Description: Retrieves a list of all users.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
User[]
- Content-Type:
- URL:
/user/{username}
- Method:
DELETE
- Description: Deletes a specific user.
- Request Headers:
Authorization
(string, required)
- URL:
/user/{username}
- Method:
GET
- Description: Retrieves the profile of a specific user.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
User
- Content-Type:
- URL:
/user/me
- Method:
GET
- Description: Retrieves the profile of the authenticated user.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
User
- Content-Type:
- URL:
/user/me
- Method:
PUT
- Description: Updates the profile information of the authenticated user.
- Request Headers:
Authorization
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
UserEditDto
- Content-Type:
- URL:
/user/me/delete
- Method:
DELETE
- Description: Deletes the profile of the authenticated user.
- Request Headers:
Authorization
(string, required)
- URL:
/user/me/deactivate
- Method:
PUT
- Description: Deactivates the profile of the authenticated user.
- Request Headers:
Authorization
(string, required)
- URL:
/organization
- Method:
POST
- Description: Creates a new organization.
- Request Headers:
Authorization
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
OrganizationCreateDto
- Content-Type:
- URL:
/organization
- Method:
GET
- Description: Retrieves a list of all organizations.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
Organization[]
- Content-Type:
- URL:
/organization/{orgId}/members
- Method:
GET
- Description: Retrieves a list of all members in the organization.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
Member[]
- Content-Type:
- URL:
/organization/{orgId}/members
- Method:
POST
- Description: Allows a user to join an organization.
- Request Headers:
Authorization
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
JoinOrganizationDto
- Content-Type:
- URL:
/organization/{orgId}/members/{username}
- Method:
DELETE
- Description: Allows a user to leave an organization.
- Request Headers:
Authorization
(string, required)
- URL:
/organization/{orgId}/members/{username}/promote
- Method:
PUT
- Description: Promotes a member to an admin role within the organization.
- Request Headers:
Authorization
(string, required)
- URL:
/organization/{orgId}/members/{username}/demote
- Method:
PUT
- Description: Demotes an admin member within the organization.
- Request Headers:
Authorization
(string, required)
- URL:
/organization/{orgId}/repository
- Method:
POST
- Description: Creates a new repository within the organization.
- Request Headers:
Authorization
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
RepositoryCreateDto
- Content-Type:
- URL:
/organization/{orgId}/repository
- Method:
GET
- Description: Retrieves a list of all repositories within the organization.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
Repository[]
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}
- Method:
GET
- Description: Retrieves information about a specific repository within the organization.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
Repository
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}
- Method:
DELETE
- Description: Deletes a specific repository within the organization.
- Request Headers:
Authorization
(string, required)
- URL:
/organization/{orgId}/repository/{repositoryId}
- Method:
PUT
- Description: Updates the information of a specific repository within the organization.
- Request Headers:
Authorization
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
RepositoryEditDto
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}/fork
- Method:
POST
- Description: Forks a repository within the organization.
- Request Headers:
Authorization
(string, required)
- URL:
/organization/{orgId}/repository/{repositoryId}/collaborators
- Method:
POST
- Description: Adds a collaborator to a repository within the organization.
- Request Headers:
Authorization
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
CollaboratorAddDto
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}/collaborators/{username}
- Method:
DELETE
- Description: Removes a collaborator from a repository within the organization.
- Request Headers:
Authorization
(string, required)
- URL:
/organization/{orgId}/repository/{repositoryId}/collaborators
- Method:
GET
- Description: Retrieves a list of collaborators for a specific repository within the organization.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
Collaborator[]
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}/branches
- Method:
GET
- Description: Retrieves a list of branches for a specific repository within the organization.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
Branch[]
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}/branches
- Method:
POST
- Description: Creates a new branch within a specific repository in the organization.
- Request Headers:
Authorization
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
BranchCreateDto
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}/branches/{branchName}
- Method:
DELETE
- Description: Deletes a specific branch within a repository in the organization.
- Request Headers:
Authorization
(string, required)
- URL:
/organization/{orgId}/repository/{repositoryId}/pull-requests
- Method:
GET
- Description: Retrieves a list of pull requests for a specific repository within the organization.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
PullRequest[]
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}/pull-requests
- Method:
POST
- Description: Creates a new pull request for a specific repository within the organization.
- Request Headers:
Authorization
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
PullRequestCreateDto
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}/pull-requests/{pullRequestId}
- Method:
GET
- Description: Retrieves information about a specific pull request within a repository in the organization.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
PullRequest
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}/pull-requests/{pullRequestId}/merge
- Method:
PUT
- Description: Merges a specific pull request within a repository in the organization.
- Request Headers:
Authorization
(string, required)
- URL:
/organization/{orgId}/repository/{repositoryId}/pull-requests/{pullRequestId}/close
- Method:
PUT
- Description: Closes a specific pull request within a repository in the organization.
- Request Headers:
Authorization
(string, required)
- URL:
/organization/{orgId}/repository/{repositoryId}/pull-requests/{pullRequestId}/comments
- Method:
POST
- Description: Adds a comment to a specific pull request within a repository in the organization.
- Request Headers:
Authorization
(string, required)
- Request Body:
- Content-Type:
application/json
- Schema:
CommentCreateDto
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}/pull-requests/{pullRequestId}/comments
- Method:
GET
- Description: Retrieves a list of comments for a specific pull request within a repository in the organization.
- Request Headers:
Authorization
(string, required)
- Response Body:
- Content-Type:
application/json
- Schema:
Comment[]
- Content-Type:
- URL:
/organization/{orgId}/repository/{repositoryId}/pull-requests/{pullRequestId}/comments/{commentId}
- Method:
DELETE
- Description: Deletes a specific comment within a pull request in the organization.
- Request Headers:
Authorization
(string, required)