Skip to content

A modern, full-stack monorepo starter template built with Next.js, NestJS, and Prisma. Features TypeScript, shadcn/ui components, PNPM workspaces, and comprehensive development tooling. Perfect for building scalable web applications with a shared component library and type-safe database access.

Notifications You must be signed in to change notification settings

tomikng/ts-fullstack-monorepo-starter

Repository files navigation

Fullstack Monorepo Starter

This is a monorepo for Fullstack Monorepo Starter project containing both frontend and backend applications, along with shared packages.

Project Structure

fullstack-monorepo-starter/
├── apps/
│   ├── web/           # Next.js frontend application
│   └── backend/       # NestJS backend application
│
├── packages/
│   ├── ui/            # Shared UI components
│   ├── database/      # Database schema and utilities
│   ├── config/        # Shared configuration
│   ├── eslint-config/ # ESLint configuration
│   └── typescript-config/ # TypeScript configuration

Prerequisites

  • Node.js (v18 or higher)
  • PNPM package manager
  • PostgreSQL database

Quick Start

  1. Install dependencies:
pnpm install
  1. Set up environment variables:
cp apps/backend/.env.example apps/backend/.env
  1. Generate Prisma client (required before starting the application):
pnpm prisma:generate
  1. Run database migrations:
pnpm db:migrate:dev
  1. Start all applications in development mode:
pnpm dev

This will start:

Applications

Frontend (Web)

The web application is built with Next.js and uses shadcn/ui components. View Web Application Documentation

Backend

The backend service is built with NestJS and uses Prisma as the ORM. View Backend Documentation

Package Management

This project uses PNPM workspaces. To add dependencies:

  1. Add a dependency to a specific app:
pnpm add <package> --filter <app-name>
  1. Add a shared dependency to the root:
pnpm add -w <package>
  1. Add a development dependency:
pnpm add -Dw <package>

Development Workflow

  1. Start all services:
pnpm dev
  1. Run tests across all packages:
pnpm test
  1. Build all packages:
pnpm build
  1. Lint all packages:
pnpm lint

Adding New Features

Frontend

  • Follow the Web Application Guide for adding new pages and components
  • Use shadcn components from the shared UI package
  • Follow the established styling patterns with Tailwind CSS

Backend

  • Follow the Backend Guide for adding new modules and endpoints
  • Use Prisma for database operations
  • Document new endpoints with Swagger decorators

Best Practices

  1. Code Style

    • Follow TypeScript best practices
    • Use ESLint and Prettier configurations
    • Write meaningful commit messages
  2. Testing

    • Write unit tests for new features
    • Ensure E2E tests pass before merging
    • Maintain good test coverage
  3. Documentation

    • Update README files when adding new features
    • Document API endpoints with Swagger
    • Keep component documentation up to date

Troubleshooting

Common issues and solutions can be found in the respective application READMEs:

Contributing

  1. Create a new branch for your feature
  2. Make your changes
  3. Run tests and linting
  4. Submit a pull request
  5. Ensure CI checks pass

Contact

For any questions, concerns, or bug reports, please feel free to contact:

License

This project is MIT licensed.

About

A modern, full-stack monorepo starter template built with Next.js, NestJS, and Prisma. Features TypeScript, shadcn/ui components, PNPM workspaces, and comprehensive development tooling. Perfect for building scalable web applications with a shared component library and type-safe database access.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published