List App
A web application for managing and organizing lists of movies, series, and games. The app allows users to add and view media items, with support for sorting and filtering.
Features
- Media Management: Add and view movies, series, and games
- Sorting Options: Sort by title, year, or date added
- Image Caching: Automatically downloads and caches poster images
- Authentication: Password-protected for adding media
- Responsive Design: Works on mobile and desktop devices
- No client-side JavaScript: Pages are fully rendered server-side; the only script on the page is Bootstrap's own bundle (for the collapsible nav/dropdown), not anything authored by this app
Technologies
- Backend: Go, standard library
net/httpandhtml/template,modernc.org/sqlite(pure Go, cgo-free) - Database: SQLite
- APIs: OMDB API (movies/series), Twitch IGDB API (games)
Project Structure
list_app/
├── controllers/ # Business logic (OMDB/IGDB lookups, poster downloads)
├── models/ # Database models
├── routes/ # Route registration
├── web/ # Server-rendered page + HTML form handling
│ ├── page.html # Go html/template for the page
│ ├── page.go # Grouping/sorting logic, GET / and POST /add handlers
│ └── templates.go # go:embed for page.html
├── db/ # DB connection and schema
├── main.go # Main server entry
│
├── public/ # Static assets, embedded into the Go binary
│ ├── embed.go # go:embed directive
│ ├── logo.ico # Favicon
│ └── no_poster.jpg # Fallback poster image
│
├── go.mod # Go module
└── README.md # This file
Setup
- Install Go: https://go.dev/
- Set up your API keys in the database:
- OMDB API key for movies/series
- Twitch client ID and secret for games
Routes
GET /- Renders the media list page. Query params:listType(movies,series,games; defaults tomovies) andsortType(title,year,id; defaults totitle)POST /add- Plain HTML form submission to add media (pass,code, plus hiddenlistType/sortTypeto redirect back to the right view). Always redirects back to/with?error=...set on failureGET /api/media/:mediaType- JSON listing of all media of a type (movies, series, games); not used by the page itself, kept as a small read-only API
There is no delete endpoint or UI — removing media isn't supported; use sqlite3 mydb.sqlite directly if you need to remove an entry.
Configuration
The application uses SQLite for data storage. The database file mydb.sqlite will be created automatically on first run with the following tables:
movies- Stores movie informationseries- Stores series informationgames- Stores game informationuserData- Stores configuration including API keys and password
The compiled binary is self-contained: logo.ico and no_poster.jpg are embedded into it via public/embed.go, and the page markup lives in a Go html/template embedded via web/templates.go — so only the binary (plus the SQLite file) needs to be deployed. Poster images are fetched from OMDB/IGDB at runtime and can't be embedded, so they're cached on disk under a posters/ directory created next to wherever the binary runs, and served at /poster/.... Whether a poster has actually downloaded yet is checked server-side on each page render — if it's missing, the fallback image is used directly in the rendered <img src>, so no client-side JS is needed for that either.
Usage
- Navigate to
http://localhost:4080in your browser - Use the navigation links to switch between movies, series, and games
- Use the "Sort" dropdown to change sorting method
- Enter your password and media ID in the form and submit to add new items
Building
To build the binary at output/app:
./build.sh