Skip to content

Add Postgres migration + seed pipeline with env template#1

Open
Jakebhudson wants to merge 3 commits intoFarrisBaboo:mainfrom
Jakebhudson:main
Open

Add Postgres migration + seed pipeline with env template#1
Jakebhudson wants to merge 3 commits intoFarrisBaboo:mainfrom
Jakebhudson:main

Conversation

@Jakebhudson
Copy link

This PR sets up a Postgres migration + seed pipeline for the backend prototype:

Database migration script (scripts/migrate.js) and initial schema (migrations/001_init.sql)

Seeding script (scripts/seedFromJson.js) to import the mock dataset into Postgres (≈8000 rows)

Updated repositories to load .env correctly with absolute paths

Added .env.example so team members can easily configure their local environment

Updated package.json scripts:

npm run migrate → run migrations

npm run seed → seed data from JSON

npm run dev → start server

How to run locally

  1. Copy .env.example to .env and update values if needed.
  2. Start Postgres (brew services start postgresql@16).
  3. Run migration: npm run migrate
  4. Seed database: npm run seed
  5. Start server: npm run dev
  6. Test endpoints:
    • GET http://localhost:3000/api/streams
    • GET http://localhost:3000/api/stream-names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments