Skip to content

ANSHPG/Lap-Machines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logo-custom

Lap Machines

Version License Node Go React PostgreSQL

πŸ“Š User Journey in Walthroh

video_2.mp4

Server Stills

πŸ“‹ Table of Contents

Overview

Lap Machines is a sophisticated file management system that enables rapid file uploads and downloads through a modern web interface. Built with a powerful stack of Go, React with TypeScript, and PostgreSQL, this project demonstrates a production-ready application with containerized deployment capabilities.

⚠️ Important Notice

Mobile Responsiveness: Please note that this application is currently optimized for desktop use only and is not mobile-responsive. Mobile users may experience layout issues or reduced functionality. Contributors are welcome to fork the project and add mobile responsiveness.

🌟 Features

  • Fast File Operations

    • Rapid file uploads with progress tracking
    • Instant downloads with proper content-type handling
    • Multiple file selection support
    • Drag and drop interface
  • Smart Storage Management

    • Automatic file type detection
    • File metadata tracking
    • Storage usage statistics
    • UUID-based file identification
  • Security Features

    • Secure file storage
    • File type validation
    • Size limit enforcement
    • CORS configuration
  • User Interface

    • Clean, modern design
    • Real-time upload progress
    • File type icons
    • Sort and filter capabilities
    • Dark/Light theme support

πŸ”§ Technical Stack

Frontend (Ashyft)

Backend (Go)

  • Go 1.24
  • Standard net/http package
  • PostgreSQL driver
  • File system operations
  • RESTful API design

Database

  • PostgreSQL 14
  • UUID extension
  • Optimized schema design

DevOps

  • Docker & Docker Compose
  • Nginx configuration
  • Environment management
  • Volume persistence

πŸš€ Getting Started

Prerequisites

  1. Install Docker & Docker Compose

    # Verify installations
    docker --version
    docker-compose --version
  2. Ensure ports 5173 (frontend), 8080 (backend), and 5433 (database) are available

  3. At least 1GB of free disk space

Installation Steps

  1. Clone the Repository

    git clone https://github.com/ANSHPG/Lap-Machines.git
    cd Lap-Machines/Production_server
  2. Environment Setup

    # Create .env file in Ashyft directory
    cp Ashyft/.env.example Ashyft/.env
    
    # Update environment variables if needed
  3. Build and Run

    docker-compose up --build
  4. Verify Installation

Configuration

Frontend Configuration

File: Ashyft/.env

VITE_API_URL=http://localhost:8080
VITE_MAX_FILE_SIZE=100000000

Backend Configuration

Environment variables in docker-compose.yml:

DB_HOST=db
DB_USER=postgres
DB_PASSWORD=your_password
DB_NAME=file_manager
PORT=8080

πŸ—οΈ Project Structure

Production_server/
β”œβ”€β”€ Ashyft/                 # Frontend application
β”‚   β”œβ”€β”€ src/               # Source code
β”‚   β”œβ”€β”€ public/           # Static assets
β”‚   └── Dockerfile        # Frontend container
β”œβ”€β”€ Backend/               # Go backend
β”‚   β”œβ”€β”€ main.go          # Entry point
β”‚   └── Dockerfile       # Backend container
β”œβ”€β”€ Postgres/              # Database
β”‚   β”œβ”€β”€ init.sql        # Schema
β”‚   └── file_manager.md # Documentation
└── docker-compose.yml    # Container orchestration

πŸ“¦ Components Deep Dive

Frontend Components

  • File Uploader: Handles file selection and upload
  • File List: Displays uploaded files with metadata
  • Storage Stats: Shows system usage statistics
  • Theme Switcher: Manages application theme

Backend Services

  • File Handler: Processes file operations
  • Database Manager: Handles data persistence
  • Stats Collector: Gathers system statistics

πŸ”Œ API Documentation

Endpoints

GET    /api/files       # List all files
POST   /api/upload     # Upload new file(s)
GET    /api/download   # Download a file
DELETE /api/files/:id  # Delete a file
GET    /api/stats     # Get storage statistics

πŸ—„οΈ Database Schema

CREATE TABLE files (
    file_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
    name TEXT NOT NULL,
    type TEXT NOT NULL,
    size BIGINT NOT NULL,
    location TEXT NOT NULL,
    uploaded_at TIMESTAMP DEFAULT NOW()
);

πŸ› οΈ Development Guide

Local Development Setup

  1. Frontend Development

    cd Ashyft
    npm install
    npm run dev
  2. Backend Development

    cd Backend
    go mod download
    go run main.go
  3. Database Setup

    # See Postgres/file_manager.md for setup instructions

Code Style

  • Frontend: ESLint + Prettier configuration
  • Backend: Go standard formatting
  • SQL: PostgreSQL standard style

πŸš€ Deployment

Production Deployment Steps

  1. Update environment variables
  2. Build images:
    docker-compose build
  3. Deploy:
    docker-compose up -d

Server Requirements

  • 1GB RAM minimum
  • 10GB storage recommended
  • Linux-based OS preferred

πŸ”’ Security Considerations

  1. File validation on upload
  2. Size limitations
  3. Secure file storage
  4. Database security
  5. API rate limiting (recommended)

🀝 Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

Areas for improvement:

  • Mobile responsiveness
  • Additional file type support
  • Enhanced security features
  • Performance optimizations

πŸ“ License

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

πŸ‘€ Author

Anshuman Pattnaik

πŸ’– Support

If you find this project useful, please consider giving it a ⭐️ on GitHub!


Note: For the latest updates and detailed contribution guidelines, please visit the GitHub repository.

About

Lap Machines is a sophisticated file management system that enables rapid file uploads and downloads through a modern web interface. Built with a powerful stack of Go, React with TypeScript, and PostgreSQL, this project demonstrates a production-ready application with containerized deployment capabilities.

Topics

Resources

Stars

Watchers

Forks

Contributors