A modern, scalable backend service for a collaborative kanban-style project management system built with Spring Boot and GraphQL.
- Create, update, and delete kanban boards
- Customizable board columns with drag-and-drop positioning
- Board color themes and descriptions
- Multi-user collaboration with role-based access control
- Complete CRUD operations for tasks
- Task priorities (High/Medium/Low) and statuses (TODO/DOING/DONE)
- Drag-and-drop task positioning between columns
- Due dates and time estimation tracking
- Task assignments to team members
- Flexible tagging system
- File attachments support
- Subtasks: Break down complex tasks into manageable components
- Comments: Task-level discussions and collaboration
- Real-time Updates: Event-driven architecture with Kafka
- GraphQL Federation: Microservice-ready architecture
- Language: Java 21
- Framework: Spring Boot 3.5.4
- API: GraphQL with Netflix DGS Framework
- Database: PostgreSQL with Flyway migrations
- Messaging: Apache Kafka
- Build Tool: Maven
- Containerization: Docker & Docker Compose
- Additional Libraries:
- MapStruct for object mapping
- Lombok for boilerplate reduction
- SpringDoc OpenAPI for documentation
- Spring Data JPA for data access
- Java 21 or higher
- Maven 3.6+ (or use included Maven wrapper)
- Docker and Docker Compose
- PostgreSQL (if running without Docker)
git clone <repository-url>
cd backend
# Start PostgreSQL and other services
docker-compose up -d
./mvnw flyway:migrate
./mvnw spring-boot:run
The application will be available at:
- API Endpoint: http://localhost:8085/graphql
- GraphiQL Interface: http://localhost:8085/graphiql
# Build and start all services
docker-compose up --build
# Start in detached mode
docker-compose up -d --build
# Build the image
docker build -t kanban-backend .
# Run the container
docker run -p 8085:8080 kanban-backend
- Host: localhost
- Port: 5434
- Database: kanban_db
- Username: postgres
- Password: secret123
You can override database settings using environment variables:
export SPRING_POSTGRES_URL=jdbc:postgresql://localhost:5434/kanban_db
export SPRING_POSTGRES_USER=postgres
export SPRING_POSTGRES_PASSWORD=secret123
./mvnw clean compile
./mvnw test
GraphQL types are automatically generated from the schema during build:
./mvnw generate-sources
# Run migrations
./mvnw flyway:migrate
# Clean database (dev only)
./mvnw flyway:clean
The GraphQL schema is located at src/main/resources/schema/schema.graphqls
.
getBoards
: Retrieve all boardsgetBoardById(id)
: Get specific boardgetTasks
: Retrieve all tasksgetTaskById(id)
: Get specific taskgetTasksByColumnIdAndBoardId(columnId, boardId)
: Get tasks by column
- Boards:
createBoard
,updateBoard
,deleteBoardById
- Tasks:
createTask
,updateTask
,deleteTaskById
- Positioning:
updateBoardColumnPosition
,updateTaskPosition
query GetBoardWithTasks {
getBoardById(id: "1") {
id
name
description
columns {
id
name
position
taskCount
}
}
}
mutation CreateTask {
createTask(task: {
boardId: "1"
createdBy: 1
title: "New Task"
description: "Task description"
status: TODO
priority: HIGH
assignedTo: 1
tags: ["feature", "urgent"]
subtasks: []
}) {
success
message
task {
id
title
status
}
}
}
Key configuration options in application.yml
:
server:
port: 8085
spring:
datasource:
url: jdbc:postgresql://localhost:5434/kanban_db
username: postgres
password: secret123
kafka:
bootstrap-servers: localhost:8081
consumer:
group-id: user_event_group_1
graphql:
graphiql:
enabled: true
The application uses Apache Kafka for real-time event processing:
- Bootstrap Servers: localhost:8081
- Consumer Group: user_event_group_1
- Auto Offset Reset: earliest
src/
βββ main/
β βββ java/org/abraham/kanbantaskmanager/
β β βββ generated/ # Auto-generated GraphQL types
β β βββ controllers/ # GraphQL resolvers
β β βββ services/ # Business logic
β β βββ repositories/ # Data access layer
β β βββ entities/ # JPA entities
β β βββ dtos/ # Data transfer objects
β βββ resources/
β βββ schema/
β β βββ schema.graphqls # GraphQL schema definition
β βββ db/migration/ # Flyway migration scripts
β βββ application.yml # Application configuration
βββ test/ # Test files
# Run all tests
./mvnw test
# Run specific test class
./mvnw test -Dtest=BoardServiceTest
# Run with coverage
./mvnw test jacoco:report
./mvnw clean package -DskipTests
SPRING_POSTGRES_URL=jdbc:postgresql://prod-db:5432/kanban_prod
SPRING_POSTGRES_USER=prod_user
SPRING_POSTGRES_PASSWORD=secure_password
KAFKA_BOOTSTRAP_SERVERS=kafka-cluster:9092
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow Java naming conventions
- Use Lombok annotations to reduce boilerplate
- Write meaningful commit messages
- Add tests for new features
# Clean and rebuild
./mvnw clean install
# Run in debug mode
./mvnw spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
# Check dependencies
./mvnw dependency:tree
# Reset database
./mvnw flyway:clean flyway:migrate
# Check migration status
./mvnw flyway:info
- Port already in use: Change the port in
application.yml
or stop the conflicting service - Database connection failed: Ensure PostgreSQL is running and credentials are correct
- GraphQL schema errors: Check schema syntax in
schema.graphqls
Application logs are available in the console or can be configured to write to files.
This project is licensed under the MIT License - see the LICENSE file for details.
- Abraham Nyagar - Initial work
- Netflix DGS Framework for GraphQL implementation
- Spring Boot team for the excellent framework
- Apollo Federation for microservice capabilities