Internal HR Employee management hub.
This project is built with Next.js, Supabase, and Prisma. Follow the instructions below to get started with local development.
- Prerequisites
- Initial Setup
- Development Workflow
- Best Practices
- Useful Resources
- Troubleshooting
- Getting Help
- git
- Node.js
- npm (installed with Node)
- Docker
- Supabase CLI
git clone <repository-url>
cd <project-directory>npm installFollow the Supabase CLI installation guide for your operating system.
supabase startThis will spin up all Supabase services in Docker containers. Once complete, you'll see output with access credentials and URLs.
Important URLs:
- Supabase Studio Dashboard: http://localhost:54323
- API URL: http://localhost:54321
- Database: See the output of
supabase start!
Keep these credentials handy, as you'll need them for your environment variables.
Copy .env.sample to .env file in the project root:
cp .env.example .envUpdate the file with your local Supabase credentials from the supabase start output:
NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321 # API URL
NEXT_PUBLIC_SUPABASE_ANON_KEY=<your-anon-key> # anon key
DATABASE_URL=postgresql://postgres:[email protected]:54322/postgres # DB URL
# ...Generate the Prisma client and push the schema to your local database:
npm run db:generate
npm run db:pushHelpful Prisma tools:
- View your database schema:
npx prisma studio(opens at http://localhost:5555) - See the Prisma Schema Explorer for reference
npm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 in your browser.
-
Create a new branch for your work:
git checkout -b feature/your-feature-name
-
Make your changes and test locally
-
Format and lint your code before committing (see Best Practices below)
When modifying the Prisma schema (prisma/schema.prisma):
# Push changes to local database
npm run db:push
# Seed database with initial data (if applicable)
npm run db:seed
# Regenerate Prisma Client
npm run db:generateFor production, create a migration:
npm run db:migrateSupabase captures emails sent in a Mailpit instance, accessible via the Inbucket URL from
supabase status.
When you're done developing:
# Stop Supabase services
supabase stop-
Check for linting errors:
npm run lint
-
Format code with Prettier before committing:
npm run format
- Work on feature branches, never directly on
main - Write concise but descriptive commit messages in present tense:
- ✅ Good:
Add user authentication flow - ✅ Good:
Fix navigation menu on mobile - ❌ Avoid:
Added stufforFixed things
- ✅ Good:
- Keep commits focused on a single logical change so we can revert changes easily!
- Ensure your code is formatted and passes linting
- Test your changes locally
- Push your branch and create a pull request
- Provide a clear description of your changes in the PR
We use daisyUI for consistent styling. Check their component library before creating custom styles to keep our UI uniform.
- Next.js Documentation
- Supabase Documentation
- Supabase CLI Reference
- Prisma Documentation
- daisyUI Reference
- Ensure Docker Desktop is running
- Check that ports 54321-54323 aren't already in use
- Try
supabase stopfollowed bysupabase start
- Run
npx prisma generateto regenerate the client - Ensure your
DATABASE_URLin.envis correct
- Delete
node_modulesand lock file, then reinstall dependencies - Clear Next.js cache:
rm -rf .next
If you encounter issues not covered here, please:
- Review the documentation links above
- Check with our project director/tech lead