Rainbow Locator - Local Development Guide
Rainbow Locator is a centralized Lost and Found web application for the University of Hawaiʻi at Mānoa. This guide provides instructions for setting up the development environment on your local machine.
Prerequisites
Ensure you have the following installed:
- Node.js (v20 or higher recommended)
- PostgreSQL (Running locally or accessible via network)
Installation
- Clone the repository:
git clone https://github.com/pacifcbytes/rainbow-locator.git cd rainbow-locator - Install dependencies:
npm install
Environment Setup
- Create a
.envfile: Copy the providedsample.envto a new file named.env.cp sample.env .env - Configure your environment variables:
Open
.envand update the following:DATABASE_URL: Your PostgreSQL connection string.AUTH_SECRET: A secure random string for NextAuth (you can generate one withopenssl rand -base64 32).AUTH_URL: Set tohttp://localhost:3000for local development.
Database Setup (Prisma)
This project uses Prisma ORM. Follow these steps to initialize your database:
- Generate the Prisma Client:
npx prisma generate - Push the schema to your database:
npx prisma db push - Seed the database:
Run the seed script to populate the database with initial data:
npm run seed
Running the Application
Start the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
Available Scripts
npm run dev: Runs the app in development mode.npm run build: Builds the app for production.npm run start: Starts the production server.npm run lint: Runs ESLint to check for code quality issues.npm run seed: Seeds the database usingsrc/seed.ts.npm run playwright: Runs end-to-end tests.
Testing
We use Playwright for end-to-end testing.
- Install Playwright browsers:
npx playwright install - Run tests:
npm run playwright