Skip to content

Getting Started

gurshan edited this page Jun 6, 2024 · 11 revisions

Setup

Cloning the Repository

Install git and clone the repo:

git clone https://github.com/SCE-Development/spartan-compass/

For Mac, Linux, or WSL Users

  • I recommend using bun since it's a lot faster than node/npm

  • Install Bun with this command:

curl -fsSL https://bun.sh/install | bash

For Windows Users

powershell -c "irm bun.sh/install.ps1|iex"

Running the Database

  1. Install docker:
  1. Start the local database with:
bun run db:dev

# or, if you're not using bun
npm run db:dev

Setting up Environment Variables

To connect to the local database instance, you need to create a .env file with the appropriate DATABASE_URL.

  1. Copy the .env.example file:
cp .env.example .env
  1. Open the .env file and update the DATABASE_URL value to point to your local database instance:
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres

Warning

Only do the third step after the Tutorial - Implementing a Complete Feature

  1. Generate and run our database migrations on our local db and optionally seed it for sample data
bun run db:generate
bun run db:migrate
bun run db:seed

Running the Application

To start the application, you first need to install the dependencies with:

bun install

# or, if you're not using bun
npm install

Then, start the application with:

bun dev

# or, if you're not using bun
npm run dev

Congrats! If you reached this step everything should be working. If you had any issues feel free to post them in the dev team channel

At this point, you should move on to Tutorial - Implementing a Complete Feature