A modern book club management platform built with TypeScript, NestJS, Next.js, and Prisma.
- Node.js 18+
- pnpm 8+
- Docker & Docker Compose
-
Clone and install dependencies
git clone <repo-url> cd im-reading-here pnpm install
-
Start the database
docker-compose up -d postgres
-
Set up the API environment
cd apps/api cp .env.example .env # Edit .env with your database connection details
-
Run database migrations
cd apps/api pnpm db:push -
Start the development servers
# From the root directory pnpm dev
This will start:
- API server at http://localhost:3001
- Web frontend at http://localhost:3000
- API documentation at http://localhost:3001/api/docs
-
Start the mobile app (optional)
# From the root directory pnpm mobileThis will start the Expo development server. You can run the mobile app on:
- iOS simulator (press
i) - Android emulator (press
a) - Web browser (press
w) - Physical device via Expo Go app (scan QR code)
- iOS simulator (press
Each application requires specific environment variables to function properly. Copy the .env.example files and configure them for your environment.
Create apps/api/.env from apps/api/.env.example:
| Variable | Required | Description | Example |
|---|---|---|---|
DATABASE_URL |
โ | PostgreSQL connection string | postgresql://postgres:password@localhost:5432/im_reading_here?schema=public |
SUPABASE_URL |
โ | Supabase project URL | https://your-project.supabase.co |
SUPABASE_ANON_KEY |
โ | Supabase anonymous key | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... |
SUPABASE_SERVICE_ROLE_KEY |
โ | Supabase service role key (server-side only) | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... |
SUPABASE_JWT_SECRET |
โ | JWT verification secret from Supabase | your-jwt-secret |
JWT_SECRET |
Legacy JWT secret (being phased out) | your-super-secret-jwt-key |
|
JWT_EXPIRES_IN |
โ | Legacy JWT expiration | 15m |
JWT_REFRESH_EXPIRES_IN |
โ | Legacy refresh token expiration | 7d |
PORT |
โ | API server port | 3001 |
NODE_ENV |
โ | Environment mode | development |
OPEN_LIBRARY_API_URL |
โ | Open Library API endpoint | https://openlibrary.org |
GOOGLE_BOOKS_API_URL |
โ | Google Books API endpoint | https://www.googleapis.com/books/v1 |
GOOGLE_BOOKS_API_KEY |
โ | Google Books API key (for enhanced features) | your-api-key |
Create apps/web/.env.local from apps/web/.env.example:
| Variable | Required | Description | Example |
|---|---|---|---|
NEXT_PUBLIC_API_URL |
โ | API server URL | http://localhost:3001 |
NEXT_PUBLIC_SUPABASE_URL |
โ | Supabase project URL | https://your-project.supabase.co |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
โ | Supabase anonymous key | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... |
NODE_ENV |
โ | Environment mode | development |
Create apps/mobile/.env from apps/mobile/.env.example:
| Variable | Required | Description | Example |
|---|---|---|---|
EXPO_PUBLIC_SUPABASE_URL |
โ | Supabase project URL | https://your-project.supabase.co |
EXPO_PUBLIC_SUPABASE_ANON_KEY |
โ | Supabase anonymous key | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... |
The Docker Compose setup uses these environment variables for PostgreSQL:
| Variable | Value | Description |
|---|---|---|
POSTGRES_USER |
postgres |
Database username |
POSTGRES_PASSWORD |
password |
Database password |
POSTGRES_DB |
im_reading_here |
Database name |
- Create a Supabase account
- Create a new project
- Go to Settings โ API
- Copy your:
- Project URL (
SUPABASE_URL) - Anon/Public key (
SUPABASE_ANON_KEY) - Service role key (
SUPABASE_SERVICE_ROLE_KEY)
- Project URL (
- Go to Settings โ API โ JWT Settings
- Copy the JWT Secret (
SUPABASE_JWT_SECRET)
You can use the provided setup script to quickly configure your environment:
./setup.shThis script will:
- Copy all
.env.examplefiles to their respective.envfiles - Start the Docker services
- Run database migrations
- Install dependencies
This project includes a comprehensive Storybook setup for component development and testing:
# Start Storybook development server
pnpm storybook
# or use any of these shortcuts
pnpm sb # Short version
pnpm story # Descriptive
pnpm ui # UI focusedAccess Storybook at http://localhost:6006 to:
- ๐จ Develop components in isolation
- ๐ View auto-generated documentation
- ๐ Test dark/light theme variants
- ๐ฑ Preview responsive breakpoints
- โฟ Run accessibility checks
- ๐ฎ Interact with component controls
See STORYBOOK.md for detailed usage instructions.
This is a monorepo containing
apps/api- NestJS REST API with Prisma ORMapps/web- Next.js web applicationapps/mobile- React Native mobile app with Expo
packages/shared- Shared types, schemas, utilities, and design system
This project uses a centralized design system to ensure consistency across web and mobile platforms
- Shared Tailwind Configuration: Unified design tokens for colors, spacing, typography
- Platform-Specific Adaptations: Web uses CSS variables, mobile uses direct values
- Design Tokens: Exportable constants for use in JavaScript/TypeScript
- Documentation: See
packages/shared/DESIGN_SYSTEM.mdfor detailed usage
// Using design tokens in code
import { colors } from '@im-reading-here/shared'
const primaryColor = colors.primary[600]
// Using Tailwind classes (same across platforms)
className="bg-primary-600 text-white rounded-lg p-4"- Backend: TypeScript + NestJS + Prisma + PostgreSQL
- Frontend: Next.js + React + TanStack Query + Tailwind CSS + shadcn/ui
- Mobile: React Native + Expo + AsyncStorage
- Shared: Supabase authentication across web and mobile
- UI Components: shadcn/ui built on Radix UI primitives
- Component Development: Storybook with accessibility testing
- Database: PostgreSQL with Prisma ORM
- Monorepo: Turborepo + pnpm workspaces
- Development: Docker Compose for local services
# Install dependencies
pnpm install
# Start all development servers
pnpm dev
# Start Storybook component library
pnpm storybook
# Build all packages
pnpm build
# Build Storybook for production
pnpm build-storybook
# Run type checking
pnpm type-check
# Run linting
pnpm lint
# Start database services
docker-compose up -d
# Database operations (from apps/api)
pnpm db:push # Push schema changes
pnpm db:migrate # Create and run migrations
pnpm db:studio # Open Prisma Studioโโโ apps/
โ โโโ api/ # NestJS API server
โ โโโ web/ # Next.js web app
โโโ packages/
โ โโโ shared/ # Shared types and utilities
โโโ docs/ # Project documentation
โโโ docker-compose.yml
The API documentation is automatically generated with Swagger and available at: http://localhost:3001/api/docs
- Create a feature branch
- Make your changes
- Run
pnpm type-checkandpnpm lint - Test your changes
- Submit a pull request
MIT