2026-01-24 18:09:24 +01:00
2026-01-23 22:34:50 +01:00
2026-01-24 18:09:24 +01:00
2026-01-24 18:09:24 +01:00
2026-01-23 22:34:50 +01:00
2026-01-23 19:56:39 +01:00
2026-01-23 22:53:08 +01:00
2026-01-23 19:57:03 +01:00

Sheetless Server

A Go-based server for hosting and managing PDF music sheets with user authentication.

Features

  • User registration and JWT-based authentication
  • Upload, list, and download PDF music sheets
  • SQLite database for data persistence
  • RESTful API with Gin framework

API Endpoints

Authentication

  • POST /auth/register - Register a new user
  • POST /auth/login - Login and get JWT token

Music Sheets (requires authentication)

  • POST /api/sheets/upload - Upload a PDF music sheet
  • GET /api/sheets - List all music sheets
  • GET /api/sheets/download/:id - Download a specific sheet

Development Setup

  1. Enter the development environment:

    nix develop
    
  2. Download dependencies:

    go mod tidy
    
  3. Run the server:

    go run main.go
    

Building

To build the project:

go build -o sheetless-server main.go

Usage Examples

Register a user:

curl -X POST http://localhost:8080/auth/register \
  -H "Content-Type: application/json" \
  -d '{"username":"testuser","email":"test@example.com","password":"password123"}'

Login:

curl -X POST http://localhost:8080/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"testuser","password":"password123"}'

Upload a sheet (replace TOKEN with actual JWT):

curl -X POST http://localhost:8080/api/sheets/upload \
  -H "Authorization: Bearer TOKEN" \
  -F "title=My Sheet" \
  -F "file=@sheet.pdf"

List sheets:

curl -H "Authorization: Bearer TOKEN" http://localhost:8080/api/sheets
Description
No description provided
Readme 10 MiB
Languages
Go 90.4%
Nix 7.5%
Dockerfile 2.1%