Skip to content

kunal697/filesharingcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileShare

filesharingcli

Features

  • 🔐 Secure site creation and management
  • 📤 File upload to GitHub repository
  • 📥 File download with authentication
  • 🔑 JWT-based authentication
  • 🗄️ PostgreSQL database integration
  • 🚀 RESTful API endpoints

Prerequisites

  • Go 1.20 or higher
  • PostgreSQL database (Neon DB)
  • GitHub Account with Personal Access Token

Environment Variables

The following environment variables are required in .env:

DATABASE_URL="your_neon_db_url"
GITHUB_TOKEN="your_github_token"

API Endpoints

Sites

  • POST /createsite - Create a new site

    {
      "site_name": "your_site_name",
      "password": "your_password"
    }
  • GET /site/:site_name?password=site_password - Get site details and files

  • GET /sites - List all sites

Files

  • POST /upload/:site_name - Upload a file (multipart/form-data)
  • GET /getfile/:id - Download a file (requires auth token)

Project Structure

Filesharing/
├── internal/
│   ├── db/         # Database connection and models
│   ├── handlers/   # Request handlers
│   ├── models/     # Data models
│   ├── routes/     # API routes
│   └── utils/      # Utility functions
├── .env            # Environment variables
├── .gitignore
├── go.mod
└── main.go

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages