Skip to content

Local Setup — macOS

TL;DR — one command

bash scripts/dev-setup-macos.sh
If this completes without errors, you're done. Open http://localhost:5269/swagger.

The steps below are for debugging the setup script or manual setup.


What the setup script does

The script is idempotent — safe to re-run at any time. Each step checks before acting.

Step What it does
1 Checks macOS + Homebrew
2 Installs .NET 6 SDK (if missing)
3 Fixes DOTNET_ROOT in ~/.zshrc (permanent PATH fix)
4 Installs dotnet-ef tool
5 Starts PostgreSQL 16
6 Creates dms-layered database + msort + meesho schemas
7 Runs all 10 EF Core migrations
8 Starts Mock Partner API (Python Flask)
9 Starts ASP.NET Core backend
10 Runs smoke tests (10 assertions)

Manual steps (if the script fails)

Step 1 — Install .NET 6 SDK

curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 6.0

Add to ~/.zshrc (permanent):

export DOTNET_ROOT="$HOME/.dotnet"
export PATH="$DOTNET_ROOT:$DOTNET_ROOT/tools:$PATH"

Apply immediately:

source ~/.zshrc
dotnet --version   # expect: 6.0.x


Step 2 — Install EF Core CLI

dotnet tool install --global dotnet-ef --version "6.0.*"
dotnet ef --version   # expect: 6.x

Step 3 — PostgreSQL 16

# Start
sudo /Library/PostgreSQL/16/bin/pg_ctl start \
  -D /Library/PostgreSQL/16/data \
  -l /tmp/postgres.log

# Set password (first time only — password is 3edc#EDC)
sudo -u postgres /Library/PostgreSQL/16/bin/psql \
  -c "ALTER USER postgres WITH PASSWORD '3edc#EDC';"
brew install postgresql@16
brew services start postgresql@16
psql -U $(whoami) -c "CREATE USER postgres WITH SUPERUSER PASSWORD '3edc#EDC';"

Create the database and schemas:

PGPASSWORD='3edc#EDC' psql -U postgres \
  -c "CREATE DATABASE \"dms-layered\";"

PGPASSWORD='3edc#EDC' psql -U postgres -d "dms-layered" <<'SQL'
CREATE SCHEMA IF NOT EXISTS msort;
CREATE SCHEMA IF NOT EXISTS meesho;
SQL


Step 4 — Run EF Migrations

bash scripts/migrate.sh

Verify (expect 10 rows):

PGPASSWORD='3edc#EDC' psql -U postgres -d "dms-layered" \
  -t -c 'SELECT "MigrationId" FROM public."__EFMigrationsHistory" ORDER BY 1;'


Step 5 — Seed Dev Data

bash scripts/seed-test-data.sh

Seeds API_Base_URL=http://localhost:5000 into meesho.customer_sorter_profile and 5 test AWBs (VL111111111 through VL555555555) into meesho.data_sync.


Step 6 — Start Mock Partner API

pip3 install -r requirements.txt
make mock

Verify: open http://localhost:5000 — you should see the dashboard.


Step 7 — Start Backend

make backend-bg   # background (logs → /tmp/dms-backend.log)
# or:
make backend      # foreground (Ctrl+C to stop)

Verify: - http://localhost:5269/health{"status":"running"} - http://localhost:5269/swagger → Swagger UI


Step 8 — Smoke Tests

make smoke

Expect: 10 passed, 0 failed


Daily workflow after setup

make dev      # start everything + smoke test
make check    # show live status of all services
make dev-stop # stop everything at end of day

See Daily Workflow for details.