A robust RESTful API for managing projects and tasks with user authentication, role-based access control, and real-time collaboration features.
- JWT-based Authentication with access and refresh tokens
- Role-based Access Control (Owner, Editor, Viewer)
- Session Management with device tracking
- Password Security with Spring Security
- Token Refresh mechanism for seamless user experience
- Create and manage projects with detailed information
- Team collaboration with member management
- Role-based permissions within projects
- Project ownership and transfer capabilities
- Create, update, and delete tasks within projects
- Task assignment to team members
- Due date management with flexible scheduling
- Task status tracking (Pending, In Progress, Completed, Cancelled)
- Task filtering by project, assignee, and status
- User registration and authentication
- Profile management with user details
- Active session tracking across devices
- Role management with different permission levels
- Backend Framework: Spring Boot 3.5.3
- Language: Java 17
- Database: PostgreSQL
- ORM: Spring Data JPA with Hibernate
- Security: Spring Security with JWT
- Documentation: OpenAPI 3 (Swagger UI)
- Build Tool: Maven
- Containerization: Docker & Docker Compose
- Validation: Bean Validation (Jakarta)
- Utilities: Lombok, ModelMapper
- Java 17 or higher
- Maven 3.6+
- Docker and Docker Compose
- PostgreSQL (if running locally without Docker)
-
Clone the repository
git clone <repository-url> cd task-manager
-
Start the database
docker-compose up -d db
-
Run the application
./mvnw spring-boot:run
-
Access the application
- API Base URL:
http://localhost:3001 - Swagger UI:
http://localhost:3001/swagger-ui.html - Database:
localhost:5335
- API Base URL:
-
Install PostgreSQL and create a database named
task-manager -
Update database configuration in
src/main/resources/application.properties:spring.datasource.url=jdbc:postgresql://localhost:5432/task-manager spring.datasource.username=your_username spring.datasource.password=your_password
-
Run the application
./mvnw spring-boot:run
http://localhost:3001/api/v1
Check the Swagger UI for API documentation
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register |
Register a new user |
| POST | /auth/login |
User login |
| POST | /auth/logout |
User logout |
| POST | /auth/refresh |
Refresh access token |
| GET | /auth/me |
Get current user profile |
| GET | /auth/sessions |
Get user active sessions |
| Method | Endpoint | Description |
|---|---|---|
| POST | /project/create |
Create a new project |
| GET | /project/user |
Get all user's projects |
| POST | /project/{id}/members |
Add member to project |
| DELETE | /project/{id}/members/{memberId} |
Remove member from project |
| PUT | /project/{id}/members/{memberId}/role |
Change member role |
| DELETE | /project/{id} |
Delete project |
| Method | Endpoint | Description |
|---|---|---|
| POST | /task/create |
Create a new task |
| GET | /task/{id} |
Get task by ID |
| GET | /task/project/{projectId} |
Get all tasks in project |
| GET | /task/project/{projectId}/user/{userId} |
Get tasks assigned to user |
| PUT | /task/{id} |
Update task |
| PUT | /task/{id}/assign/{assigneeId} |
Assign task to user |
| PUT | /task/{id}/due-date |
Update task due date |
| DELETE | /task/{id} |
Delete task |
curl -X POST http://localhost:3001/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "password123",
"firstName": "John",
"lastName": "Doe"
}'curl -X POST http://localhost:3001/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "password123"
}'curl -X GET http://localhost:3001/api/v1/project/user \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"id: Unique identifieremail: User email (unique)firstName: First namelastName: Last namepassword: Encrypted passwordroles: User roles (ADMIN, USER)createdAt: Account creation timestamp
id: Unique identifiername: Project namecreatedBy: Project creator (User)members: List of project memberstasks: List of project taskscreatedAt: Project creation timestamp
id: Unique identifiertitle: Task titledescription: Task descriptionstatus: Task status (PENDING, IN_PROGRESS, COMPLETED, CANCELLED)dueDate: Task due dateproject: Associated projectcreatedBy: Task creatorassignee: Task assigneecreatedAt: Task creation timestampupdatedAt: Last update timestamp
id: Unique identifierproject: Associated projectuser: Project memberrole: Member role (OWNER, EDITOR, VIEWER)joinedAt: Member join timestamp
- ADMIN: Full system access
- USER: Standard user access
- OWNER: Full project control, can delete project, manage members
- EDITOR: Can create/edit tasks, manage members, cannot delete project
- VIEWER: Can view tasks and project details, cannot modify
| Action | OWNER | EDITOR | VIEWER |
|---|---|---|---|
| View project | β | β | β |
| Create tasks | β | β | β |
| Edit tasks | β | β | β |
| Delete tasks | β | β | β |
| Add members | β | β | β |
| Remove members | β | β | β |
| Change member roles | β | β | β |
| Delete project | β | β | β |
./mvnw test./mvnw jacoco:report./mvnw clean packagejava -jar target/task-manager-0.0.1-SNAPSHOT.jardocker build -t task-manager .
docker run -p 3001:3001 task-managerSERVER_PORT: Application port (default: 3001)SPRING_DATASOURCE_URL: Database connection URLSPRING_DATASOURCE_USERNAME: Database usernameSPRING_DATASOURCE_PASSWORD: Database passwordAUTH_TOKEN_JWT_SECRET: JWT secret keyAUTH_TOKEN_EXPIRATION_IN_MILS: Access token expiration (default: 30 minutes)AUTH_TOKEN_REFRESH_EXPIRATION_IN_MILS: Refresh token expiration (default: 7 days)
The application uses PostgreSQL with the following default settings:
- Host: localhost
- Port: 5335 (Docker) / 5432 (Local)
- Database: task-manager
- Username: task-manager
- Password: password
All API responses follow a consistent format:
{
"message": "Success message",
"data": {
// Response data
},
"timestamp": "2024-01-01T12:00:00Z"
}{
"message": "Error message",
"data": null,
"timestamp": "2024-01-01T12:00:00Z"
}This is a personal learning project built while studying Spring Boot. It demonstrates:
- Spring Boot fundamentals and best practices
- RESTful API design with proper HTTP methods and status codes
- Spring Security implementation with JWT authentication
- Spring Data JPA for database operations
- Role-based access control and authorization
- Docker containerization
- API documentation with OpenAPI/Swagger
- Clean architecture with proper separation of concerns
Feel free to explore the codebase to learn from the implementation!