A scalable, event-driven backend for WorkSync — a collaborative platform that brings together project management, real-time chat, notifications, and analytics.
The backend focuses on reliability, modularity, and real-time responsiveness, using distributed systems patterns typically seen in production-scale systems.
Frontend repo -> workSync Frontend
WorkSync follows a Kafka-based event-driven design where different parts of the system (like persistence, notifications, etc) run as independent consumer groups.
This makes each component scalable and fault-tolerant on its own.
This setup keeps the system responsive under load and makes it easy to extend — for example, by adding new consumers for analytics or alerting without touching the core logic.
For deep-dive diagrams and sequence flows, see ARCHITECTURE.md.
Core: Java 17, Spring Boot 3.3, PostgreSQL, Apache Kafka
Infrastructure: Docker, Docker Compose, Flyway
Security: JWT (jjwt), BCrypt, Spring Security
Real-Time: Spring WebSocket (STOMP over SockJS)
- Java 17 or higher
- Docker and Docker Compose
- Maven (or use included
mvnw)
-
Clone the repository:
git clone https://github.com/sk-pathak/workSync-backend.git cd workSync-backend -
Configure environment variables (optional):
cp .env.example .env # Edit .env with your settings (DB credentials, JWT secret, etc.) -
Build the application:
chmod +x mvnw ./mvnw clean package -DskipTests
-
Start all services:
docker-compose up --build
This will start:
- PostgreSQL (port 5432)
- Kafka + ZooKeeper (port 9092)
- Spring Boot app (port 8080)
-
Verify the application:
curl http://localhost:8080/api/auth/register -X POST \ -H "Content-Type: application/json" \ -d '{"username":"testuser","email":"test@example.com","password":"Test123!","name":"Test User"}'
Run without Docker (requires local PostgreSQL + Kafka):
./mvnw spring-boot:runRun tests:
./mvnw testRun with specific profile:
./mvnw spring-boot:run -Dspring-boot.run.profiles=devFlyway automatically runs migrations on startup. To add a new migration:
- Create SQL file:
src/main/resources/db/migration/V{number}__{description}.sql- Example:
V11__add_user_preferences.sql
- Example:
- Restart the application or run:
./mvnw flyway:migrate
Migration naming convention:
Vprefix (version)- Sequential number (e.g.,
11,12) - Double underscore separator
__ - Descriptive name (snake_case)
- All endpoints (except
/api/auth/*and public project listing) require JWT authentication. - Role-based access enforced via
@PreAuthorizeand service checks. - WebSocket connections require JWT in the handshake.
