A full-stack task management application built with Spring Boot (Backend) and React (Frontend). This application provides a complete solution for managing tasks with user authentication, comprehensive CRUD operations, and a modern, responsive user interface.
- Features
- Technology Stack
- Project Structure
- Prerequisites
- Installation & Setup
- API Documentation
- Usage
- Development
- Testing
- Deployment
- JWT-based authentication with secure token generation
- User registration and login with email/username
- Password encryption using BCrypt
- Protected routes with automatic redirection
- Stateless authentication for scalability
- CORS configuration for secure cross-origin requests
- Complete CRUD operations for tasks
- Task status management (TODO, IN_PROGRESS, REVIEW, COMPLETED, CANCELLED)
- Priority levels (LOW, MEDIUM, HIGH, URGENT)
- Due date tracking with automatic timestamps
- Task filtering by status and priority
- Real-time task updates with immediate UI feedback
- Responsive design that works on desktop, tablet, and mobile
- Modern UI built with Tailwind CSS
- Toast notifications for real-time feedback
- Form validation using Yup and Formik
- Loading states for smooth user experience
- Intuitive navigation with React Router
- RESTful API design with proper HTTP status codes
- Database persistence with PostgreSQL and JPA/Hibernate
- ModelMapper for efficient entity-DTO conversion
- Comprehensive validation with Bean Validation
- Automatic data initialization with sample tasks
- TypeScript for type-safe development
- Spring Boot 3.5.0 - Modern Java framework
- Java 17 - Latest LTS version
- Spring Security - Authentication and authorization
- Spring Data JPA - Database access layer
- PostgreSQL - Primary database
- JWT - JSON Web Tokens for authentication
- Maven - Dependency management and build tool
- ModelMapper - Object mapping utility
- SpringDoc OpenAPI - API documentation
- React 19.1.0 - Modern React with latest features
- TypeScript 5.8.3 - Type-safe development
- Vite 6.3.5 - Fast build tool and development server
- React Router DOM 7.6.2 - Client-side routing
- Tailwind CSS 3.4.3 - Utility-first CSS framework
- Formik 2.4.6 - Form state management
- Yup 1.6.1 - Schema validation
- Axios 1.10.0 - HTTP client for API requests
- React Toastify 11.0.5 - Toast notifications
- ESLint - Code linting and formatting
- PostCSS - CSS processing
- Autoprefixer - CSS vendor prefixing
- Git - Version control
taskmanagement-app/
βββ backend/ # Spring Boot Backend
β βββ src/
β β βββ main/
β β β βββ java/io/hahnsoftware/backend/
β β β β βββ BackendApplication.java
β β β β βββ config/ # Configuration classes
β β β β βββ controller/ # REST controllers
β β β β βββ dto/ # Data Transfer Objects
β β β β βββ entity/ # JPA entities
β β β β βββ filter/ # JWT filter
β β β β βββ repository/ # Data access layer
β β β β βββ service/ # Business logic
β β β β βββ exception/ # Custom exceptions
β β β βββ resources/
β β β βββ application.properties
β β βββ test/ # Unit tests
β βββ pom.xml # Maven configuration
β βββ README.md # Backend documentation
βββ frontend/ # React Frontend
β βββ src/
β β βββ components/
β β β βββ auth/ # Authentication components
β β β βββ common/ # Shared components
β β β βββ tasks/ # Task-related components
β β β βββ ProtectedRoute.tsx
β β βββ context/
β β β βββ AuthContext.tsx # Authentication context
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ utils/ # Utility functions
β βββ package.json # Node.js dependencies
β βββ tailwind.config.js # Tailwind configuration
β βββ vite.config.ts # Vite configuration
β βββ README.md # Frontend documentation
βββ README.md # This file
Before running this project, ensure you have the following installed:
- Java 17 or higher
- Maven 3.6 or higher
- PostgreSQL 12 or higher
- IDE (IntelliJ IDEA, Eclipse, or VS Code)
- Node.js (version 18 or higher)
- npm or yarn package manager
- Modern web browser
git clone https://github.com/allahatim/task-management-app-java-react.git
cd task-management-app
- Create PostgreSQL database:
CREATE DATABASE taskmanagement;
CREATE USER hahn WITH PASSWORD 'hahn2025';
GRANT ALL PRIVILEGES ON DATABASE taskmanagement TO hahn;
- Update database configuration in
backend/src/main/resources/application.properties
:
spring.datasource.url=jdbc:postgresql://localhost:5432/taskmanagement
spring.datasource.username=your_username
spring.datasource.password=your_password
cd backend
mvn clean compile
mvn spring-boot:run
The backend API will be available at http://localhost:8080
cd frontend
npm install
Update the API base URL in src/utils/constants.ts
if needed:
export const API_BASE_URL = 'http://localhost:8080/api';
npm run dev
The frontend application will be available at http://localhost:5173
POST /api/auth/register
Content-Type: application/json
{
"firstName": "John",
"lastName": "Doe",
"username": "johndoe",
"email": "john@example.com",
"password": "password123"
}
POST /api/auth/login
Content-Type: application/json
{
"username": "johndoe",
"password": "password123"
}
Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
POST /api/tasks
Authorization: Bearer <jwt-token>
Content-Type: application/json
{
"title": "Complete Project Documentation",
"description": "Write comprehensive documentation for the backend API",
"status": "TODO",
"priority": "HIGH",
"dueDate": "2024-12-31"
}
GET /api/tasks
Authorization: Bearer <jwt-token>
GET /api/tasks/{id}
Authorization: Bearer <jwt-token>
PUT /api/tasks/{id}
Authorization: Bearer <jwt-token>
Content-Type: application/json
{
"title": "Updated Task Title",
"description": "Updated description",
"status": "IN_PROGRESS",
"priority": "MEDIUM",
"dueDate": "2024-12-31"
}
DELETE /api/tasks/{id}
Authorization: Bearer <jwt-token>
Access the interactive API documentation at: http://localhost:8080/swagger-ui.html
- Register a new account or login with existing credentials
- Create your first task using the "Add Task" button
- Manage your tasks by editing, updating status, or deleting them
- Track progress with the visual status indicators
- Create Tasks: Add new tasks with title, description, priority, and due date
- View Tasks: See all your tasks in an organized list
- Edit Tasks: Modify task details at any time
- Update Status: Change task status as work progresses
- Delete Tasks: Remove completed or unnecessary tasks
- Filter Tasks: View tasks by status or priority
- Responsive Design: Works on all device sizes
- Real-time Feedback: Toast notifications for all actions
- Form Validation: Prevents invalid data submission
- Loading States: Smooth user experience during API calls
cd backend
mvn test
The backend includes:
- Unit tests for entities and services
- Integration tests for controllers
- Test containers for database testing
cd frontend
npm run test
cd backend
mvn spring-boot:run
cd frontend
npm run dev
mvn clean compile
- Clean and compile the projectmvn spring-boot:run
- Run the Spring Boot applicationmvn test
- Run all testsmvn package
- Create executable JAR file
npm run dev
- Start development servernpm run build
- Build for productionnpm run lint
- Run ESLintnpm run preview
- Preview production build
- Build the JAR file:
cd backend
mvn clean package
- Run the application:
java -jar target/backend-0.0.1-SNAPSHOT.jar
- Build for production:
cd frontend
npm run build
- Deploy the
dist
folder to your web server
Set the following environment variables for production:
SPRING_DATASOURCE_URL
- Database connection URLSPRING_DATASOURCE_USERNAME
- Database usernameSPRING_DATASOURCE_PASSWORD
- Database passwordJWT_SECRET
- JWT signing secret
VITE_API_BASE_URL
- Backend API URL
Built with β€οΈ using Spring Boot and React
For more information, visit the individual README files: