A comprehensive web-based application for uploading, managing, and viewing documents in AWS S3 with advanced folder structure support, search functionality, and secure authentication.
The DBMS (Database Management System) is a Flask-based web application that provides a secure, user-friendly interface for managing files and folders in AWS S3. It features real-time upload progress tracking, advanced search capabilities, and a modern responsive UI.
- π Secure Authentication: JWT-based login system with session management
- π Advanced Search: Real-time search through files and folders with filtering
- π Multiple Folder Upload: Bulk upload with folder structure preservation
- π Folder Management: Hierarchical folder organization and management
- π File Browser: Modern, responsive interface for file operations
- βοΈ Direct S3 Integration: Seamless AWS S3 bucket integration
- β‘ File Operations: View, download, and delete files with confirmation
- π Progress Tracking: Real-time upload progress with detailed statistics
- π¨ Modern UI: Beautiful, responsive design with excellent UX
- π Security: Environment-based AWS credentials and secure file handling
- π Analytics: Folder size tracking and file count statistics
- π Reporting: Excel report generation for S3 folder analysis
- Main Application Server: Flask-based web server handling HTTP requests
- Authentication System: JWT-based session management with login/logout functionality
- Route Handlers: RESTful API endpoints for file operations
- S3 Integration: Direct AWS S3 client integration for file operations
- File Validation: Security checks for file types and upload validation
- Analytics Module: Standalone utility for S3 bucket analysis
- Excel Reporting: Automated Excel report generation with folder statistics
- Data Processing: S3 metadata extraction and processing
- Configuration Management: Environment variable handling for AWS credentials
- Login Interface (
templates/login.html): Secure authentication form with modern UI - Main Dashboard (
templates/index.html): Comprehensive file management interface - Responsive Design: Mobile-friendly layouts with CSS Grid and Flexbox
- Interactive Elements: JavaScript-powered upload progress and file operations
- Environment Configuration:
.envfile for secure credential management - Dependency Management:
requirements.txtwith version-pinned packages - Startup Scripts:
start_app.batfor Windows deployment automation - Static Assets: CSS styling and JavaScript functionality
- Backend: Python 3.7+, Flask 2.3.3, Boto3 1.28.62
- Frontend: HTML5, CSS3, Vanilla JavaScript
- Cloud: AWS S3, AWS IAM
- Security: JWT tokens, Environment variables, File validation
- Reporting: OpenPyXL for Excel generation
- Deployment: Windows batch scripts, pip package management
- Python 3.7 or higher
- AWS S3 bucket with appropriate permissions
- AWS access credentials (Access Key ID, Secret Access Key)
- AWS IAM user with S3 read/write permissions
Run the batch file to install all required packages:
start_app.bat
Or manually install:
pip install -r requirements.txt
Your .env file is already configured with:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION
- S3_BUCKET_NAME
- JWT_SECRET
Option 1: Use the batch file
start_app.bat
Option 2: Run manually
python app.py
Open your web browser and go to:
http://localhost:5000
Use the following credentials to access the system:
- Username:
theops - Password:
theopss
- Login: Enter your credentials to access the system
- Search: Use the search bar to find specific files or folders
- Upload Files:
- Select a folder from the dropdown (or leave empty for root)
- Choose multiple files to upload
- Click "Upload Files" button
- Create Folders: Use the "Create New Folder" section to organize your files
- Manage Files: View, download, or delete files using the action buttons
- View Files: Click the eye icon to view files in a new tab
- Download Files: Click the download icon to download files
- Delete Files: Click the trash icon to delete files (with confirmation)
- Click the "+" button next to the folder dropdown
- Enter the folder name in the modal
- Click "Create Folder"
The application supports various file types including:
- Documents: PDF, DOC, DOCX, TXT, CSV
- Images: PNG, JPG, JPEG, GIF
- Spreadsheets: XLS, XLSX
- Presentations: PPT, PPTX
- Archives: ZIP, RAR, 7Z
- Media: MP4, AVI, MOV, MP3, WAV
- Data: JSON, XML
-
GET /login- Display login page- Response: HTML login form
- Authentication: Not required
-
POST /login- Authenticate user credentials- Request Body:
username,password - Response: Redirect to dashboard or error message
- Authentication: Not required
- Request Body:
-
GET /logout- Logout and clear session- Response: Redirect to login page
- Authentication: Required
-
GET /- Main dashboard interface- Response: HTML dashboard with folders and files
- Authentication: Required
- Features: Search functionality, file management interface
-
POST /upload- Upload individual files- Request Body:
files[],target_folder(optional) - Response: Redirect with success/error message
- Authentication: Required
- File Types: Allowed extensions only
- Request Body:
-
POST /upload_folder- Upload entire folder structure- Request Body:
folder_files[](multiple files with folder structure) - Response: Redirect with upload statistics
- Authentication: Required
- Features: Duplicate folder detection, progress tracking
- Request Body:
-
GET /delete/<file_key>- Delete file from S3- Parameters:
file_key(S3 object key) - Response: Redirect with success/error message
- Authentication: Required
- Parameters:
-
GET /api/folders- Get folders list (JSON)- Response: JSON array of folder objects
- Authentication: Required
- Data: Folder name, size, file count, last modified
-
GET /api/files- Get files list (JSON)- Response: JSON array of file objects
- Authentication: Required
- Data: File key, name, folder, size, URL, last modified
-
POST /api/upload_progress- Real-time upload progress- Request Body:
folder_name,progress,status - Response: JSON success/error response
- Authentication: Required
- Purpose: Progress tracking for large uploads
- Request Body:
- Authentication Required: All routes except login require authentication
- Session Management: Secure session handling with JWT secret
- AWS Credentials: Loaded from environment variables for security
- File Validation: Uploads are validated for allowed extensions
- Filename Sanitization: All filenames are sanitized for security
- HTTPS Recommended: Use HTTPS in production environments
- AWS Credentials Error: Verify your
.envfile has correct AWS credentials - Bucket Access Error: Ensure your AWS user has S3 permissions for the bucket
- File Upload Fails: Check file size limits and network connection
- Port Already in Use: The app runs on port 5000 by default
- Check the flash messages at the top of the page for detailed error information
- Server logs are printed to the console where you ran the application
DBMS-Project/
βββ π app.py # Main Flask application server
β βββ Authentication & Session Management
β βββ S3 Integration & File Operations
β βββ Route Handlers & API Endpoints
β βββ File Validation & Security
β
βββ π s3_folder_checker.py # S3 Analytics & Reporting Module
β βββ Bucket Analysis Functions
β βββ Excel Report Generation
β βββ Metadata Processing
β βββ Configuration Management
β
βββ π templates/ # Frontend Templates
β βββ π login.html # Authentication Interface
β β βββ Login Form & Validation
β β βββ Password Toggle Feature
β β βββ Flash Message Display
β β βββ Responsive Design
β β
β βββ π index.html # Main Dashboard Interface
β βββ File Upload Interface
β βββ Folder Management
β βββ Search & Filtering
β βββ Progress Tracking
β βββ File Operations (View/Download/Delete)
β βββ Real-time Updates
β
βββ π static/ # Static Assets (if any)
β βββ CSS files
β βββ JavaScript files
β βββ Images/Icons
β
βββ π requirements.txt # Python Dependencies
β βββ Flask==2.3.3
β βββ boto3==1.28.62
β βββ python-dotenv==1.0.0
β βββ Werkzeug==2.3.7
β
βββ π .env # Environment Configuration
β βββ AWS_ACCESS_KEY_ID
β βββ AWS_SECRET_ACCESS_KEY
β βββ AWS_DEFAULT_REGION
β βββ S3_BUCKET_NAME
β βββ JWT_SECRET
β
βββ π start_app.bat # Windows Deployment Script
β βββ Dependency Installation
β βββ Environment Setup
β βββ Application Startup
β
βββ π __pycache__/ # Python Cache Files
β βββ Compiled Python modules
β
βββ π README.md # Project Documentation
βββ Setup Instructions
βββ API Documentation
βββ Architecture Overview
βββ Workflow Diagrams
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Flask App β β AWS S3 β
β (Templates) βββββΊβ (app.py) βββββΊβ (Cloud) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β β
β β β
βΌ βΌ βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β User β β S3 Checker β β File Storage β
β Interface β β (Analytics) β β & Metadata β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
The following diagram illustrates the complete workflow of the DBMS application, showing all major processes, decision points, and data flows:
graph TD
A[User Access] --> B{Authentication Required?}
B -->|No| C[Login Page]
B -->|Yes| D[Main Dashboard]
C --> E[Enter Credentials]
E --> F{Valid Credentials?}
F -->|No| G[Show Error Message]
F -->|Yes| H[Create Session]
G --> C
H --> D
D --> I[Load S3 Data]
I --> J[Display Folders & Files]
J --> K{User Action}
K -->|Search| L[Filter Results]
L --> J
K -->|Upload Files| M[Select Files]
M --> N[Choose Target Folder]
N --> O[Validate Files]
O --> P{Valid Files?}
P -->|No| Q[Show Error]
P -->|Yes| R[Upload to S3]
Q --> D
R --> S[Update Progress]
S --> T{Upload Complete?}
T -->|No| S
T -->|Yes| U[Show Success Message]
U --> D
K -->|Upload Folders| V[Select Folder Structure]
V --> W[Analyze Folder Contents]
W --> X[Check Existing Folders]
X --> Y{Duplicate Folders?}
Y -->|Yes| Z[Skip Existing]
Y -->|No| AA[Upload New Folders]
Z --> BB[Show Skip Message]
AA --> CC[Track Progress]
CC --> DD[Update Statistics]
BB --> D
DD --> D
K -->|View File| EE[Generate S3 URL]
EE --> FF[Open in New Tab]
K -->|Download File| GG[Generate Download URL]
GG --> HH[Trigger Download]
K -->|Delete File| II[Confirm Deletion]
II --> JJ{Confirmed?}
JJ -->|No| D
JJ -->|Yes| KK[Delete from S3]
KK --> LL[Show Success Message]
LL --> D
K -->|Logout| MM[Clear Session]
MM --> C
%% S3 Analytics Workflow
NN[Run S3 Checker] --> OO[Load Environment]
OO --> PP[Connect to S3]
PP --> QQ[List Bucket Contents]
QQ --> RR[Process Folder Data]
RR --> SS[Generate Excel Report]
SS --> TT[Save Report File]
%% Error Handling
R --> UU{Upload Error?}
UU -->|Yes| VV[Show Error Details]
VV --> D
KK --> WW{Delete Error?}
WW -->|Yes| XX[Show Error Details]
XX --> D
%% Styling
classDef startEnd fill:#e1f5fe,stroke:#01579b,stroke-width:2px
classDef process fill:#f3e5f5,stroke:#4a148c,stroke-width:2px
classDef decision fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef error fill:#ffebee,stroke:#c62828,stroke-width:2px
classDef success fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px
class A,C,D startEnd
class E,H,I,J,M,N,O,R,S,V,W,X,AA,CC,DD,EE,FF,GG,HH,II,KK,LL,MM,OO,PP,QQ,RR,SS,TT process
class B,F,K,P,T,Y,JJ,UU,WW decision
class G,Q,VV,XX error
class U,BB,LL success
- User Access: User navigates to the application
- Session Check: System verifies if user is already authenticated
- Login Process: If not authenticated, user enters credentials
- Validation: System validates username/password against stored credentials
- Session Creation: Upon successful authentication, JWT session is created
- Dashboard Access: User gains access to main application interface
- File Selection: User selects files from local system
- Folder Selection: User chooses target folder (optional)
- File Validation: System checks file types against allowed extensions
- S3 Upload: Valid files are uploaded directly to AWS S3
- Progress Tracking: Real-time progress updates with statistics
- Completion: Success/error messages displayed to user
- Folder Selection: User selects entire folder structure
- Content Analysis: System analyzes folder contents and structure
- Duplicate Check: System checks for existing folders in S3
- Selective Upload: Only new folders are uploaded, existing ones are skipped
- Progress Monitoring: Individual folder progress tracking
- Statistics Update: Real-time folder and file count updates
- Search Input: User enters search query
- Real-time Filtering: Results are filtered as user types
- File Operations: Users can view, download, or delete files
- Confirmation Dialogs: Delete operations require user confirmation
- S3 Integration: All operations interact directly with S3
- S3 Connection: Analytics module connects to S3 bucket
- Data Extraction: Folder metadata and statistics are extracted
- Report Generation: Excel report is created with comprehensive data
- File Output: Report is saved locally with timestamp
To modify the application:
- Backend Changes: Edit
app.pyfor server-side functionality - Frontend Changes: Edit
templates/index.htmlfor UI modifications - Dependencies: Add new packages to
requirements.txt - Analytics: Modify
s3_folder_checker.pyfor reporting features
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright 2025 DBMS Project
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This project is for internal use. Ensure AWS credentials are kept secure and not shared.