A modern chat application built with Next.js, tRPC, and Socket.IO in a Turborepo monorepo.
This project is a full-featured chat application with real-time messaging capabilities. It utilizes a monorepo structure with Turborepo to manage multiple applications and shared packages.
This Turborepo includes the following apps and packages:
web: A Next.js 15 application with a modern UI built using Radix UI, Tailwind CSS, and React 19. This is the main client interface for the chat application.socket: A Socket.IO server for handling real-time communication. Built with Express and runs with tsx.
@repo/api: tRPC API definitions shared between client and server@repo/auth: Authentication utilities using NextAuth.js@repo/database: Database client and schema definitions using Drizzle ORM with PostgreSQL@repo/typescript-config: Shared TypeScript configurations
- Frontend: Next.js 15, React 19, TailwindCSS, Radix UI
- API: tRPC 11 with React Query
- Real-time Communication: Socket.IO
- Database: PostgreSQL with Drizzle ORM
- Authentication: NextAuth.js
- Build Tools: Turborepo, pnpm
- Code Quality: Biome for formatting and linting
- Languages: TypeScript
- Node.js v18 or later
- pnpm v9.0.0 or later
- PostgreSQL
- Clone the repository
- Install dependencies:
pnpm install
- Set up your environment variables:
cp .env.example .env
Then edit .env with your configuration details.
- Start the database (if using Docker):
# in wsl or linux
./start-database.sh
- Push the database schema:
pnpm db:push
To develop all apps and packages, run the following command:
pnpm dev
To build all apps and packages, run the following command:
pnpm build
- Generate migrations:
pnpm db:generate - Apply migrations:
pnpm db:migrate - View database with UI:
pnpm db:studio - Push schema changes:
pnpm db:push
pnpm format-and-lint- Check formatting and linting across all packagespnpm format-and-lint:fix- Fix formatting and linting issues across all packagespnpm typecheck- Type check all packagespnpm clean- Clean build artifacts and node_modules
Learn more about the technologies used: