Skip to content

Repository files navigation

Feedback

File sharing and commenting application built with Go.

Warning

This project is a complete vibe-coded hellhole of garbage. Read code at your own caution. Redirect frustration at Anthropic.

Features

  • Admin panel for creating shares and uploading files
  • Public share links with commenting functionality
  • Image viewing in fullscreen modal
  • Clean, Nextcloud-inspired design
  • Mobile responsive layout
  • SQLite database with WAL mode
  • Docker deployment ready

Quick Start

Local Development

  1. Install dependencies:
go mod download
npm install
  1. Create .env file:
cp .env.example .env
# Edit .env and set secure values for ADMIN_TOKEN and SESSION_SECRET
  1. Build Tailwind CSS:
npx tailwindcss -i web/static/css/input.css -o web/static/css/output.css --watch
  1. Run the application:
go run cmd/feedback/main.go
  1. Access admin panel:
http://localhost:8080/admin/{ADMIN_TOKEN}

Docker

Build and run with Docker:

docker build -t feedback:latest .
docker run -p 8080:8080 \
  -v $(pwd)/data:/data \
  -e ADMIN_TOKEN=your-secure-token \
  -e SESSION_SECRET=your-secure-secret \
  feedback:latest

Or use Docker Compose:

# Create .env file with ADMIN_TOKEN and SESSION_SECRET
docker-compose up

Configuration

Environment variables:

Variable Description Default
PORT Server port 8080
HOST Server host 0.0.0.0
ADMIN_TOKEN Admin authentication token (required) -
SESSION_SECRET Cookie signing secret (required) -
DATA_DIR Data storage directory ./data
MAX_UPLOAD_SIZE Max upload size in bytes 52428800 (50MB)
DB_PATH SQLite database path ./data/feedback.db

Usage

Admin Workflow

  1. Access admin panel at /admin/{ADMIN_TOKEN}
  2. Create a new share with name and description
  3. Upload files to the share
  4. Copy the public share link (/share/{hash})
  5. Share the link with users

User Workflow

  1. Access public share via /share/{hash}
  2. Enter your name (stored in cookie)
  3. View files and images
  4. Click images to view in fullscreen modal
  5. Post comments on files
  6. See comments from other users in real-time

Project Structure

feedback/
├── cmd/feedback/          # Application entrypoint
├── internal/              # Internal packages
│   ├── config/           # Configuration loading
│   ├── database/         # Database models and migrations
│   ├── handlers/         # HTTP handlers
│   ├── middleware/       # HTTP middleware
│   └── services/         # Business logic
├── web/                  # Frontend assets
│   ├── static/          # Static files (CSS, JS)
│   └── templates/       # HTML templates
├── data/                # Runtime data (gitignored)
├── Dockerfile           # Container build
└── docker-compose.yml   # Local development

Development

Build Production Binary

CGO_ENABLED=1 go build -o feedback cmd/feedback/main.go

Build Tailwind CSS for Production

npx tailwindcss -i web/static/css/input.css -o web/static/css/output.css --minify

Run Tests

go test ./...

Deployment

GitHub Container Registry

Push a semver tag (no v-prefix) to trigger automated build:

git tag 1.0.0
git push origin 1.0.0

The GitHub Actions workflow will:

  • Build Docker image for amd64 and arm64
  • Push to ghcr.io/romanzipp/feedback:{version}
  • Tag as latest

Pull and run:

docker pull ghcr.io/romanzipp/feedback:latest
docker run -p 8080:8080 \
  -v /path/to/data:/data \
  -e ADMIN_TOKEN=xxx \
  -e SESSION_SECRET=xxx \
  ghcr.io/romanzipp/feedback:latest

Where I (Claude) fucked up

  • Template system disaster: Created nested template structure that completely broke, causing admin panel to show "Enter Your Name" form. Had to rebuild all templates as self-contained files.
  • Sequential file IDs: Initially used /files/3 allowing anyone to enumerate all files. Fixed by adding random hashes.
  • URL-unsafe admin tokens: Generated tokens with / characters causing 404s. Fixed by using URL-safe base64 encoding.
  • Missing database directory: SQLite failed to create DB file because parent directory wasn't created first.
  • Destroyed image aspect ratios: Used object-cover with fixed height, squashing images. Fixed with object-fit: contain.
  • Inconsistent comment styling: JavaScript-inserted comments had different font sizes than server-rendered ones.
  • Go version mismatch: Dockerfile used Go 1.22 when go.mod required 1.24+.
  • Unwanted multi-arch builds: Built for arm64 when only amd64 was requested.

License

MIT

About

File sharing and commenting application built with Go.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages