Skip to content

Repository files navigation

Contrilab

A modern web application built with Next.js and powered by Turborepo.

What's inside?

This Turborepo includes the following packages/apps:

Apps and Packages

  • 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.

Technology Stack

Getting Started

Prerequisites

  • Node.js 18+
  • pnpm 9.0.0+
  • PostgreSQL

Installation

  1. Clone the repository:
git clone <repository-url>
cd contrilab
  1. Install dependencies:
pnpm install
  1. Set up environment variables:
cp .env.example .env.local
# Fill in your environment variables
  1. Set up the database:
pnpm db:push

Development

To start the development server:

pnpm dev

The application will be available at http://localhost:3000.

Scripts

Development

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 Prettier

Database

pnpm 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 database

Testing

pnpm 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 report

Testing

This project uses Playwright for end-to-end testing of authentication flows. Tests are located in packages/e2e/.

Running Tests Locally

  1. If you don't have Playwright browsers installed globally, install them:
npx playwright install chromium
  1. Start the development server:
pnpm dev
  1. Run tests (in another terminal):
pnpm test:e2e

For more detailed testing documentation, see packages/e2e/README.md.

CI/CD

Tests run automatically in GitHub Actions on:

  • Push to main or develop branches
  • Pull requests to main or develop branches

The CI pipeline includes:

  • Linting and type checking
  • Building the application
  • Running e2e tests with a test database
  • Uploading test results and artifacts

Remote Caching

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

Useful Links

Learn more about the power of Turborepo:

Contrilab

About

One stop destination for all things open source (Mirror of https://github.com/Contri-lab/)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages