Source code for the app.
-
# Install Node.js first npm i -g pnpm
-
Create the file
.env.local
.- Copy the
.env.example
file and update the variables. - Or ask @mauriciabad for the file.
- Copy the
-
Install the project's dependencies:
pnpm i
-
Run development server:
pnpm dev
-
Open http://localhost:3000 with your browser.
By default, the app will connect to stage database in PlanetScale, but you can run it locally too.
-
Install docker.
-
Run the database in another console:
pnpm db:local:run-db
-
(Optional) Generate migrations if necessary:
pnpm db:generate
-
Run database migrations:
pnpm db:local:migrate
-
Run the app:
pnpm db:local:run-app
-
(Optional) Visualize the data with Drizzle Studio in another console:
pnpm db:local:studio
- Make the changes in your code, testing them with the local database.
- Run
pnpm db:generate
to generate the migrations. - Run
pnpm db:push
to upload the migrations to PlanetScale stage branch.- Only 1 branch can be pushed to PlanetScale at a time, if there were contents from another change they will be overridden. This is because we use the PlanetScale free tier.
- Run the GitHub's CI after the stage database is updated, by pushing a commit or running it manually.
- GitHub's CI is configured to run on stage database, so it will catch any error.
- Right before merging the PR, go to PlanetScale dashboard and create a deploy preview and deploy it.
- Merge the PR in GitHub.
Ask @mauriciabad for access.
These are the services we use related to the code: