- 🔐 Secure site creation and management
- 📤 File upload to GitHub repository
- 📥 File download with authentication
- 🔑 JWT-based authentication
- 🗄️ PostgreSQL database integration
- 🚀 RESTful API endpoints
- Go 1.20 or higher
- PostgreSQL database (Neon DB)
- GitHub Account with Personal Access Token
The following environment variables are required in .env:
DATABASE_URL="your_neon_db_url"
GITHUB_TOKEN="your_github_token"-
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
POST /upload/:site_name- Upload a file (multipart/form-data)GET /getfile/:id- Download a file (requires auth token)
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