Skip to content

Getting Started

Prerequisites

RequirementVersionNotes
Node.js>= 20Required by all three projects
pnpm10.xPackage manager for all projects
PostgreSQL>= 15Two databases needed
Stripe accountFor payment features (test mode)
Cloudflare accountFor image upload (optional for dev)
Resend accountFor transactional emails (optional for dev)

Clone & Install

The three projects live in sibling directories under a shared monorepo root. There is no root package.json — each project manages its own dependencies. You must run pnpm install in each directory separately.

bash
# Root structure
/path/to/myeasyguide/
├── api.myeasyguide.com/     # Express API
├── cms-myeasyguide/         # Next.js CMS
└── myeasyguide.com/         # Next.js Frontend

# Install dependencies for each project
cd api.myeasyguide.com && pnpm install
cd ../cms-myeasyguide && pnpm install
cd ../myeasyguide.com && pnpm install

Database Setup

Create PostgreSQL databases

sql
CREATE DATABASE walkthroughnepal;
CREATE DATABASE cms_myeasyguide;

Run migrations

bash
# API database
cd api.myeasyguide.com
cp .env.example .env      # Edit DATABASE_URL with your credentials
pnpm prisma migrate dev

# CMS database
cd cms-myeasyguide
cp .env.local.example .env.local   # Edit DATABASE_URL
pnpm prisma migrate dev

Seed data (optional)

bash
cd api.myeasyguide.com
pnpm seed

This creates admin accounts, suppliers, users, activities, bookings, reviews, and other test data.

Environment Variables

API (api.myeasyguide.com/.env)

bash
DATABASE_URL=postgresql://user:password@localhost:5432/walkthroughnepal
JWT_SECRET=your-secret-key
JWT_SECRET_ADMIN=your-admin-secret-key
VERIFICATION_TOKEN=your-token
EMAIL_UNSUB_SECRET=your-secret
RESEND_API_KEY=re_xxxx
VERIFICATION_LINK=http://localhost:3000/verify
RESET_LINK=http://localhost:3000/reset
FRONTEND_BASE_URL=http://localhost:3001
BASE_URL=http://localhost:3000/api/v1
UPLOADS_BASE_URL=http://localhost:3000/api/v1
NODE_ENV=development
COOKIE_AGE=604800000
JWT_EXPIRY=604800000
COOKIE_DOMAIN=.myeasyguide.com
STRIPE_SECRET_KEY=sk_test_xxx
STRIPE_PUB_KEY=pk_test_xxx
STRIPE_WHSEC_KEY=whsec_xxx
CF_ACCOUNT_ID=your-cloudflare-account-id
CF_API_TOKEN=your-cloudflare-api-token
CF_ACCOUNT_HASH=your-cloudflare-hash
IMAGE_BASE_URL=https://imagedelivery.net/your-hash
TYPESENSE_HOST=localhost
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http
TYPESENSE_API_KEY=xyz
CLAUDE_API_KEY=sk-ant-xxx
CLAUDE_MODEL=claude-opus-4-7
RECOMBEE_DB=your-recombee-db
RECOMBEE_API_TOKEN=your-recombee-token

CMS (cms-myeasyguide/.env.local)

bash
DATABASE_URL=postgresql://user:password@localhost:5432/cms_myeasyguide
ANTHROPIC_API_KEY=sk-ant-xxx
JWT_SECRET=change-me-to-a-random-secret-in-production

Frontend (myeasyguide.com/.env)

bash
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000/api/v1
NEXT_PUBLIC_POST_URL=http://localhost:3002

The NEXT_PUBLIC_POST_URL points to the CMS. In production this is https://cms.myeasyguide.com. In development you may run the CMS on a different port.

Running Locally

Start the API

bash
cd api.myeasyguide.com
pnpm dev

Starts on http://localhost:3000. Swagger docs at http://localhost:3000/docs.

Start the CMS (optional)

bash
cd cms-myeasyguide
pnpm dev

The CMS runs on its configured port (Next.js default 3000 — change if conflicting with API).

Start the frontend

bash
cd myeasyguide.com
pnpm dev

Starts on http://localhost:3001.

Important: Port conflicts

Both the API and CMS default to port 3000. Run them on different ports:

bash
# API on port 3000
cd api.myeasyguide.com && pnpm dev

# CMS on port 3002
cd cms-myeasyguide && npx next dev -p 3002

Then update myeasyguide.com/.env:

bash
NEXT_PUBLIC_POST_URL=http://localhost:3002

Build for Production

bash
# Each project
pnpm build

Common Commands

CommandAPICMSFrontend
pnpm devStart devStart devStart dev (Turbopack)
pnpm buildBuild to dist/Build to .next/Build to .next/
pnpm startStart built appStart built appStart built app
pnpm lintESLintESLintESLint
pnpm seedSeed databaseSeed database
pnpm prisma studioOpen DB browserOpen DB browser
pnpm prisma migrate devRun migrationsRun migrations
pnpm prisma generateRegenerate clientRegenerate client

Built with VitePress