Install git and clone the repo:
git clone https://github.com/SCE-Development/spartan-compass/
- Install Docker:
If you are going to do the tutorial in the wiki, finish the tutorial before proceeding with steps 2 - 7
cp .env.example .env
bun run db:start
bun run db:generate
(This command is only needed when database schema changes are made)bun run db:migrate
bun run db:seed
Run bun run db:studio
to access the database at http://local.drizzle.studio
Warning
If you need to, never delete the files themselves as this will mess with Drizzle. You should instead run:
bun run db:drop
bun install
Run bun dev
to start the dev server at http://localhost:3000
The production compose file consists of the following parts ran in this order:
- db - postgres container
- migrator - runs drizzle migrator and can be manually used to scrape data
- app - the actual app container that runs nextjs
To start:
docker compose -f docker/compose.prod.yml up
To manually run the scraper once:
docker compose -f docker/compose.prod.yml run migrator bun run db:insert:bun
For reference, see .env.example
Production requires the following changes:
DATABASE_URL
needs to be set to the postgres container instead of localhostNEXT_PUBLIC_SITE_URL
needs to be set tohttps://{domain}