Group Name: Databasement
GitHub Repository: Databasement
Demo Video: Watch Demo
SafeDocs is a secure file management system that enables authenticated members to upload, manage, and share files within a group. It integrates with the centralized CIMS database to provide:
- Secure authentication and session validation
- Role-based access control
- Audit trails for critical actions
- Seamless integration with member data from the central system
| Table Name | Description | Fields |
|---|---|---|
pdfdocument |
Stores file metadata | DocumentID, OwnerID, FilePath, UploadTimestamp |
folder |
Represents user folders | FolderID, MemberID, FolderName, FolderType |
folderdocuments |
Maps files to folders | FolderID, DocumentID |
accesscontrol |
Manages access rights | DocumentID, MemberID, AccessLevel (view/edit) |
sharedrequests |
Pending access requests | RequestID, SenderID, ReceiverID, DocumentID, Status |
All tables are created using SQL scripts and avoid duplicating centralized data.
get_connection()→ connects to cs432cims (central)get_connection(0)→ connects to cs432g12 (group)
membersloginmembergroupmapping
- Checks member existence in other groups
- Deletes from
membersandloginonly if no other group references - Always removes from
membergroupmappingfor the group
@is_valid_sessionused on protected routes- Validates session via:
http://10.0.116.125:5000/isValidSession
- Admin: Full access – edit users, create admins, delete members
- Regular User: Can only manage personal files and requests
- Confirmation modals for delete operations
- UI elements shown based on session role
| Action | Method | Endpoint | Access | Description |
|---|---|---|---|---|
| Login | POST | /login |
Public | Authenticates using central API |
| Logout | GET | /logout |
Authenticated | Ends session |
| Upload File | POST | /upload |
Authenticated | Uploads file and stores metadata |
| View File | GET | /files/<token> |
AccessControlled | Opens file if access is granted |
| Delete File | DELETE | /files/<doc_id> |
Owner/Admin | Deletes file |
| Send Share Request | POST | /shared_requests/send |
Authenticated | Sends a file access request |
| Update Share Request | POST | /shared_requests/<id>/update |
Receiver | Accepts/rejects access request |
| View Portfolio | GET | /portfolio |
Authenticated | Displays group members |
| Edit Portfolio | POST | /portfolio/edit |
Admin | Edits member data |
- File uploads/deletions
- Access requests
- Member edits and deletions
- Logs written to
auditlogtable with:
MemberID,ActionType,DocumentID,Timestamp - Unauthorized attempts logged via session validation failures
- Displays all group members (from
membergroupmapping) - Admins can update roles/emails
- Regular users can view their profile only
- By user (self-register) or by admin
- Password hashed before DB insert
- Uses centralized login system for token-based auth
- Checks group membership
- Deletes from
membersandloginonly if no other group is associated - Logs action in
auditlogand server logs
| Name | Roll No. | Contributions |
|---|---|---|
| Aryan Sahu | 22110038 | Flask backend, API integration, CIMS DB access, Session handling, Folders |
| Dewansh Kumar | 22110071 | Frontend (HTML/CSS/JS), Modals, Role-based UI, SQL scripts, Audit logs |
📽️ Watch Here
Covers:
- Login and session validation
- File upload and folder creation
- Sharing requests and access control
- Admin privileges and logs
- SQL Admin: http://10.0.116.125/phpmyadmin
- Auth Server: http://10.0.116.125:5000
- Group DB:
cs432g9 - Central DB:
cs432cims