A Role-Based Secure Digital Document Management System built using Spring Boot, MySQL, JWT, and GCP-ready storage architecture.
This system allows hierarchical user creation and approval workflows with secure document upload and audit tracking.
Secure Digital Locker is a backend system designed to:
- Manage hierarchical users (ADMIN → HR → MANAGER → USER)
- Enforce approval workflows before activation
- Secure document upload & access control
- Maintain detailed audit logs
- Support both Local and GCP Cloud Storage
Client → REST API → Service Layer → Repository Layer → MySQL
↓
Storage Layer (Local / GCP)
- Backend: Spring Boot
- Security: Spring Security + JWT
- Database: MySQL 8
- ORM: Hibernate (JPA)
- Storage: Local File System / Google Cloud Storage
- Build Tool: Maven
- Testing: Shell API Test Script (curl-based)
| Role | Can Create | Can Approve |
|---|---|---|
| ADMIN | HR | HR |
| HR | MANAGER | MANAGER |
| MANAGER | USER | USER |
| USER | — | — |
Each created user must be approved by their superior before login access.
- JWT-based login
- Role-based authorization
- Secure password hashing (BCrypt)
- Hierarchical user creation
- Approval workflow
- Status tracking (PENDING / APPROVED / REJECTED)
- Soft deactivation support
- View & update profile
- Upload profile picture
- Upload documents
- Secure document retrieval
- Document visibility control
Tracks:
- LOGIN
- USER_CREATED
- APPROVAL
- UPLOAD
- DOWNLOAD
- DELETE
Main Tables:
usersprofilesdocumentsdocument_visibilityapproval_requestsaudit_logs
Foreign key constraints enforce data integrity.
Application uses environment-based configuration.
Example config file:
src/main/resources/application-example.properties
You must create:
application.properties
With your own:
- Database credentials
- JWT secret
- Storage configuration
git clone https://github.com/YOUR_USERNAME/SecureDigitalLocker.git
cd SecureDigitalLockerCreate database:
CREATE DATABASE dgll;Add your MySQL credentials.
./mvnw spring-boot:runServer runs on:
http://localhost:8080
Automated test script:
api_test.sh
It performs:
- Admin login
- HR creation & approval
- Manager creation & approval
- User creation & approval
- Document upload
Run:
chmod +x api_test.sh
./api_test.shProject includes:
GcpStorageService- Configurable storage type:
storage.type=local storage.type=gcp
Can be deployed to:
- Google Cloud Run
- Google Cloud SQL
- Google Cloud Storage
- BCrypt password hashing
- JWT token expiration
- Role-based endpoint protection
- Foreign key enforcement
- Centralized exception handling
- Docker support
- CI/CD pipeline
- Swagger documentation
- Pagination support
- Unit & integration tests
- Production environment profiles
Kolli Jayanth Eswar
Backend Developer | Spring Boot | Cloud Ready Systems
This project is licensed under the MIT License.