Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Flowlet is a place for devs to write, share, and discover cool stories, ideas, and tech adventures with the community.

License

Notifications You must be signed in to change notification settings

ujen5173/Flowlet

Repository files navigation

Flowlet

A modern full-stack application built with Next.js, GraphQL, Prisma, and Express.js.

πŸš€ Tech Stack

  • 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

πŸ“¦ Additional Technologies

  • 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

πŸ› οΈ Getting Started

Prerequisites

  • Node.js 18+
  • pnpm
  • PostgreSQL database

Installation

  1. Clone the repository:
git clone <your-repo-url>
cd flowlet
  1. Install dependencies:
pnpm install
  1. Set up environment variables:
cp env.example .env.local
  1. Update the .env.local file with your database URL and other configuration.

  2. Set up the database:

# Generate Prisma client
pnpm db:generate

# Push schema to database
pnpm db:push

# Or run migrations
pnpm db:migrate
  1. Start the development servers:
# Start Next.js frontend (in one terminal)
pnpm dev

# Start Express.js backend (in another terminal)
pnpm server:dev

πŸ“ Project Structure

flowlet/
β”œβ”€β”€ 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

🎯 Available Scripts

Frontend

  • pnpm dev - Start Next.js development server
  • pnpm build - Build for production
  • pnpm start - Start production server

Backend

  • pnpm server - Start Express.js server
  • pnpm server:dev - Start Express.js with hot reload

Database

  • pnpm db:generate - Generate Prisma client
  • pnpm db:push - Push schema to database
  • pnpm db:migrate - Run database migrations
  • pnpm db:studio - Open Prisma Studio

Development

  • pnpm lint - Run ESLint
  • pnpm lint:fix - Fix ESLint errors
  • pnpm format - Format code with Prettier
  • pnpm type-check - Run TypeScript type checking

πŸ”§ Configuration

Environment Variables

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"

Database Setup

  1. Install PostgreSQL
  2. Create a database named flowlet
  3. Update the DATABASE_URL in your .env.local file
  4. Run pnpm db:push to create the database schema

🎨 UI Components

This project uses Shadcn UI components. To add new components:

pnpm dlx shadcn@latest add [component-name]

πŸ“ Development Guidelines

  • Use TypeScript for all new code
  • Follow ESLint and Prettier configurations
  • Write meaningful commit messages
  • Use conventional commit format
  • Test your changes before committing

πŸš€ Deployment

Frontend (Vercel)

  1. Connect your repository to Vercel
  2. Set environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Backend (Railway/Render/Heroku)

  1. Set up your database (PostgreSQL)
  2. Configure environment variables
  3. Deploy your Express.js server

πŸ“„ License

This project is licensed under the MIT License.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Submit a pull request

πŸ“ž Support

If you have any questions or need help, please open an issue in the repository.

About

Flowlet is a place for devs to write, share, and discover cool stories, ideas, and tech adventures with the community.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •