Skip to content

Installation

From an empty machine to the storefront, admin dashboard, API and docs running locally.

BabyMart is a pnpm workspace driven by Turborepo. You install once at the repository root, build the shared packages, add your environment files and start every web app with one command. The mobile app is the exception. It sits outside the workspace and is installed on its own.

  1. 1Get the codeBuy or clone
  2. 2UnpackUnzip or git clone
  3. 3Installpnpm install
  4. 4Build packagesShared types
  5. 5Add .env filesMongo, JWT, Stripe
  6. 6pnpm devFour apps start
Six steps from purchase to a running store.

These docs describe the Turbo Monorepo edition of BabyMart — all four apps, the shared packages and the Turborepo setup. Pick a plan, pay once, and the download is available right after checkout.

Best value · these docs

Turbo Monorepo

The complete BabyMart monorepo documented on this site — mobile app included.

$99.99one-time

  • React Native mobile app for iOS and Android included
  • Next.js storefront + Vite admin dashboard
  • Express + MongoDB API (297 endpoints)
  • Turborepo + pnpm workspace, shared UI and types
  • Vendor / seller system and staff order workflow
  • Stripe, SSLCommerz and cash on delivery
  • 1 year of free future updates
  • Deployment guides and priority support
Buy now

Normal TypeScript

The standard single-repository version of the store.

$45one-time

  • Next.js web application
  • React Native mobile app
  • Firebase + MongoDB authentication
  • Products, cart, checkout and orders
  • Stripe payments
  • Admin dashboard
Buy now

GitHub repo

Open-source version for learning and personal projects.

Free

  • Basic e-commerce structure
  • Frontend UI code and admin panel setup
  • REST API integration and MongoDB schema examples
  • MIT licence, community support
View on GitHub

One-time payment. Instant access right after purchase, including future updates and bug fixes for the support period.

  1. Complete checkout on the plan’s purchase page. Access is instant: you get the download (a turbo-babymart.zip archive) as soon as payment clears.

  2. Unzip it where you keep your projects and open a terminal in the folder:

    Terminal window
    unzip turbo-babymart.zip -d turbo-babymart
    cd turbo-babymart
  3. Put it under version control (recommended) so updates are easy to merge later:

    Terminal window
    git init && git add . && git commit -m "BabyMart Turbo Monorepo"
  4. Continue with the prerequisites below, then install and run.

Tool Version Needed for
Node.js >=22.12.0 Everything. Set in the root engines field.
pnpm 9.15.9 Installing the workspace. Set in the root packageManager field.
MongoDB Local server or MongoDB Atlas The API database.
Stripe CLI Any recent version (optional) Forwarding payment webhooks to your machine.
Xcode + CocoaPods CocoaPods >=1.13 (macOS only) Building the iOS mobile app.
Android Studio SDK 37 (min SDK 24), JDK 17 Building the Android mobile app.

The versions come from package.json and the mobile app’s Gemfile and android/build.gradle. The full list of library versions is on Tech stack.

  1. Open the project folder. If you bought the source, this is the folder you unzipped in After you buy. If your team keeps it in a private Git repository, clone that instead:

    Terminal window
    git clone <your-private-repo-url> turbo-babymart
    cd turbo-babymart
  2. Install every workspace package from the root. This installs the storefront, admin, API, docs and the three shared packages together.

    Terminal window
    pnpm install
  3. Build the shared packages. @babyshop/types and @babyshop/config compile to dist/, and the apps import that output.

    Terminal window
    pnpm build:packages

    pnpm run setup runs steps 2 and 3 together. Type run: plain pnpm setup is a built-in pnpm command that does something else.

  4. Create the environment files. Only the storefront ships an example file. Create the others by hand, using the tables on Environment variables.

    Terminal window
    cp apps/web/.env.example apps/web/.env
    touch apps/api/.env apps/admin/.env

    At minimum the API needs MONGO_URI and JWT_SECRET, the storefront needs NEXT_PUBLIC_API_URL, and the admin needs VITE_NEXT_PUBLIC_API_URL and the VITE_FIREBASE_* keys.

  5. (Optional) Load the demo catalogue, so the store has products, categories and banners. See Demo data.

    Terminal window
    node scripts/seed-data.js
  6. Start everything.

    Terminal window
    pnpm dev

    Turborepo starts the storefront, admin, API and docs in parallel.

App URL Set by
Storefront http://localhost:3000 Next.js default port
Admin dashboard http://localhost:5173 Vite default port
API http://localhost:8000 PORT env var, default 8000
API docs (Swagger UI) http://localhost:8000/api/docs Mounted only when NODE_ENV is not production
These docs http://localhost:3002 astro dev --port 3002
Terminal window
pnpm dev:web

The API runs with tsx watch server.ts, so it restarts on every save.

Paid orders are only marked paid when a Stripe webhook arrives. To test that locally, sign in with stripe login and forward events:

Terminal window
# Storefront Checkout Sessions → the storefront's webhook route
pnpm webhook:web
# PaymentIntents (mobile app) → the API's webhook route
pnpm webhook:api

Copy the whsec_… signing secret that stripe listen prints into STRIPE_WEBHOOK_SECRET for the app that receives the events. The full flow is on Payments.

pnpm-workspace.yaml excludes apps/mobile (!apps/mobile). The mobile app uses npm and its own package-lock.json:

Terminal window
cd apps/mobile
npm install # or, from the root: pnpm mobile:install
bundle install # CocoaPods from the Gemfile (macOS only)
cd ios && bundle exec pod install && cd ..
npm start # Metro bundler
npm run ios # or: npm run android

In development the app calls http://localhost:8000/api on iOS and http://10.0.2.2:8000/api on the Android emulator, so start the API first. Details are on Mobile app.

  • http://localhost:8000/health returns a JSON health check.
  • The storefront home page lists products. If it is empty, seed the demo data.
  • You can sign in to the admin dashboard at http://localhost:5173/login.

If something fails, see Troubleshooting.