Skip to content

yideshare/yideshare-web

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Dev server and DB setup

First, run the development server with following commands in coding IDE or local terminal:

(first-time to install package dependencies)

npm install

Ensure your .env file includes the following variables for local dev:

  • NODE_ENV=development
  • JWT_SECRET="test_jwt_secret"
  • POSTGRES_DB=<come up with your db name>
  • POSTGRES_PASSWORD=<come up with your password
  • DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?schema=public
  • DIRECT_URL=postgresql://postgres:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?schema=public
  • CAS_BASE_URL="https://secure-tst.its.yale.edu/cas"
  • YALIES_API_KEY=<ask admin team>

Build and start the Docker container:

docker compose up -d

Sync with latest db changes or create if no db:

npx prisma db push

Runs dev server on port 3000

npm run dev

Open http://localhost:3000 with your browser to see the result.

To stop all running containers:

docker compose down

Helpful DB Commands:

Seed local DB:

npx prisma db seed

Inspect local DB:

npx prisma studio

Stop the containers AND delete all database data (useful for a clean restart):

docker-compose down -v

Using Playwright:

First, install Playwright browsers (only needed once after installing Playwright):

npx playwright install

Then navigate to testing folder:

cd playwright-tests

Run tests:

UI mode (recommended)

npx playwright test --ui

No UI

npx playwright test

For detailed Playwright testing instructions, see playwright-tests/README.md

Learn More

To learn more about Next.js, take a look at the following resources:

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9