Database setup
Create the database
If you installed PostgreSQL locally and didn’t create a database yet:Then in the PostgreSQL prompt:
Create the schema
The application uses Drizzle ORM with the schema defined in Alternatively, create the tables manually using SQL:
db/schema.ts. You’ll need to create the tables manually or use Drizzle Kit to generate and run migrations.Since the project includes drizzle-kit as a dev dependency, you can push the schema directly:Configure the connection string
Set the See the Environment variables page for more details.
NUXT_APP_POSTGRES_URL environment variable with your database connection string:Database schema
The application uses two main tables:VODs table
Stores Twitch VOD information and transcripts for search functionality.Primary key. The Twitch VOD identifier.
The title of the VOD stream.
When the stream occurred.
URL to the Twitch VOD.
URL to the VOD thumbnail image.
Number of views the VOD has received.
Intended or scheduled online date for the stream.
Duration of the VOD in seconds.
JSON transcript data for search and indexing purposes.
Alerts table
Stores site-wide alerts and notifications.Primary key. Auto-incrementing identifier.
The alert title or heading.
The alert message content.
Whether the alert is currently active and should be displayed.
When the alert was created. Defaults to current timestamp.
Database connection
The application uses Drizzle ORM with the Postgres.js driver. The connection is configured inserver/db.ts: