tumillanino 7af9d9f8a4 add readme
2025-10-28 12:31:29 +11:00
2025-10-28 12:31:29 +11:00

How To

Authentication Setup (Ory)

Prerequisites

  1. Copy .env.example to .env and configure:
    • PORT=3000 (your app port)
    • TUNNEL_PORT=4000 (Ory tunnel port)

Running the Application with Ory

  1. Start the database and services:
docker-compose up
  1. Apply the Ory identity migration:
docker exec -i $(docker ps -q -f name=db) psql -U party -d partydb < migrations/010_add_ory_identity_id.sql
  1. In one terminal, start your Go server:
go run cmd/server/main.go
  1. In another terminal, start the Ory tunnel:
npx @ory/cli tunnel --dev http://localhost:3000
  1. Access your app through the tunnel URL (typically http://localhost:4000)

How It Works

  • Users authenticate through Ory's hosted UI
  • On first login, a user record is created in your database with their Ory identity ID
  • Protected routes (/profile, /api/bookings) require authentication
  • User context is available in handlers via auth.GetUser(r.Context())

Amending postgres table

docker exec -i $(docker ps -q -f name=db) psql -U party -d partydb < migrations/002_add_service_image_url.sql

Entering Postgres CLI

docker exec -it $(docker ps -q -f name=db) psql -U party -d partydb

Run Ory in Docker

docker run --rm -it oryd/ory help
Description
No description provided
Readme 11 MiB
Languages
Go 65.3%
CSS 28.9%
JavaScript 4.4%
Shell 1.4%