A modern web application built with Next.js and powered by Turborepo.
This Turborepo includes the following packages/apps:
web: The main Next.js application@repo/ui: Shared React component library using Shadcn/ui@repo/prisma: Database schema and Prisma client@repo/schemas: Shared Zod validation schemas@repo/e2e: End-to-end tests using Playwright@repo/eslint-config: ESLint configurations@repo/typescript-config: Shared TypeScript configurations
Each package/app is 100% TypeScript.
- Framework: Next.js 15 with App Router
- Database: PostgreSQL with Prisma
- Authentication: BetterAuth
- UI: Tailwind CSS + Shadcn/ui
- Testing: Playwright for E2E testing
- Package Manager: pnpm
- Monorepo: Turborepo
- Node.js 18+
- pnpm 9.0.0+
- PostgreSQL
- Clone the repository:
git clone <repository-url>
cd contrilab- Install dependencies:
pnpm install- Set up environment variables:
cp .env.example .env.local
# Fill in your environment variables- Set up the database:
pnpm db:pushTo start the development server:
pnpm devThe application will be available at http://localhost:3000.
pnpm dev # Start development server
pnpm build # Build all packages
pnpm lint # Lint all packages
pnpm check-types # Type check all packages
pnpm format # Format code with Prettierpnpm db:generate # Generate Prisma client
pnpm db:migrate # Run database migrations
pnpm db:push # Push schema to database
pnpm db:studio # Open Prisma Studio
pnpm db:reset # Reset databasepnpm test:e2e # Run all e2e tests
pnpm test:e2e:headed # Run e2e tests with visible browser
pnpm test:e2e:debug # Run e2e tests in debug mode
pnpm test:e2e:ui # Run e2e tests with UI mode
pnpm test:e2e:report # Show test reportThis project uses Playwright for end-to-end testing of authentication flows. Tests are located in packages/e2e/.
- If you don't have Playwright browsers installed globally, install them:
npx playwright install chromium- Start the development server:
pnpm dev- Run tests (in another terminal):
pnpm test:e2eFor more detailed testing documentation, see packages/e2e/README.md.
Tests run automatically in GitHub Actions on:
- Push to
mainordevelopbranches - Pull requests to
mainordevelopbranches
The CI pipeline includes:
- Linting and type checking
- Building the application
- Running e2e tests with a test database
- Uploading test results and artifacts
Tip
Vercel Remote Cache is free for all plans. Get started today at vercel.com.
Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:
cd my-turborepo
# With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)
turbo login
# Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager
npx turbo login
yarn exec turbo login
pnpm exec turbo login
This will authenticate the Turborepo CLI with your Vercel account.
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
# With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)
turbo link
# Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager
npx turbo link
yarn exec turbo link
pnpm exec turbo link
Learn more about the power of Turborepo: