Skip to content

Latest commit

 

History

History
205 lines (146 loc) · 4.32 KB

File metadata and controls

205 lines (146 loc) · 4.32 KB

Local Development Setup

Step-by-step guide to run LogisticsX without Docker.

Step 1: Clone Repository

git clone https://github.com/suxrobgm/logistics-app.git
cd logistics-app

Step 2: Install Angular Dependencies

cd src/Client/Logistics.OfficeApp
bun install
cd ../../..

Step 3: Configure Database

Create Databases

Connect to PostgreSQL and create the required databases:

CREATE DATABASE master_logisticsx;
CREATE DATABASE default_logisticsx;

Or via command line:

psql -U postgres -c "CREATE DATABASE master_logisticsx;"
psql -U postgres -c "CREATE DATABASE default_logisticsx;"

Update Connection Strings

Edit src/Presentation/Logistics.API/appsettings.json:

{
  "ConnectionStrings": {
    "MasterDatabase": "Host=localhost;Port=5432;Database=master_logisticsx;Username=postgres;Password=YOUR_PASSWORD",
    "DefaultTenantDatabase": "Host=localhost;Port=5432;Database=default_logisticsx;Username=postgres;Password=YOUR_PASSWORD"
  },
  "TenantsDatabaseConfig": {
    "DatabaseNameTemplate": "{tenant}_logisticsx",
    "DatabaseHost": "localhost",
    "DatabaseUserId": "postgres",
    "DatabasePassword": "YOUR_PASSWORD"
  }
}

Also update src/Presentation/Logistics.IdentityServer/appsettings.json with the same connection string.

Step 4: Seed Databases

Run the database migrator to create tables and seed initial data:

# Using the provided script
scripts/seed-databases.cmd

# Or manually
dotnet run --project src/Presentation/Logistics.DbMigrator

Step 5: Run Applications

Open separate terminals for each service:

Terminal 1 - API:

dotnet run --project src/Presentation/Logistics.API
# Runs on https://localhost:7000

Terminal 2 - Identity Server:

dotnet run --project src/Presentation/Logistics.IdentityServer
# Runs on https://localhost:7001

Terminal 3 - Admin App:

dotnet run --project src/Presentation/Logistics.AdminApp
# Runs on https://localhost:7002

Terminal 4 - Office App:

cd src/Client/Logistics.Angular
bun run start:tms
# Runs on https://localhost:7003

Terminal 5 - Customer Portal (Optional):

cd src/Client/Logistics.Angular
bun run start:customer
# Runs on https://localhost:7004

Or use the provided scripts:

scripts/run-api.cmd
scripts/run-identity.cmd
scripts/run-adminapp.cmd
scripts/run-tms.cmd
scripts/run-customer.cmd

Step 6: Configure Stripe (Optional)

For payment testing:

  1. Get your test keys from Stripe Dashboard

  2. Update src/Presentation/Logistics.API/appsettings.json:

    {
      "Stripe": {
        "PublishableKey": "pk_test_...",
        "SecretKey": "sk_test_...",
        "WebhookSecret": ""
      }
    }
  3. Run Stripe CLI for webhook forwarding:

    scripts/listen-stripe-webhook.cmd
  4. Copy the webhook secret from Stripe CLI output and update WebhookSecret

Step 7: Access Applications

Application URL Credentials
API (Swagger) https://localhost:7000/swagger -
Identity Server https://localhost:7001 -
Admin App https://localhost:7002 admin@test.com / Test12345#
Office App https://localhost:7003 owner@test.com / Test12345#

Test Credentials

Role Email Password App Access
Super Admin admin@test.com Test12345# Admin App
Owner owner@test.com Test12345# Office App
Manager manager1@test.com Test12345# Office App
Dispatcher dispatcher1@test.com Test12345# Office App
Driver driver1@test.com Test12345# Driver Mobile App

Common Issues

HTTPS Certificate Errors

Trust the development certificate:

dotnet dev-certs https --trust

Port Already in Use

Check what's using the port:

# Windows
netstat -ano | findstr :7000

# macOS/Linux
lsof -i :7000

Database Connection Failed

  1. Verify PostgreSQL is running
  2. Check connection string credentials
  3. Ensure database exists

Angular Build Errors

cd src/Client/Logistics.OfficeApp
bun install --force

Next Steps