← Projectsrunning app

EncoreConcert Diary

A personal concert diary built for a university databases course: log shows, rate them, see your stats and what the community has seen.

live at encore.apps.ravicorrie.comrunning app
Type
running app
Status
Live at encore.apps.ravicorrie.com
Source
github.com/rcorrie325/git-to-website
Stack
databases · postgresql · react
Likes
0

Encore is a personal concert diary. You log the shows you've been to (artist, venue, city, date, a 1–5 star rating and notes) and Encore builds your live-music history around them: a dashboard with your total concerts, unique artists, countries and average rating; a filterable history (by year, country, rating, or a search on artist and venue); and a community Discover feed that shows what other members have seen recently.

It started as my project for a university databases course. I first built it as a locally hosted database web app, then moved it to Lovable with Supabase (hosted Postgres, auth and Row Level Security). It's now fully self-hosted on this server, with its own PostgreSQL database and a small Express API. All the original data came along, with IDs intact.

Try it: open the app and click Get started. You get a private sandbox account right away, filled with sample concerts so the dashboard and filters have something to show. Nobody else can see it, and it's deleted automatically after 24 hours.

Tech stack

  • Frontend: React 18, TypeScript, Vite, React Router, TanStack Query, Tailwind CSS, shadcn/ui, Zod
  • API: Node.js 22, Express 5, pg (hand-written SQL, no ORM), bcrypt password hashing, server-side sessions in an httpOnly cookie
  • Database: PostgreSQL 16, in its own container and volume with SQL migrations applied at startup
  • Hosting: Docker (multi-stage build, non-root), behind Caddy with automatic HTTPS. One Node process serves both the built SPA and /api.

Database schema

Six tables. The original Supabase auth.users table became a local users table, and everything else kept its original structure.

users: accounts

Column Type Notes
id uuid PK, gen_random_uuid()
email text unique on lower(email); NULL for guest sandboxes
password_hash text bcrypt; NULL for guests
is_guest boolean default false
created_at timestamptz default now()

CHECK: a non-guest must have both an email and a password hash.

sessions: server-side logins

Column Type Notes
token_hash text PK, SHA-256 of the cookie token (the raw token is never stored)
user_id uuid FK → users(id), on delete cascade
created_at timestamptz default now()
expires_at timestamptz indexed for cleanup

profiles: display names, one per user

Column Type Notes
id uuid PK
user_id uuid FK → users(id), unique, on delete cascade
first_name, last_name, nickname text optional
created_at, updated_at timestamptz updated_at maintained by a BEFORE UPDATE trigger

artists: shared artist catalogue

Column Type Notes
id uuid PK
name text NOT NULL, indexed on lower(name) for search
country, image_url, spotify_id text optional
created_by uuid FK → users(id), on delete set null
created_at timestamptz default now()

artist_genres: genres per artist

Column Type Notes
id uuid PK
artist_id uuid FK → artists(id), on delete cascade
genre text NOT NULL; UNIQUE (artist_id, genre)

user_artist_tracking: concerts attended

Column Type Notes
id uuid PK
user_id uuid FK → users(id) and FK → profiles(user_id), both on delete cascade
artist_id uuid FK → artists(id), on delete cascade
venue, city, country text NOT NULL
concert_date date NOT NULL; indexed with user_id for history queries
rating integer CHECK 1–5
notes text optional
created_at, updated_at timestamptz updated_at maintained by a trigger

Relationships

users 1 ── 0..1 profiles               (profiles.user_id, unique)
users 1 ── *    sessions               (sessions.user_id)
users 1 ── *    user_artist_tracking   (user_artist_tracking.user_id)
users 0..1 ── * artists                (artists.created_by)
artists 1 ── *  artist_genres          (artist_genres.artist_id)
artists 1 ── *  user_artist_tracking   (user_artist_tracking.artist_id)

user_artist_tracking is the many-to-many link between users and artists. Each row is one concert, with its own attributes (venue, date, rating, notes).

Comments (0)

Log in or sign up to comment.