/pmdb

Personal movie database | built with Go, Templ, HTMX, TailwindCSS, and Turso

Primary LanguageGoMIT LicenseMIT

PMDb

PMDb banner

Personal Movie Database

PMDb is your personal space for movies! Here you can rate and review movies you watched and make watchlists for movies you want to watch.

Getting Started

Installation

To get a local environment for this project, you need to have the following installed:

You also need to set up a Turso database.

Usage

After cloning the repo, setting up a database, and installing all dependencies:

  • Copy the contents of .env.example into .env then supply DBURL and DBTOKEN according to your database instance
cp ~/.env.example .env
  • Execute the database migrations via Goose in the ./sql/schema directory
goose turso "libsql://[DATABASE].turso.io?authToken=[TOKEN]" up
  • Compile the Tailwind CSS by running the tw-build NPM script. If you want to run the Tailwind watcher, you'll have to run the tw-watch script in a separate terminal.
npm run tw-build
  • Run air (at the project root) which will compile and auto-reload the Go server and Templ components.
air

Tech Stack

Technologies:

  • Go: backend
  • Templ: templating
  • TailwindCSS: styling Go templates
  • HTMX: UI interactivity
  • Turso: database
  • Goose: SQL migration tool
  • SQLC: SQL-to-Go code generation tool
  • Air: live reloading

External resources:

Architectural Design

The backend is built as a set of loosely coupled services as displayed in this chart.

chart

Contributing

This project is still a work in progress and mainly for learning purposes, so for now I only accept issues for pointing out bugs or feature suggestions. Thanks!