Electronic Document Management System

A production-ready full-stack document management system built with modern web technologies. Features secure file storage with AWS S3, role-based access control, and comprehensive API documentation. Deployed and serving real users with enterprise-grade security and performance.

PSMParamraj Singh Machre
12 min read
“Document management is not just about storing files; it's about creating intelligent workflows that enhance productivity and ensure security.”

The Electronic Document Management System (EDMS) is a full-stack web application built for secure document storage, management, and role-based access control. This project demonstrates modern software engineering practices, cloud integration, and production-ready deployment strategies.

Architecture & Tech Stack

The EDMS is built using a modern, scalable architecture that separates concerns and leverages cloud services for optimal performance and reliability.

Backend Technologies

Node.js + Express.js

JavaScript runtime for server-side development with Express minimal web framework

  • • RESTful API design with middleware
  • • Session management & JWT authentication
  • • Middleware chaining for security

MongoDB + Atlas

NoSQL database for flexible document storage and user management

  • • users collection for authentication
  • • files collection for metadata
  • • Cloud hosting with connection pooling

AWS S3 Integration

Scalable cloud storage with direct browser-to-S3 uploads

  • • Pre-signed URLs for direct uploads
  • • File metadata in MongoDB, files in S3
  • • CORS configuration for browser uploads

JWT Authentication

Stateless authentication with secure user sessions

  • • Token expiration & secure secret keys
  • • Protected routes validation
  • • Role-based access control

Frontend Technologies

EJS Templating

Server-side rendering with dynamic content generation

  • • dashboard.ejs - Main user interface
  • • admin.ejs - Admin management panel
  • • Conditional rendering & form handling

Vanilla JavaScript (ES6+)

No framework dependencies with full control over functionality

  • • Client-side filtering and sorting
  • • File upload handling with progress
  • • AJAX requests for real-time updates

CSS3 + Flexbox/Grid

Modern layout system with responsive design

  • • Mobile-first responsive design
  • • Flexbox for header & user cards
  • • CSS Grid for file grid layout

Progressive Enhancement

Works without JavaScript as fallback

  • • Graceful degradation
  • • SEO-friendly structure
  • • Accessibility compliance

Security Implementation

Security is paramount in document management systems. The EDMS implements multiple layers of security to protect sensitive data and ensure proper access control.

Authentication System

  • • JWT-based authentication with 24h expiration
  • • Secure session management
  • • Password hashing with bcrypt
  • • Protected routes validation

Role-Based Access Control

  • Admin: Full system access, user management
  • Contributor: Upload/download, own file deletion
  • Viewer: Download only, no upload/delete

Protected System Accounts

  • • Indestructible admin accounts
  • • Cannot be deleted or modified
  • • Special protection for system users

File Security

  • • Filename sanitization
  • • Content-Type validation
  • • Size limits (100MB)
  • • S3 signed URLs for downloads

File Management System

The file management system is designed for efficiency, security, and scalability. Files are stored in AWS S3 with metadata in MongoDB for optimal performance.

Upload Process

  1. 1Client validation (size/type checks)
  2. 2Server generates S3 pre-signed URL
  3. 3Browser uploads directly to S3
  4. 4Server saves file metadata in MongoDB
  5. 5User receives email notification

File Operations

Download

Secure downloads using S3 signed URLs with expiration

Preview

In-browser preview for images and PDFs with modal interface

Delete

Secure deletion from both S3 storage and database

Search/Filter

Filter by category, uploader, size with instant results

💡

Storage Architecture

Browser → S3 (Files) → MongoDB (Metadata) → Dashboard Display
This architecture ensures optimal performance by separating file storage from metadata, enabling fast queries and scalable file handling.

DevOps & Deployment

The deployment strategy leverages modern DevOps practices with automated testing, continuous integration, and serverless architecture for optimal performance and scalability.

Vercel Serverless Functions

  • • Auto-scaling, pay-per-request model
  • • vercel.json configuration for routing
  • • Environment variable management
  • • Zero-downtime deployments

GitHub Actions CI/CD

  • • Automated testing on multiple Node.js versions
  • • Quality assurance gates
  • • Automated deployment triggers
  • • Test coverage generation

Jest Testing Framework

  • • Unit tests for server logic
  • • Integration tests for database operations
  • • Security tests for authentication
  • • Performance tests for file operations

Monitoring & Logging

  • • Request/response logging
  • • Performance monitoring
  • • Error tracking and alerting
  • • Health check endpoints

Performance Optimizations

Performance is critical for document management systems handling large files and multiple users. The EDMS implements various optimization strategies across the entire stack.

Client-Side Performance

Lazy Loading

Files and images load on-demand to improve initial page speed

Event Delegation

Efficient event handling for large file grids

Debounced Search

Reduces API calls during typing for better UX

Browser Caching

Intelligent caching strategies for static assets

Server-Side Performance

Connection Pooling

MongoDB connection pooling for efficient database access

Asynchronous Operations

Non-blocking I/O operations for better throughput

Graceful Error Handling

Proper error handling prevents crashes and improves reliability

Memory Management

Efficient memory usage and garbage collection

Key Technical Decisions

Several strategic decisions were made during development to ensure optimal performance, scalability, and maintainability.

Direct S3 Uploads

Files upload directly from browser to S3, bypassing server limitations

  • • Avoids Vercel's 4.5MB function limit
  • • Faster uploads with reduced server load
  • • Better scalability for large files
  • • Improved user experience with progress tracking

Client-Side Filtering

Filtering and sorting happens in the browser for instant results

  • • No database queries for filtering operations
  • • Instant feedback for better UX
  • • Scalable with large datasets
  • • Works offline once data is loaded

EJS over React

Server-side rendering chosen over client-side framework

  • • Simpler server-side rendering setup
  • • No build pipeline required
  • • Faster initial page load
  • • SEO-friendly by default

MongoDB over SQL

NoSQL database chosen for flexible document storage

  • • Schema flexibility for evolving requirements
  • • Natural fit with JavaScript ecosystem
  • • Easy horizontal scaling
  • • Perfect for file metadata storage

API Documentation

The EDMS includes comprehensive API documentation with OpenAPI/Swagger integration for easy integration and testing.

Interactive Documentation

  • • OpenAPI/Swagger integration
  • • Interactive testing interface
  • • JWT authentication examples
  • • Request/response schemas

Key Endpoints

  • POST /registerSubmit - User registration
  • POST /loginSubmit - User authentication
  • GET /download/{filename} - File download
  • POST /upload - File upload
  • GET /api-docs - Interactive documentation

Future Enhancements

The EDMS is designed with extensibility in mind. Future enhancements are planned across three phases to continuously improve functionality and user experience.

Phase 1: Security & API

Rate Limiting

API rate limiting to prevent abuse

Audit Logging

Comprehensive audit trails for compliance

API Versioning

Versioned APIs for backward compatibility

Input Validation

Stricter validation and sanitization

Phase 2: Monitoring

Error Tracking

Real-time error tracking and alerting

Health Checks

Automated health check endpoints

Performance Monitoring

Detailed performance metrics and dashboards

User Analytics

User behavior and usage analytics

Phase 3: Advanced Features

File Versioning

Version control for document revisions

Elasticsearch

Advanced search capabilities

Real-time Collaboration

Live document editing and commenting

Mobile App

Native mobile application

Project Summary

The EDMS project demonstrates enterprise-level software engineering skills and showcases how to build, deploy, and maintain production-ready applications. This comprehensive system combines modern web technologies with robust security practices and scalable architecture.

Technical Skills Demonstrated

  • • Full-stack development with modern technologies
  • • Cloud integration (AWS S3, Vercel)
  • • Security implementation (JWT, RBAC)
  • • RESTful API design with Swagger docs
  • • Testing with Jest and CI/CD pipelines
  • • Performance optimization strategies

Architecture Decisions

  • • Modular microservice-friendly design
  • • Serverless + cloud storage for scalability
  • • Multi-layered security implementation
  • • Responsive UI with real-time updates
  • • Progressive enhancement principles
  • • Production-ready deployment strategy

Production Ready

The EDMS is currently deployed and serving real users with enterprise-grade security, performance, and reliability. Visit edms-blue.vercel.app to explore the live system.