Getting Started
Prerequisites
| Requirement | Version | Notes |
|---|---|---|
| Node.js | >= 20 | Required by all three projects |
| pnpm | 10.x | Package manager for all projects |
| PostgreSQL | >= 15 | Two databases needed |
| Stripe account | — | For payment features (test mode) |
| Cloudflare account | — | For image upload (optional for dev) |
| Resend account | — | For 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.
# 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 installDatabase Setup
Create PostgreSQL databases
CREATE DATABASE walkthroughnepal;
CREATE DATABASE cms_myeasyguide;Run migrations
# 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 devSeed data (optional)
cd api.myeasyguide.com
pnpm seedThis creates admin accounts, suppliers, users, activities, bookings, reviews, and other test data.
Environment Variables
API (api.myeasyguide.com/.env)
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-tokenCMS (cms-myeasyguide/.env.local)
DATABASE_URL=postgresql://user:password@localhost:5432/cms_myeasyguide
ANTHROPIC_API_KEY=sk-ant-xxx
JWT_SECRET=change-me-to-a-random-secret-in-productionFrontend (myeasyguide.com/.env)
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000/api/v1
NEXT_PUBLIC_POST_URL=http://localhost:3002The 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
cd api.myeasyguide.com
pnpm devStarts on http://localhost:3000. Swagger docs at http://localhost:3000/docs.
Start the CMS (optional)
cd cms-myeasyguide
pnpm devThe CMS runs on its configured port (Next.js default 3000 — change if conflicting with API).
Start the frontend
cd myeasyguide.com
pnpm devStarts on http://localhost:3001.
Important: Port conflicts
Both the API and CMS default to port 3000. Run them on different ports:
# API on port 3000
cd api.myeasyguide.com && pnpm dev
# CMS on port 3002
cd cms-myeasyguide && npx next dev -p 3002Then update myeasyguide.com/.env:
NEXT_PUBLIC_POST_URL=http://localhost:3002Build for Production
# Each project
pnpm buildCommon Commands
| Command | API | CMS | Frontend |
|---|---|---|---|
pnpm dev | Start dev | Start dev | Start dev (Turbopack) |
pnpm build | Build to dist/ | Build to .next/ | Build to .next/ |
pnpm start | Start built app | Start built app | Start built app |
pnpm lint | ESLint | ESLint | ESLint |
pnpm seed | Seed database | Seed database | — |
pnpm prisma studio | Open DB browser | Open DB browser | — |
pnpm prisma migrate dev | Run migrations | Run migrations | — |
pnpm prisma generate | Regenerate client | Regenerate client | — |