A full-stack application for managing personal tasks, built with a focus on security, performance, and scalability. The system implements a robust backend API using Spring Boot and a responsive frontend using React.
The following diagram illustrates the production-ready infrastructure, featuring a load balancer, multiple application instances, and a caching layer.
graph TB
subgraph Client
Browser[React App]
end
subgraph "Load Balancer"
Nginx[Nginx :80]
end
subgraph "Application Cluster"
BE1[Backend Instance 1]
BE2[Backend Instance 2]
end
subgraph "Data Layer"
Redis[(Redis Cache)]
PG[(PostgreSQL)]
end
Browser --> Nginx
Nginx --> BE1 & BE2
BE1 & BE2 --> Redis
BE1 & BE2 --> PG
- Security: Stateless authentication using JSON Web Tokens (JWT). Password storage is secured using BCrypt hashing.
- Authorization: Role-Based Access Control (RBAC) allows for granular permission management.
- Concurrency: Asynchronous processing enabled for non-blocking execution of background tasks.
- Reliability: Implementation of global exception handling and standardized API responses.
- Validation: Strict input validation using Jakarta Bean Validation constraints.
- Documentation: Automatic API documentation generated via Swagger and OpenAPI 3.
- Data Persistence: Support for both H2 (development) and PostgreSQL (production).
- Schema Management: Database migrations managed through Flyway.
- Connection Pooling: Optimized database connection management using HikariCP.
- Caching: Distributed caching using Redis to reduce database latency and improve throughput.
- Rate Limiting: Protection against API abuse implemented via IP-based rate limiting.
- Framework: Developed using React with Vite for a fast and optimized build environment.
- State Management: Authentication state and user sessions managed through React Context API.
- Responsiveness: A clean, modular interface designed for across different screen sizes.
- backend/demo: Contains the Spring Boot 3.2 source code, including controllers, services, repositories, and configurations.
- frontend: Contains the React 18 source code, services for API interaction, and UI components.
- docker-compose.yml: Configuration for orchestrating the multi-container production environment.
- Java Development Kit (JDK) 17 or higher
- Node.js 16 or higher
- Maven 3.6 or higher
- Docker and Docker Compose (required for production profile)
-
Start the Backend:
cd backend/demo mvn spring-boot:runThe backend will start on port 9090 by default.
-
Start the Frontend:
cd frontend npm install npm run devThe frontend will be accessible at http://localhost:3000.
To deploy the full-stack infrastructure including PostgreSQL and Redis:
- Launch Infrastructure:
cd backend/demo docker-compose up -d - Run Application:
mvn spring-boot:run -Dspring-boot.run.profiles=prod
When the application is running, you can explore the REST API endpoints and schemas via the Swagger UI at: http://localhost:9090/swagger-ui.html
For a detailed analysis of the scalability strategies and architectural decisions, please see the SCALABILITY.md file.