Skip to content

Aditya-0601/LifeDoc

Repository files navigation

🔐 LifeDoc

The ultimate Personal Life-Document & Deadline Guardian System

LifeDoc solves a critical real-world problem: People forget where their important documents are and miss crucial expiry or renewal deadlines — resulting in financial, legal, and emotional stress.

LifeDoc acts as a highly secure digital vault, keeping your family's most important documents meticulously organized and proactively monitoring them for upcoming expirations to grant you total peace of mind.


✨ Key Features

  • Secure Digital Vault: Safely store, search, and categorize all your critical documents in one centralized ecosystem.
  • Expiry Radar & Proactive Alerts: Advanced background cron jobs autonomously monitor document expiration dates and dispatch Smart Alerts at 30, 14, 7, and 1 days prior to deadlines. Never miss a renewal again.
  • Emergency Family Access: Securely grant vault access to family members. Features a robust approval workflow mapping structured relational states (Pending, Approved, Revoked).
  • Comprehensive Admin Dashboard: Complete administrative oversight including real-time storage metrics, active vault tallies, document moderation, and instant user access controls.
  • Stunning UI Architecture: Built with a modern Glassmorphism design system powered by Tailwind CSS. Features high-performance, scroll-driven hero animations engineered using GSAP and Framer Motion.
  • 2FA & Email Services: Implements secure OTP based login for 2-Factor Authentication utilizing customized email dispatches.

🛠️ Architecture & Tech Stack

Backend Ecosystem

  • Core Runtime: Node.js & Express.js
  • Database: PostgreSQL (interfaced via pg) with automated schema migrations across complex relations.
  • Security Checksums: JWT for robust route authentication, bcryptjs for strict password hashing.
  • File & Image Processing: multer handling secure multipart-form data, pdf-parse & tesseract.js for text extraction.
  • Background Jobs: node-cron executing automated expiration sweeps.

Frontend Ecosystem

  • Framework: React 18
  • Styling: Tailwind CSS
  • Interactivity: Framer Motion & GSAP for timeline sequencing.
  • API Connectivity: Axios interceptors automatically injecting JWT signatures across all internal HTTP requests.

🚀 Getting Started

Prerequisites

Before running this project, ensure you have the following installed on your machine:

  1. Node.js: Download from nodejs.org.
  2. PostgreSQL: Download and configure from postgresql.org.

Environment Setup

  1. Database Configuration

    • Open your PostgreSQL command line tool (psql) or a graphical client (like pgAdmin).
    • Create a new, empty PostgreSQL database for the project (e.g., lifedoc).
  2. Environment Variables

    • In the root of this project folder, create a new file named .env.
    • Copy the contents from .env.example and fill in your actual values:
    # Database Configuration
    DB_HOST=localhost
    DB_PORT=5432
    DB_NAME=lifedoc
    DB_USER=your_postgres_username
    DB_PASSWORD=your_postgres_password
    
    # JWT Secret (IMPORTANT: Use the same secret across all deployments)
    JWT_SECRET=2a1d454ef0700f4a0e08b7523df38f4b03884092e4f8c412af6a26d0329aa8c34571f19c8a34494594c30cbaa5835c087348e4597cb1dc31137e7aa2968ed2aa
    
    # Email Configuration (optional)
    EMAIL_HOST=smtp.gmail.com
    EMAIL_PORT=587
    EMAIL_USER=your_email@gmail.com
    EMAIL_PASS=your_app_password
    
    # Server Configuration
    PORT=5000
    NODE_ENV=development

    IMPORTANT FOR COLLABORATORS:

    • Get the actual .env file from the project maintainer
    • Ensure the JWT_SECRET is exactly the same across all instances
    • Update database credentials to match your local PostgreSQL setup

Installation

Navigate to the root directory of this project in your terminal and install the required Node dependencies.

npm install

Troubleshooting: If the project fails to start with "Cannot find module" errors (e.g., pdf-parse, pg), ensure your npm install finished successfully. You may need to delete node_modules and package-lock.json and reinstall if corruption occurred.

For Collaborators (Important!)

If you downloaded this project as a ZIP file from GitHub, follow these steps:

  1. Create the uploads directory (missing from zip):

    mkdir uploads
  2. Get the .env file from the project maintainer - this contains database credentials and JWT secret

  3. Install dependencies:

    npm install
  4. Create your database in PostgreSQL with the name specified in your .env file

  5. Run the application:

    npm run dev

Common Issues & Solutions:

  • "Cannot find module" errors: Run npm install to install missing dependencies
  • Database connection errors: Check your PostgreSQL credentials in .env file
  • Authentication errors: Ensure JWT_SECRET matches the maintainer's exactly
  • Upload errors: Make sure the uploads/ directory exists and is writable

💻 Running the Application

This project utilizes a highly decoupled architecture, requiring both the Node.js API and the React Client to be served. For convenience, the package.json includes a concurrent script.

To launch the entire stack simultaneously, execute:

npm run dev

This command automatically boots the Express backend on Port 5000 and serves the React frontend Application on Port 3000.

Accessing the Platform

Once the startup sequence completes, open your web browser and navigate to: http://localhost:3000


🔒 Security Posture

  • Cryptographic Hashing: Passwords secured via bcrypt.
  • Stateless Sessions: JWT token-based authentication.
  • Input Sanitization: File upload validation pipelines explicitly rejecting malicious configurations.
  • SQL Protection: Forced Parameterized Queries across all native pg transactions to inherently block SQL injection vectors.
  • Access Control: Strict ProtectedRoute wrapper hierarchy denying render trees to unauthorized users.

📄 License & Origin

MIT Licensed. Designed and meticulously structured to handle massive scalability, real-world constraints, and the highest standards of production security for life's most precious documents.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors