A scalable, enterprise-grade platform for booking local services with real-time availability and secure payment processing. Built with Java, Spring Boot, MongoDB, and modern cloud-native architecture.
LocalConnect is a full-featured service booking platform that connects service providers with customers. It provides a robust backend API for managing bookings, user authentication, service listings, real-time availability tracking, and payment processing with role-based access control.
Key Highlights:
- Secure JWT-based authentication and authorization
- Real-time booking confirmation and status updates
- Role-based access control (RBAC) for different user types
- MongoDB Atlas integration for scalable data storage
- REST API with comprehensive endpoint documentation
- Cloud-ready deployment with Docker support
- Code quality monitoring with SonarQube/SonarCloud
User Management
- Secure user registration and login
- JWT token-based authentication
- Role-based access control (Customer, Service Provider, Admin)
- User profile management and preferences
Service Management
- Service provider onboarding and verification
- Service listing and categorization
- Service description, pricing, and availability management
- Service ratings and reviews
Booking System
- Real-time availability checking
- Instant booking confirmation
- Booking history and management
- Cancellation and rescheduling support
- Status tracking (Pending, Confirmed, In-Progress, Completed, Cancelled)
Payment Integration
- Secure payment processing
- Multiple payment method support
- Payment status tracking
- Invoice generation
Additional Features
- Advanced search and filtering
- Notification system
- Analytics and reporting
- API documentation with Postman collection
- Docker containerization for easy deployment
Backend
- Java 17+
- Spring Boot 3.x
- Spring Security with JWT
- Spring Data MongoDB
- Spring Cloud for microservices readiness
Database
- MongoDB Atlas (NoSQL document database)
- Mongoose-style data modeling
API & Documentation
- RESTful API
- OpenAPI/Swagger documentation
- Postman collection for testing
Cloud & DevOps
- Docker containerization
- Maven build management
- SonarQube/SonarCloud for code quality
- Git version control
Security
- JWT token authentication
- Spring Security
- OAuth2 support
- Encrypted password storage
- CORS configuration
Local-Connect/
βββ src/
β βββ main/
β β βββ java/
β β β βββ controller/ # REST endpoints
β β β βββ service/ # Business logic layer
β β β βββ repository/ # Data access layer (MongoDB)
β β β βββ model/ # Entity and DTO classes
β β β βββ security/ # JWT and authentication
β β β βββ config/ # Application configuration
β β β βββ exception/ # Custom exceptions
β β βββ resources/
β β βββ application.yaml # Application properties
β βββ test/
β βββ java/ # Unit and integration tests
βββ postman-collection/ # API testing collection
βββ .mvn/wrapper/ # Maven wrapper for build
βββ pom.xml # Maven project configuration
βββ Dockerfile # Docker image definition
βββ mvnw # Maven wrapper script (Linux/Mac)
βββ mvnw.cmd # Maven wrapper script (Windows)
βββ .gitignore # Git ignore rules
βββ README.md # Project documentation
- Java 17 or higher
- Maven 3.6+ or use Maven wrapper
- MongoDB Atlas account (or local MongoDB instance)
- Git
- Docker (optional, for containerization)
-
Clone the repository:
git clone https://github.com/aryan735/Local-Connect.git cd Local-Connect -
Configure environment variables:
Create
src/main/resources/application.yaml:spring: data: mongodb: uri: mongodb+srv://username:password@cluster.mongodb.net/localconnect?retryWrites=true&w=majority jwt: secret: your-secret-key-here expiration: 86400000 # 24 hours in milliseconds
-
Build the project:
Using Maven wrapper (no installation required):
./mvnw clean install
Or with installed Maven:
mvn clean install
-
Run the application:
./mvnw spring-boot:run
The application will start on
http://localhost:8080
docker build -t localconnect:latest .docker run -e MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/localconnect \
-e JWT_SECRET=your-secret-key \
-p 8080:8080 \
localconnect:latestCreate a docker-compose.yml:
version: '3.8'
services:
localconnect:
build: .
ports:
- "8080:8080"
environment:
MONGODB_URI: mongodb://mongodb:27017/localconnect
JWT_SECRET: your-secret-key
depends_on:
- mongodb
mongodb:
image: mongo:5.0
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
volumes:
mongodb_data:Run with: docker-compose up
All protected endpoints require a JWT token in the Authorization header:
Authorization: Bearer <your_jwt_token>
User Management
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/users/{id}- Get user profilePUT /api/users/{id}- Update user profile
Services
GET /api/services- List all servicesPOST /api/services- Create new service (Provider only)GET /api/services/{id}- Get service detailsPUT /api/services/{id}- Update serviceDELETE /api/services/{id}- Delete service
Bookings
POST /api/bookings- Create new bookingGET /api/bookings- List user bookingsGET /api/bookings/{id}- Get booking detailsPUT /api/bookings/{id}- Update booking statusDELETE /api/bookings/{id}- Cancel booking
Payments
POST /api/payments- Process paymentGET /api/payments/{id}- Get payment details
Search & Filter
GET /api/services/search?category=&location=- Search services
Import the Postman collection from postman-collection/ folder to test all API endpoints with pre-configured requests and environment variables.
./mvnw test./mvnw test -Dtest=UserServiceTest./mvnw jacoco:report- JWT Authentication: Stateless token-based authentication
- Password Encryption: Spring Security's BCrypt password encoding
- CORS Protection: Configurable cross-origin resource sharing
- SQL Injection Prevention: Spring Data prevents injection attacks
- Rate Limiting: Request throttling for API endpoints
- HTTPS Support: Production deployment should use HTTPS
The project integrates with SonarQube/SonarCloud for continuous code quality monitoring:
# Run SonarQube analysis (requires SonarQube server)
./mvnw sonar:sonar -Dsonar.projectKey=local-connect -Dsonar.host.url=http://localhost:9000Quality Gates:
- Code coverage > 80%
- Maximum code duplication: 3%
- Security vulnerabilities: 0
- Technical debt: < 5%
Key configurations in application.yaml:
spring:
application:
name: localconnect
data:
mongodb:
uri: ${MONGODB_URI}
auto-index-creation: true
jwt:
secret: ${JWT_SECRET}
expiration: ${JWT_EXPIRATION:86400000}
server:
servlet:
context-path: /api
port: ${SERVER_PORT:8080}| Variable | Description | Default |
|---|---|---|
MONGODB_URI |
MongoDB connection string | - |
JWT_SECRET |
JWT signing secret | - |
JWT_EXPIRATION |
Token expiration time (ms) | 86400000 |
SERVER_PORT |
Application port | 8080 |
SPRING_PROFILES_ACTIVE |
Active profile (dev/prod) | dev |
-
Create feature branch:
git checkout -b feature/feature-name
-
Make changes and commit:
git add . git commit -m "feat: add new feature"
-
Run tests before pushing:
./mvnw clean test -
Push and create pull request:
git push origin feature/feature-name
- Connection pooling for MongoDB
- Caching strategies with Spring Cache
- Async processing for non-blocking operations
- Database indexing on frequently queried fields
- Load balancing ready architecture
Error: MongoTimeoutException
- Verify MongoDB URI is correct
- Check network connectivity to MongoDB Atlas
- Ensure IP whitelist includes your IP address
Error: JWT expired
- Request a new token using login endpoint
- Refresh token endpoint (if implemented)
# Clean Maven cache
./mvnw clean
# Update dependencies
./mvnw dependency:resolve
# Rebuild
./mvnw install- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a pull request
This project is provided for educational and assessment purposes.
For issues, feature requests, or questions:
- Open an issue on GitHub
- Check existing documentation
- Review Postman collection for API examples
- Spring Boot Official Documentation
- MongoDB University
- JWT Best Practices
- RESTful API Design
- Docker Documentation
- Last Updated: February 2026
- Latest Release: v1.0.0
- Commits: 15+
Built with β€οΈ for scalable service booking