ProTask API is a comprehensive project management API built with Node.js, Express, Sequelize ORM, and PostgreSQL. It provides robust endpoints for various project management operations including user authentication, workspace management, task and subtask management, and more.
- Features
- Technology Stack
- Installation
- Configuration
- Usage
- API Endpoints
- Error Handling
- Security
- Contributing
- License
- User Authentication (Sign-up, Login, Password Management)
- Workspace Management
- Space Management within Workspaces
- Task and Subtask Management
- Tag and Status Management for Tasks
- Attachment and Dependency Management for Tasks
- Invitation and User Role Management
- Comprehensive Validation and Error Handling
- Node.js: JavaScript runtime built on Chrome's V8 JavaScript engine.
- Express: Fast, unopinionated, minimalist web framework for Node.js.
- Sequelize ORM: Promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server.
- PostgreSQL: Powerful, open source object-relational database system.
- Socket.IO: Enables real-time, bidirectional and event-based communication.
-
Clone the repository:
git clone https://github.com/MahmoudAbdelsamie/protask-api.git cd protask-api
-
Install dependencies:
npm install
-
Set up your environment variables. Create a
.env
file in the root directory and add your configuration:PORT=5000 JWT_SECRET= DB_CONNECTION= DB_HOST= DB_DIALECT= DB_USERNAME= DB_PASSWORD= DB_PORT=
-
Run the application:
npm start
To start the server, run:
npm start
The server will start on the port specified in the .env
file. By default, this is 3000
.
-
POST
/login
- Login a user.
- Body:
{ "email": "[email protected]", "password": "password" }
-
POST
/sign-up
- Register a new user.
- Body:
{ "name": "User", "email": "[email protected]", "password": "password" }
-
POST
/add-new-workspace
- Create a new workspace.
- Body:
{ "name": "Workspace Name", "description": "Workspace Description" }
- Headers:
{ "Authorization": "Bearer <token>" }
-
GET
/my-workspaces
- Get all workspaces of the authenticated user.
- Headers:
{ "Authorization": "Bearer <token>" }
-
GET
/spaces
- Get all spaces.
- Headers:
{ "Authorization": "Bearer <token>" }
-
POST
/new-space
- Create a new space.
- Body:
{ "name": "Space Name", "workspaceId": "workspace_id" }
- Headers:
{ "Authorization": "Bearer <token>" }
-
POST
/add-task
- Create a new task.
- Body:
{ "name": "Task Name", "spaceId": "space_id" }
- Headers:
{ "Authorization": "Bearer <token>" }
-
GET
/task/:id
- Get a task by ID.
- Headers:
{ "Authorization": "Bearer <token>" }
-
PUT
/task/:id
- Update a task by ID.
- Body:
{ "name": "Updated Task Name" }
- Headers:
{ "Authorization": "Bearer <token>" }
-
POST
/subtask
- Create a new subtask.
- Body:
{ "name": "Subtask Name", "taskId": "task_id" }
- Headers:
{ "Authorization": "Bearer <token>" }
-
GET
/subtask/:id
- Get a subtask by ID.
- Headers:
{ "Authorization": "Bearer <token>" }
-
POST
/tags
- Create a new tag.
- Body:
{ "name": "Tag Name" }
- Headers:
{ "Authorization": "Bearer <token>" }
-
GET
/tags/:id
- Get tags by space ID.
- Headers:
{ "Authorization": "Bearer <token>" }
-
POST
/status
- Create a new status.
- Body:
{ "name": "Status Name", "listId": "list_id" }
- Headers:
{ "Authorization": "Bearer <token>" }
-
GET
/status/:id
- Get statuses by list ID.
- Headers:
{ "Authorization": "Bearer <token>" }
- POST
/new-task-attachment
- Add a new attachment to a task.
- Body:
{ "taskId": "task_id", "attachment": "file_data" }
- Headers:
{ "Authorization": "Bearer <token>" }
- POST
/new-task-dependency
- Add a new dependency to a task.
- Body:
{ "taskId": "task_id", "dependsOn": "another_task_id" }
- Headers:
{ "Authorization": "Bearer <token>" }
-
GET
/get-user-settings
- Get user settings.
- Headers:
{ "Authorization": "Bearer <token>" }
-
PUT
/update-user-profile
- Update user profile.
- Body:
{ "name": "Updated Name", "email": "[email protected]" }
- Headers:
{ "Authorization": "Bearer <token>" }
- Authentication: All routes (except for authentication routes) are protected using JWT authentication.
- Input Validation: All inputs are validated to prevent SQL injection, XSS, and other attacks.
- HTTPS: Ensure your server is configured to use HTTPS in production to encrypt data in transit.