An open API service indexing awesome lists of open source software.

https://github.com/akashdeep023/turborepo-setup

https://turborepo-setup.vercel.app/
https://github.com/akashdeep023/turborepo-setup

eslint nextjs postgresql prisma prisma-client shadcn-ui tailwindcss turbo turborepo turborepo-example turborepo-prisma turborepo-shadcn turborepo-tailwind typescript web

Last synced: 3 months ago
JSON representation

https://turborepo-setup.vercel.app/

Awesome Lists containing this project

README

          

# Turborepo Monorepo

This repository is a **Turborepo setup** for building full-stack applications.
It combines a **frontend**, **backend**, and **shared packages** in one place.

---

## πŸ“‚ What’s Inside

```
.
β”œβ”€β”€ apps/
β”‚ β”œβ”€β”€ web/ # Next.js frontend (Tailwind + Shadcn UI)
β”‚ └── api/ # Express backend (Prisma + PostgreSQL)
β”œβ”€β”€ packages/
β”‚ β”œβ”€β”€ ui/ # Shared UI components (Shadcn + Tailwind)
β”‚ β”œβ”€β”€ database/ # Prisma client + DB helpers
β”‚ β”œβ”€β”€ config-*/ # Shared configs (Tailwind, ESLint, TypeScript)
└── turbo.json # Turborepo config
```

- **apps/web** β†’ Public web app using **Next.js + Tailwind + Shadcn UI**
- **apps/api** β†’ API server using **Express + Prisma + PostgreSQL**
- **packages/ui** β†’ Shared UI components across apps
- **packages/database** β†’ Prisma client & DB setup
- **packages/config-**\* β†’ Shared configs for consistency

---

## WEB APP (apps/web)

This app is a **Next.js frontend** using **Tailwind + Shadcn UI**.

Add `NEXT_PUBLIC_NODE_API` to `.env` in the root of the **apps/web**

```sh
NEXT_PUBLIC_NODE_API="http://localhost:4000"
```

Run it locally:

```sh
cd apps/web
npm run dev
```

---

## 🎨 UI Package (packages/ui)

This package contains **reusable UI components** using Shadcn + Tailwind.
You can extend the UI by adding components:

```sh
cd packages/ui
npx shadcn-ui@latest add button
```

Then use it in apps:

```tsx
import { Button } from "@repo/ui/components/button";

export default function Page() {
return Click Me;
}
```

---

## πŸ—„οΈ Database Package (packages/database)

This package provides a **Prisma client** to connect to PostgreSQL.
Run migrations and generate the client from here:

Add `DATABASE_URL` to `.env` in the root of the **packages/database**

```sh
DATABASE_URL="postgresql://:@/?sslmode=require&channel_binding=require"
NODE_ENV="development"
```

```sh
cd packages/database
npx prisma migrate dev --name init
npx prisma generate
```

Use it in apps:

```ts
import { prisma } from "@repo/database";

const users = await prisma.users.findMany();
```

---

## πŸš€ How to Run the Apps

From the root of the repo:

```sh
npm install
npm run dev
```

- **Web** β†’ [http://localhost:3000](http://localhost:3000)
- **API** β†’ [http://localhost:4000](http://localhost:4000)

---

## πŸ‘¨β€πŸ’» Contact

Built by:

- **Akash Deep**
- 🌐 Website: [https://akashdeep023.vercel.app](https://https://akashdeep023.vercel.app)
- πŸ™ GitHub: [@akashdeep023](https://github.com/akashdeep023)
- πŸ’Ό LinkedIn: [Akash Deep](https://linkedin.com/in/akashdeep023)