A secure, scalable Spring Boot backend for a modern messaging platform with subscription-based channels. Built for high-performance real-time communication with integrated payment processing.
- Java 21+
- Docker & Docker Compose
- PostgreSQL 15+
- Redis 7+
# Clone the repository
git clone https://github.com/your-org/loopin-backend.git
cd loopin-backend
# Start dependencies with Docker Compose
docker-compose up -d postgres redis
# Configure environment variables
cp .env.example .env
# Edit .env with your configuration
# Run the application
./gradlew bootRun# Database Configuration
DATABASE_URL=jdbc:postgresql://localhost:5432/loopchat
DATABASE_USERNAME=loopchat
DATABASE_PASSWORD=your_password
# Redis Configuration
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
# JWT Configuration
JWT_SECRET=your_jwt_secret_key
JWT_EXPIRATION=86400000
# Razorpay Configuration
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
RAZORPAY_WEBHOOK_SECRET=your_webhook_secret
# AWS S3 Configuration (Optional)
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_S3_BUCKET=your_bucket_name
AWS_REGION=us-east-1- JWT-based authentication with automatic refresh
- Single-device login enforcement
- Device fingerprinting for enhanced security
- Secure password reset flow
- WebSocket-based instant messaging
- Message delivery confirmations
- Typing indicators and read receipts
- Offline message queuing
- Create paid and free channels
- Razorpay integration for payments
- Creator payout system
- Subscriber management
- Secure file uploads to S3/MinIO
- Image compression and optimization
- CDN integration for fast delivery
- Multiple file format support
- Real-time system metrics
- Business analytics dashboard
- Payment transaction tracking
- User engagement insights
- Backend: Spring Boot 3.x with WebFlux (Reactive)
- Database: PostgreSQL with Redis caching
- Authentication: JWT with RS256 signing
- Payments: Razorpay integration
- Storage: AWS S3 or MinIO
- Real-time: WebSocket/STOMP protocol
src/main/java/com/loopchat/
βββ auth/ # Authentication & user management
βββ messaging/ # Real-time messaging system
βββ channels/ # Channel management & subscriptions
βββ payments/ # Razorpay payment processing
βββ media/ # File upload & storage
βββ config/ # Spring configurations
βββ security/ # Security configurations
βββ common/ # Shared utilities & DTOs
| Document | Description |
|---|---|
| π§ GitHub Copilot Instructions | Complete guide for AI-assisted development |
| π Feature Documentation | Detailed feature specifications |
| ποΈ Architecture Guide | System architecture and design patterns |
| π API Documentation | RESTful API endpoints and WebSocket events |
| π‘οΈ Security Guidelines | Security best practices and implementation |
| π Deployment Guide | Production deployment instructions |
POST /api/v1/auth/register # User registration
POST /api/v1/auth/login # User login
POST /api/v1/auth/refresh # Token refresh
POST /api/v1/auth/logout # User logoutGET /api/v1/conversations # List conversations
POST /api/v1/conversations/{id}/messages # Send message
WS /ws/chat # WebSocket connectionGET /api/v1/channels # List all channels
POST /api/v1/channels # Create new channel
POST /api/v1/channels/{id}/subscribe # Subscribe to channelPOST /api/v1/payments/orders # Create payment order
POST /api/v1/payments/verify # Verify payment
POST /api/v1/payments/webhooks # Razorpay webhooks# Unit tests
./gradlew test
# Integration tests
./gradlew integrationTest
# Test coverage report
./gradlew jacocoTestReport- Unit Tests: JUnit 5 + Mockito
- Integration Tests: TestContainers for database
- WebSocket Tests: Spring WebSocket Test
- Coverage: JaCoCo with 80% minimum coverage
# Build Docker image
docker build -t loopchat-backend .
# Run with Docker Compose
docker-compose up -d- Environment variables configured
- Database migrations applied
- SSL certificates installed
- Monitoring tools configured
- Backup strategy implemented
- Rate limiting configured
- Java 21+ (OpenJDK recommended)
- IntelliJ IDEA or VS Code
- Docker for local dependencies
- Postman for API testing
- Setup: Follow quick start instructions
- Branch: Create feature branch from
main - Code: Follow architectural guidelines
- Test: Write comprehensive tests
- Review: Submit pull request for review
- Deploy: Merge to main triggers deployment
- Follow Spring Boot conventions
- Use meaningful variable names
- Document public APIs with JavaDoc
- Implement proper error handling
- Add comprehensive logging
GET /actuator/health # Application health
GET /actuator/metrics # Application metrics
GET /actuator/info # Application info- Performance: API response times, throughput
- Business: Messages sent, payments processed, active users
- System: JVM metrics, database connections, cache hit rates
- Security: Failed logins, rate limit hits, suspicious activities
We welcome contributions! Please read our Contributing Guidelines for details on:
- Code of conduct
- Development process
- Pull request process
- Coding standards
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub Copilot Instructions - AI development assistance
- Architecture Guide - System design patterns
- API Documentation - Complete API reference
- π Bug Reports: Use GitHub Issues
- π‘ Feature Requests: Use GitHub Discussions
- π§ Security Issues: Email security@loopchat.com
- π¬ General Questions: Join our Discord community
- β MVP Features: Authentication, Messaging, Payments
- π In Development: Group chat, Voice messages
- π Planned: E2E encryption, Analytics dashboard
Built with β€οΈ for secure, scalable messaging by Gajanan Rathod