Skip to content

aberonni/improvdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImprovDB

This is a T3 Stack project bootstrapped with create-t3-app. The project is deployed at improvdb.com.

Tech Stack

Local development

Prerequisites

  • A Postgres database URL (you can get one for free at Planet Scale or use the docker compose file to run Postgres locally)
  • Google authentication credentials - Read more
  • (Optional) A free Upstash redis URL

Setup

cp .env.example .env
# edit the `.env` file with your configuration details, and then
npm install

Local Postgres database

You must have docker installed for this to work. You can use a local Postgres database with the following commands

docker compose -f docker-compose.postgres.yml up
# Wait for postgres server to be ready, then run
npx prisma db push
npx prisma db seed

Then you can just update your .env file with DATABASE_URL=postgres://improvdb_user:[email protected]:5432/improvdb_db.

If you ever need to reset the database, you have two options:

1. Soft reset

npx prisma db push --force-reset
npx prisma db seed

2. Hard reset

Run the following command to destroy the volumes associated with the postgres database, and then start again from scratch.

docker-compose -f docker-compose.postgres.yml down -v

Running the project

As simple as

npm run dev

You can also run prisma studio with the following command:

npx prisma studio

Running E2E tests locally

To be able to run all tests properly, you must have docker installed. That's because we want to use the same docker container that is used in CI, ensuring that there aren't differences when doing screenshot / visual regression testing.

You must also make sure that you are using a freshly seeded local Postgres database.

Build the image

docker compose -f docker-compose.playwright.yml build

Run the tests

docker compose -f docker-compose.playwright.yml run --rm playwright npx playwright test

Update screenshots

docker compose -f docker-compose.playwright.yml run --rm playwright npx playwright test --update-snapshots

Run E2E tests without docker

You can alternatively run a test directly without docker, skipping the screenshot comparison functionality altogether.

You can do this with the command:

SKIP_SCREENSHOT_COMPARISON=1 npx playwright test

Updating seed data

While connected to a production/staging database, run the following:

npx tsx prisma/updateSeedData.ts

This will pull all resources and all public lesson plans into the seedData.json file in the git repository.

Learn More about T3

To learn more about the T3 Stack, take a look at the following resources:

You can check out the create-t3-app GitHub repository

Contributing

Contributions are welcome! The best place to start is by opening an issue.

About

The open-source database for improv games and lesson plans

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •