Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” LegacyVault

Secure Asset Legacy Management System

LegacyVault is a modern, secure platform for managing digital wills and encrypted assets with conditional release mechanisms. Built with Django and featuring a beautiful, animated frontend with a profound color palette.

LegacyVault Django Python

✨ Features

Core Functionality

  • πŸ“‹ Digital Wills Management: Create and manage multiple digital wills
  • πŸ”’ End-to-End Encryption: Assets are encrypted; even the platform can't read them
  • ⏳ Smart Release Conditions:
    • Time-based releases
    • Inactivity-based releases
    • Approval-based releases (executor approval)
  • πŸ‘₯ Participant Management: Add executors and beneficiaries to wills
  • πŸ“Š Full Audit Trail: All actions are logged for transparency and compliance
  • βš™οΈ Inactivity Handling: Automatic handling of wills based on user inactivity

Production-Ready Upgrades

  • πŸ”Œ REST API Framework (Django REST Framework 3.15.1)

    • 50+ fully documented API endpoints
    • JWT token authentication with refresh tokens
    • Swagger UI & ReDoc interactive documentation
    • Pagination, filtering, and search capabilities
    • Rate limiting (100 req/hour anonymous, 1000 req/hour authenticated)
  • ⚑ Async Task Processing (Celery 5.3.4 + Redis 5.0.1)

    • Background job queue for non-blocking operations
    • Scheduled tasks (inactivity checks, email sending, session cleanup)
    • Celery Beat scheduler for recurring tasks
    • Redis message broker and caching
  • πŸ” Two-Factor Authentication (TOTP-based)

    • TOTP 2FA with QR code generation
    • Backup codes (10 per user)
    • API endpoints for setup and management
    • QR code support with qrcode library
  • πŸ“ˆ Error Tracking & Monitoring (Sentry SDK 1.40.0)

    • Production error tracking with Sentry
    • Django + Celery integrations
    • Automatic error reporting and alerting

Smart Features

  • πŸ€– Auto-Calculation: File size and SHA256 hash auto-generated on asset upload
  • πŸ“§ Email Notifications: Automatic emails for inactivity warnings and release requests
  • πŸ”„ Session Management: Automatic cleanup of expired sessions

Modern Frontend

  • 🎨 Profound Color Palette: Deep navy blues, rich purples, and teal accents
  • ✨ Smooth Animations: Fade-in, slide, and hover effects throughout
  • πŸ“± Responsive Design: Mobile-first approach with full tablet and desktop support
  • πŸ”– Tabbed Interface: Organized dashboard with separate tabs for different sections
  • πŸ’« Interactive Elements: Cards with hover effects, ripple animations, and smooth transitions
  • 🎯 Modern UI Components: Beautiful forms, buttons, badges, and cards

πŸš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • MySQL 5.7+ or higher (required)
  • pip (Python package manager)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd Legacy_System
  2. Create a virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Set up environment variables Create a .env file in the project root:

    DJANGO_SECRET_KEY=your-secret-key-here
    DJANGO_DEBUG=1
    DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
    
    # MySQL Database Configuration (Required)
    MYSQL_DATABASE=legacyvault
    MYSQL_USER=legacyvault
    MYSQL_PASSWORD=your-password
    MYSQL_HOST=127.0.0.1
    MYSQL_PORT=3306
  5. Run migrations

    python manage.py migrate
  6. Create a superuser (optional)

    python manage.py createsuperuser
  7. Collect static files

    python manage.py collectstatic --noinput
  8. Start the development server

    python manage.py runserver
  9. Start background services (in separate terminals)

    Option A: Development (without async tasks)

    # Server is ready at http://127.0.0.1:8000/

    Option B: Full production-like setup (with async tasks) Terminal 2 - Start Redis (required for Celery):

    redis-server

    Terminal 3 - Start Celery Worker:

    celery -A legacyvault worker -l info

    Terminal 4 - Start Celery Beat (scheduler):

    celery -A legacyvault beat -l info
  10. Access the application

πŸ“ Project Structure

Legacy_System/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ accounts/          # User authentication and inactivity settings
β”‚   β”œβ”€β”€ audit/             # Audit logging system
β”‚   └── wills/             # Core wills and assets management
β”œβ”€β”€ legacyvault/          # Django project settings
β”œβ”€β”€ static/               # Static files (CSS, JS, images)
β”‚   β”œβ”€β”€ frontend/
β”‚   β”‚   └── assets/
β”‚   β”‚       β”œβ”€β”€ index.css  # Frontend styles (imports main CSS)
β”‚   β”‚       └── index.js   # Frontend JavaScript
β”‚   └── style.css         # Main stylesheet with modern design
β”œβ”€β”€ templates/            # Django templates
β”‚   β”œβ”€β”€ base.html         # Base template
β”‚   β”œβ”€β”€ accounts/         # Authentication templates
β”‚   └── wills/            # Wills management templates
β”œβ”€β”€ requirements.txt      # Python dependencies
└── README.md            # This file

🎨 Frontend Architecture

Color Palette

The frontend uses a profound color scheme:

  • Primary Colors: Deep navy blues (#0a1628 to #bad5ff)
  • Accent Colors: Rich purple (#6c5ce7), Teal (#00b894), Gold (#fdcb6e)
  • Semantic Colors: Success (teal), Warning (gold), Danger (coral), Info (blue)

Key Features

  • CSS Variables: All colors and spacing defined as CSS variables for easy customization
  • Animations: Smooth transitions, fade-ins, and hover effects
  • Responsive Grid: Flexible grid system for cards and layouts
  • Tab System: JavaScript-powered tabs for organized content
  • Form Enhancements: Real-time validation feedback and loading states

JavaScript Functionality

  • Tab switching with smooth transitions
  • Scroll-triggered animations using Intersection Observer
  • Form validation and enhancement
  • Card interactions with ripple effects
  • Smooth scrolling for anchor links

πŸ”§ Configuration

Database Configuration

MySQL (Required)

MYSQL_DATABASE=legacyvault
MYSQL_USER=legacyvault
MYSQL_PASSWORD=your-password
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306

Note: LegacyVault requires MySQL 5.7+ or higher. SQLite is not supported.

Security Settings

For production, set these environment variables:

DJANGO_SECRET_KEY=your-strong-secret-key
DJANGO_DEBUG=0
DJANGO_SECURE_SSL_REDIRECT=1
DJANGO_SESSION_COOKIE_SECURE=1
DJANGO_CSRF_COOKIE_SECURE=1

πŸ“– API Documentation

The project includes comprehensive REST API documentation:

Authentication

API endpoints use JWT token authentication:

  1. Get Token

    curl -X POST http://127.0.0.1:8000/api/v1/auth/token/ \
      -H "Content-Type: application/json" \
      -d '{"username":"user","password":"pass"}'
  2. Use Token in Requests

    curl -H "Authorization: Bearer YOUR_TOKEN" \
      http://127.0.0.1:8000/api/v1/wills/

πŸ“Š Documentation Files

  • API_DOCUMENTATION.md - Complete REST API reference with 50+ endpoints
  • UPGRADE_GUIDE.md - Comprehensive guide to new features (REST, Celery, 2FA, Sentry)
  • QUICK_REFERENCE.md - Quick start guide for common tasks
  • COMPLETION_SUMMARY.md - Deployment and production readiness checklist
  • UPGRADE_SUMMARY.md - Overview of all upgrades and enhancements
  • SHA256_AUTO_GENERATION.md - Details on automatic SHA256 hash generation

πŸ› οΈ Development

Running Tests

python manage.py test

Creating Migrations

python manage.py makemigrations
python manage.py migrate

Collecting Static Files

python manage.py collectstatic

Code Style

The project follows PEP 8 Python style guidelines and uses Django's recommended practices.

πŸ” Security Features

  • CSRF Protection: All forms are protected with CSRF tokens
  • Authentication Required: Most views require user authentication
  • Permission Checks: Users can only access their own wills and assets
  • Audit Logging: All actions are logged with IP addresses and user agents
  • Encrypted Storage: Assets are stored as ciphertext only

πŸ“ API Endpoints

Main URLs

  • / - Homepage
  • /accounts/login/ - User login
  • /accounts/signup/ - User registration
  • /accounts/logout/ - User logout
  • /accounts/inactivity_settings/ - Inactivity preferences
  • /wills/dashboard/ - Main dashboard
  • /wills/create/ - Create a new will
  • /admin/ - Django admin panel

🚒 Deployment

Quick Start with Docker

  1. Build the Docker image:

    docker build -t legacyvault .
  2. Run with docker-compose:

    docker-compose up -d

Manual Production Deployment

  1. Set production environment variables in .env:

    DJANGO_SECRET_KEY=your-strong-secret-key
    DJANGO_DEBUG=0
    DJANGO_ALLOWED_HOSTS=yourdomain.com
    
    # Database
    MYSQL_DATABASE=legacyvault
    MYSQL_USER=legacyvault
    MYSQL_PASSWORD=strong-password
    MYSQL_HOST=db-server
    MYSQL_PORT=3306
    
    # Security
    DJANGO_SECURE_SSL_REDIRECT=1
    DJANGO_SESSION_COOKIE_SECURE=1
    DJANGO_CSRF_COOKIE_SECURE=1
    
    # Celery & Redis
    CELERY_BROKER_URL=redis://localhost:6379/0
    CELERY_RESULT_BACKEND=redis://localhost:6379/1
    
    # Sentry (Error Tracking)
    SENTRY_DSN=your-sentry-dsn-here
  2. Run migrations:

    python manage.py migrate
  3. Collect static files:

    python manage.py collectstatic --noinput
  4. Start services:

    Web Server (use Gunicorn):

    gunicorn legacyvault.wsgi:application --bind 0.0.0.0:8000

    Celery Worker:

    celery -A legacyvault worker -l info

    Celery Beat (Scheduler):

    celery -A legacyvault beat -l info

    Redis (Message Broker & Cache):

    redis-server
  5. Configure reverse proxy (Nginx example):

    server {
        listen 80;
        server_name yourdomain.com;
        
        location / {
            proxy_pass http://127.0.0.1:8000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }

See COMPLETION_SUMMARY.md for detailed deployment instructions.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Django Framework
  • Firebase Admin SDK
  • All contributors and users

πŸ“ž Support

For issues, questions, or contributions, please open an issue on the GitHub repository.

🎯 Roadmap

βœ… Completed

  • βœ… REST API with 50+ endpoints (Django REST Framework)
  • βœ… JWT authentication with token refresh
  • βœ… Async task processing (Celery + Redis)
  • βœ… Two-factor authentication (TOTP-based)
  • βœ… Error tracking (Sentry integration)
  • βœ… Automatic SHA256 hash generation
  • βœ… Automatic file size calculation
  • βœ… Rate limiting and security headers
  • βœ… Request logging for audit trail
  • βœ… Interactive API documentation (Swagger & ReDoc)
  • βœ… Testing framework (pytest + pytest-django)
  • βœ… Modern responsive frontend

πŸš€ Planned Features

  • Mobile app (using REST API)
  • Multi-language support
  • Advanced encryption options
  • Email notification templates customization
  • Role-based access control (RBAC)
  • Backup and recovery features
  • API rate limiting per user tier
  • Enhanced search and filtering

πŸ“Έ Screenshots

Screenshot 2025-12-23 015437 Screenshot 2025-12-23 015453 Screenshot 2025-12-23 015510 Screenshot 2025-12-23 015521 Screenshot 2025-12-23 015547 Screenshot 2025-12-23 015610

πŸ“Š Recent Updates

Production-Ready Upgrades (Latest)

  • βœ… REST API Framework: 50+ endpoints with JWT auth, pagination, filtering
  • βœ… Async Task Processing: Celery + Redis for background jobs and scheduling
  • βœ… Two-Factor Authentication: TOTP-based 2FA with backup codes and QR generation
  • βœ… Error Tracking: Sentry integration for production monitoring
  • βœ… Auto-Calculation: SHA256 hashing and file size auto-generated on upload
  • βœ… Enhanced Security: CORS, rate limiting, security headers, request logging
  • βœ… API Documentation: Interactive Swagger UI and ReDoc documentation
  • βœ… Testing Suite: pytest + pytest-django with coverage reporting
  • βœ… Comprehensive Documentation: 6 detailed guides covering all features

Previous Updates

  • βœ… Frontend modernization with profound color palette
  • βœ… Smooth animations and transitions
  • βœ… Tabbed dashboard interface
  • βœ… Responsive mobile-first design
  • βœ… Modern form enhancements
  • βœ… Interactive card components

Made with ❀️ for secure digital legacy management

About

LegacyVault is a secure digital legacy management platform built with Django that enables users to create encrypted digital wills and assets with conditional release mechanisms. It supports time, inactivity, and approval-based triggers, offers audit trails, REST APIs, 2FA, and async processing for production-grade reliability.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages