A comprehensive productivity application built with React TypeScript frontend, Spring Boot backend, and MongoDB Atlas database. Features JWT authentication and real-time synchronization capabilities.
ProductiveFlow/
βββ frontend/ # React TypeScript application
β βββ public/ # Public assets
β βββ src/ # Source code
β β βββ components/ # Reusable React components
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ hooks/ # Custom React hooks
β β βββ context/ # React context providers
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Utility functions
β βββ package.json # Frontend dependencies
β βββ .env.example # Environment variables template
βββ backend/ # Spring Boot application
β βββ src/main/java/com/productiveflow/
β β βββ config/ # Configuration classes
β β βββ controller/ # REST controllers
β β βββ model/ # Data models
β β βββ repository/ # Data repositories
β β βββ service/ # Business logic services
β β βββ security/ # Security configurations
β βββ src/main/resources/ # Configuration files
β βββ pom.xml # Backend dependencies
βββ docs/ # Project documentation
βββ .gitignore # Git ignore rules
βββ README.md # This file
- Node.js (v16 or higher)
- Java (v17 or higher)
- Maven (v3.6 or higher)
- MongoDB Atlas account
- Git
git clone <repository-url>
cd ProductiveFlow- Create a MongoDB Atlas account at https://www.mongodb.com/atlas
- Create a new cluster
- Create a database user with read/write permissions
- Get your connection string
- Whitelist your IP address
cd backend
mvn clean install- Copy the MongoDB Atlas connection string
- Update
src/main/resources/application.properties:
# Replace with your actual MongoDB Atlas connection string
spring.data.mongodb.uri=mongodb+srv://<username>:<password>@<cluster-name>.mongodb.net/productiveflow?retryWrites=true&w=majorityFor production, generate a secure JWT secret:
# Generate a secure random string for JWT secret
openssl rand -hex 32Update application.properties:
jwt.secret=your-generated-secure-secret-keymvn spring-boot:runThe backend will start on http://localhost:8080
cd frontend
npm install- Copy the environment template:
cp .env.example .env- Update
.envif needed (default values should work for local development)
npm startThe frontend will start on http://localhost:3000
# Server Configuration
server.port=8080
server.servlet.context-path=/api
# MongoDB Configuration
spring.data.mongodb.uri=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/productiveflow
spring.data.mongodb.database=productiveflow
# JWT Configuration
jwt.secret=your-secret-key
jwt.expiration=86400000
# CORS Configuration
cors.allowed-origins=http://localhost:3000
cors.allowed-methods=GET,POST,PUT,DELETE,OPTIONS
cors.allowed-headers=*
# Logging
logging.level.com.productiveflow=DEBUG# API Configuration
REACT_APP_API_URL=http://localhost:8080/api
# App Configuration
REACT_APP_NAME=ProductiveFlow
REACT_APP_VERSION=1.0.0
# WebSocket Configuration
REACT_APP_WS_URL=ws://localhost:8080/ws- Spring Boot Web - REST API framework
- Spring Boot Security - Authentication and authorization
- Spring Data MongoDB - MongoDB integration
- JWT (jjwt) - JSON Web Token implementation
- Spring Boot WebSocket - Real-time communication
- Spring Boot DevTools - Development utilities
- React 19 - UI library
- TypeScript - Type safety
- React Router DOM - Client-side routing
- Axios - HTTP client
- Material-UI or Tailwind CSS (to be added)
- User Registration/Login β Backend validates credentials
- JWT Token Generation β Backend creates signed JWT token
- Token Storage β Frontend stores token in localStorage
- API Requests β Frontend includes token in Authorization header
- Token Validation β Backend validates token on protected routes
- Password hashing with BCrypt
- JWT token-based authentication
- CORS configuration for cross-origin requests
- Input validation and sanitization
- Role-based access control ready
POST /api/auth/register - User registration
POST /api/auth/login - User login
POST /api/auth/logout - User logout
GET /api/auth/me - Get current user
POST /api/auth/refresh - Refresh JWT token
GET /api/tasks - Get user tasks
POST /api/tasks - Create new task
PUT /api/tasks/:id - Update task
DELETE /api/tasks/:id - Delete task
The application is prepared for real-time features using:
- WebSocket support in Spring Boot
- Socket.IO or native WebSocket in React
- Real-time task updates
- Live collaboration features
- Instant notifications
# Compile the project
mvn compile
# Run tests
mvn test
# Package the application
mvn package
# Run with specific profile
mvn spring-boot:run -Dspring-boot.run.profiles=dev# Start development server
npm start
# Run tests
npm test
# Build for production
npm run build
# Type check
npx tsc --noEmit- Database: MongoDB Atlas development cluster
- CORS: Permissive (localhost only)
- Logging: Debug level
- JWT: Development secret (change in production)
- Database: MongoDB Atlas production cluster
- CORS: Restricted to production domain
- Logging: Info/Error level
- JWT: Secure secret key
- HTTPS: Required
-
Build the application:
mvn clean package
-
Deploy JAR file to your hosting service
-
Set production environment variables
-
Configure MongoDB Atlas for production
-
Build the application:
npm run build
-
Deploy build folder to static hosting (Netlify, Vercel, etc.)
-
Configure production API URL
# Run all tests
mvn test
# Run specific test class
mvn test -Dtest=UserServiceTest
# Run with coverage
mvn test jacoco:report# Run all tests
npm test
# Run tests with coverage
npm test -- --coverage
# Run specific test file
npm test -- UserService.test.ts- Spring Boot Documentation
- React Documentation
- MongoDB Atlas Documentation
- JWT.io - JWT token debugging
- TypeScript Documentation
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Check the documentation in the
docs/folder - Review the API documentation (generated with Swagger - coming soon)
Happy coding! π