Skip to content

A robust, enterprise-grade document management system backend built with Spring Boot 3.5, Java 21, and AWS S3. Features secure file storage, version control, JWT authentication, and full-text search capabilities. Designed for scalable document operations with cloud-native architecture.

Notifications You must be signed in to change notification settings

ayushnandi/SmartDocumentManagementSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“„ Smart Document Management System (SDMS) Backend

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.

Java Spring Boot PostgreSQL AWS S3 Docker License


๐Ÿš€ One-Liner Summary

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.


๐Ÿ› ๏ธ Tech Stack

Backend Framework

  • Spring Boot - Enterprise Java framework
  • Java - Modern Java with latest features

Database & Storage

  • PostgreSQL - Primary relational database
  • AWS S3 - Cloud object storage
  • Elasticsearch - Full-text search engine

Security & Authentication

  • Spring Security - Comprehensive security framework
  • JWT - Stateless authentication

Document Processing

  • Apache Tika - Content extraction & metadata parsing
  • Lombok - Boilerplate reduction

Development & Deployment

  • Maven - Build automation
  • Docker - Containerization
  • Dotenv - Environment management

โœจ Features

๐Ÿ” Security & Authentication

  • JWT-based authentication with secure token management
  • Role-based access control for document operations
  • Secure file upload/download with validation
  • Environment-based configuration management

๐Ÿ“ Document 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

๐Ÿ” Search & Discovery

  • Full-text search capabilities (Elasticsearch integration)
  • Metadata-based filtering and sorting
  • Content extraction for searchable documents
  • Advanced query support for complex searches

๐Ÿ—๏ธ Architecture & Scalability

  • Microservices-ready architecture
  • RESTful API design with comprehensive endpoints
  • Database optimization with JPA/Hibernate
  • Cloud-native deployment support
  • Horizontal scaling capabilities

๐Ÿ“Š Monitoring & Performance

  • Comprehensive logging with configurable levels
  • Error handling with detailed exception management
  • Performance monitoring capabilities
  • Health check endpoints for system monitoring

๐Ÿ–ผ๏ธ Screenshots & Demo

API Endpoints Overview

๐Ÿ“ก 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

Database Schema

๐Ÿ—„๏ธ Core Entities:
โ”œโ”€โ”€ User                # User management
โ”œโ”€โ”€ Document            # Document metadata
โ”œโ”€โ”€ DocumentVersion     # Version control
โ””โ”€โ”€ Relationships       # Optimized for performance

๐Ÿš€ Installation Guide

Prerequisites

  • Java 21 or higher
  • Maven 3.9+
  • PostgreSQL 15+
  • AWS S3 bucket
  • Docker (optional)

Quick Start

  1. Clone the repository

    git clone https://github.com/yourusername/sdms-backend.git
    cd sdms-backend
  2. Configure environment variables

    cp env.example .env
    # Edit .env with your credentials
  3. Set up database

    # Create PostgreSQL database
    createdb sdms_db
  4. Run with Maven

    mvn spring-boot:run
  5. Or use Docker

    docker build -t sdms-backend .
    docker run -p 8080:8080 sdms-backend

Environment Configuration

# 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

๐Ÿ“– Usage Instructions

Authentication

# 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"
}

Document Operations

# 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>

API Response Examples

{
  "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"
    }
  ]
}

๐Ÿ—๏ธ Project Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Client Apps   โ”‚    โ”‚   Load Balancer โ”‚    โ”‚   API Gateway   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  SDMS Backend   โ”‚
                    โ”‚  (Spring Boot)  โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚                       โ”‚                       โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   PostgreSQL    โ”‚    โ”‚     AWS S3      โ”‚    โ”‚  Elasticsearch  โ”‚
โ”‚   (Primary DB)  โ”‚    โ”‚  (File Storage) โ”‚    โ”‚   (Search)      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Architecture Highlights

  • 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

๐ŸŽฏ Why This Project?

Technical Excellence

  • 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

What I Learned

  • 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

Skills Demonstrated

  • 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

๐Ÿ“ˆ Performance & Benchmarks

System Performance

  • 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

Scalability Metrics

  • 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

๐Ÿ”ฎ Future Improvements

Planned Features

  • 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

Technical Enhancements

  • 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

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow Java coding conventions
  • Add comprehensive tests for new features
  • Update documentation for API changes
  • Ensure all tests pass before submitting PR

๐Ÿ“ž Contact & Connect

Ayush - Full Stack Developer

Let's Connect!

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

About

A robust, enterprise-grade document management system backend built with Spring Boot 3.5, Java 21, and AWS S3. Features secure file storage, version control, JWT authentication, and full-text search capabilities. Designed for scalable document operations with cloud-native architecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published