Built with ๐ป love and scalability in mind by Ayush
A robust, enterprise-grade document management system backend that provides secure file storage, version control, and intelligent search capabilities. Designed for high-performance document operations with cloud-native architecture.
A production-ready document management backend that transforms how organizations handle file storage, versioning, and retrieval with enterprise-grade security, cloud scalability, and intelligent search capabilities.
- JWT-based authentication with secure token management
- Role-based access control for document operations
- Secure file upload/download with validation
- Environment-based configuration management
- Multi-format file support (PDF, DOC, DOCX, TXT, images, etc.)
- Cloud storage integration with AWS S3
- Metadata extraction using Apache Tika
- File versioning with change tracking
- Bulk operations for efficient document handling
- Full-text search capabilities (Elasticsearch integration)
- Metadata-based filtering and sorting
- Content extraction for searchable documents
- Advanced query support for complex searches
- Microservices-ready architecture
- RESTful API design with comprehensive endpoints
- Database optimization with JPA/Hibernate
- Cloud-native deployment support
- Horizontal scaling capabilities
- Comprehensive logging with configurable levels
- Error handling with detailed exception management
- Performance monitoring capabilities
- Health check endpoints for system monitoring
๐ก RESTful API Structure:
โโโ /api/auth/ # Authentication endpoints
โโโ /api/users/ # User management
โโโ /api/documents/ # Document operations
โ โโโ /upload # File upload
โ โโโ /download/{id} # File download
โ โโโ /search # Document search
โ โโโ /{id}/versions # Version management
โโโ /api/health # System health checks
๐๏ธ Core Entities:
โโโ User # User management
โโโ Document # Document metadata
โโโ DocumentVersion # Version control
โโโ Relationships # Optimized for performance
- Java 21 or higher
- Maven 3.9+
- PostgreSQL 15+
- AWS S3 bucket
- Docker (optional)
-
Clone the repository
git clone https://github.com/yourusername/sdms-backend.git cd sdms-backend
-
Configure environment variables
cp env.example .env # Edit .env with your credentials
-
Set up database
# Create PostgreSQL database createdb sdms_db
-
Run with Maven
mvn spring-boot:run
-
Or use Docker
docker build -t sdms-backend . docker run -p 8080:8080 sdms-backend
# Database Configuration
DATABASE_URL=jdbc:postgresql://localhost:5432/sdms_db
DATABASE_USERNAME=your_username
DATABASE_PASSWORD=your_password
# AWS S3 Configuration
AWS_ACCESS_KEY=your_access_key
AWS_SECRET_KEY=your_secret_key
AWS_S3_BUCKET=your_bucket_name
# JWT Configuration
JWT_SECRET=your_jwt_secret_key
# Register a new user
POST /api/auth/register
{
"username": "john_doe",
"email": "john@example.com",
"password": "secure_password"
}
# Login
POST /api/auth/login
{
"username": "john_doe",
"password": "secure_password"
}
# Upload document
POST /api/documents/upload
Content-Type: multipart/form-data
Authorization: Bearer <jwt_token>
# Download document
GET /api/documents/download/{document_id}
Authorization: Bearer <jwt_token>
# Search documents
GET /api/documents/search?query=project+report
Authorization: Bearer <jwt_token>
# Get document versions
GET /api/documents/{document_id}/versions
Authorization: Bearer <jwt_token>
{
"id": 1,
"name": "project_report.pdf",
"uploadTime": "2024-01-15T10:30:00",
"user": {
"id": 1,
"username": "john_doe"
},
"versions": [
{
"versionNumber": 1,
"uploadTime": "2024-01-15T10:30:00",
"notes": "Initial version"
}
]
}
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Client Apps โ โ Load Balancer โ โ API Gateway โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโ
โ SDMS Backend โ
โ (Spring Boot) โ
โโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ PostgreSQL โ โ AWS S3 โ โ Elasticsearch โ
โ (Primary DB) โ โ (File Storage) โ โ (Search) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
- Layered Architecture: Controller โ Service โ Repository pattern
- Cloud-Native: Designed for containerized deployment
- Scalable: Horizontal scaling support with load balancing
- Secure: Multi-layer security with JWT and role-based access
- Resilient: Comprehensive error handling and recovery
- Modern Java 21: Leveraging latest language features and performance improvements
- Enterprise Patterns: Clean architecture with proper separation of concerns
- Cloud Integration: Seamless AWS S3 integration for scalable storage
- Search Capabilities: Elasticsearch integration for powerful document discovery
- Microservices Architecture: Designing scalable, maintainable systems
- Cloud-Native Development: AWS integration and containerization
- Security Best Practices: JWT implementation and secure file handling
- Performance Optimization: Database design and query optimization
- API Design: RESTful principles and comprehensive documentation
- Backend Development: Spring Boot, JPA/Hibernate, REST APIs
- Database Design: PostgreSQL optimization and relationship modeling
- Cloud Services: AWS S3 integration and cloud-native patterns
- Security: Authentication, authorization, and secure file operations
- DevOps: Docker containerization and deployment automation
- Testing: Comprehensive unit and integration testing
- Response Time: < 200ms for document metadata operations
- File Upload: Supports files up to 100MB with streaming
- Concurrent Users: Designed for 1000+ concurrent connections
- Database: Optimized queries with proper indexing
- Horizontal Scaling: Ready for container orchestration
- Storage: Unlimited cloud storage with AWS S3
- Search: Sub-second search results with Elasticsearch
- Availability: 99.9% uptime target with proper monitoring
- Real-time Collaboration: WebSocket integration for live editing
- Advanced Search: AI-powered semantic search capabilities
- Document Workflow: Approval processes and status tracking
- Mobile API: Optimized endpoints for mobile applications
- Analytics Dashboard: Document usage and performance metrics
- Caching Layer: Redis integration for improved performance
- Message Queue: Kafka/RabbitMQ for async processing
- Monitoring: Prometheus/Grafana integration
- CI/CD Pipeline: Automated testing and deployment
- Multi-tenancy: Support for multiple organizations
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a 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
- Follow Java coding conventions
- Add comprehensive tests for new features
- Update documentation for API changes
- Ensure all tests pass before submitting PR
- LinkedIn: Connect with me
- Portfolio: View my work
- Email: ayushnandi.work24@gmail.com
- GitHub: @ayushnandi
I'm passionate about building scalable, secure, and user-friendly applications. If you're interested in collaborating on exciting projects or have questions about this implementation, feel free to reach out!
โญ Star this repository if you found it helpful!
Built with ๐ป love and scalability in mind