A modern full-stack application built with Next.js, GraphQL, Prisma, and Express.js.
- Frontend: Next.js 15 with App Router, TypeScript, Tailwind CSS, Shadcn UI
- Backend: Express.js with TypeScript
- Database: PostgreSQL with Prisma ORM
- GraphQL: Apollo Client for data fetching
- Development: ESLint, Prettier, Husky, TypeScript
- Styling: Tailwind CSS v4 with Shadcn UI components
- State Management: Apollo Client with GraphQL
- Database: Prisma ORM with PostgreSQL
- API: Express.js with CORS, Helmet, Morgan
- Development Tools: ESLint, Prettier, Husky, lint-staged
- Package Manager: pnpm
- Node.js 18+
- pnpm
- PostgreSQL database
- Clone the repository:
git clone <your-repo-url>
cd flowlet- Install dependencies:
pnpm install- Set up environment variables:
cp env.example .env.local-
Update the
.env.localfile with your database URL and other configuration. -
Set up the database:
# Generate Prisma client
pnpm db:generate
# Push schema to database
pnpm db:push
# Or run migrations
pnpm db:migrate- Start the development servers:
# Start Next.js frontend (in one terminal)
pnpm dev
# Start Express.js backend (in another terminal)
pnpm server:devflowlet/
βββ src/
β βββ app/ # Next.js App Router
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β βββ components/ # React components
β β βββ ui/ # Shadcn UI components
β βββ lib/ # Utility libraries
β β βββ apollo/ # Apollo Client setup
β β βββ graphql/ # GraphQL queries & mutations
β β βββ prisma.ts # Prisma client
β βββ server/ # Express.js backend
β βββ index.ts # Server entry point
βββ prisma/
β βββ schema.prisma # Database schema
βββ .env.local # Environment variables
βββ components.json # Shadcn UI config
βββ tailwind.config.ts # Tailwind CSS config
βββ package.json
pnpm dev- Start Next.js development serverpnpm build- Build for productionpnpm start- Start production server
pnpm server- Start Express.js serverpnpm server:dev- Start Express.js with hot reload
pnpm db:generate- Generate Prisma clientpnpm db:push- Push schema to databasepnpm db:migrate- Run database migrationspnpm db:studio- Open Prisma Studio
pnpm lint- Run ESLintpnpm lint:fix- Fix ESLint errorspnpm format- Format code with Prettierpnpm type-check- Run TypeScript type checking
Create a .env.local file with the following variables:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/flowlet?schema=public"
# Next.js
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXT_PUBLIC_GRAPHQL_ENDPOINT="http://localhost:3001/graphql"
# Server
PORT=3001
NODE_ENV="development"
FRONTEND_URL="http://localhost:3000"
# JWT (if using authentication)
JWT_SECRET="your-super-secret-jwt-key-here"- Install PostgreSQL
- Create a database named
flowlet - Update the
DATABASE_URLin your.env.localfile - Run
pnpm db:pushto create the database schema
This project uses Shadcn UI components. To add new components:
pnpm dlx shadcn@latest add [component-name]- Use TypeScript for all new code
- Follow ESLint and Prettier configurations
- Write meaningful commit messages
- Use conventional commit format
- Test your changes before committing
- Connect your repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push to main branch
- Set up your database (PostgreSQL)
- Configure environment variables
- Deploy your Express.js server
This project is licensed under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
If you have any questions or need help, please open an issue in the repository.