Skip to main content

Quick Start

Get Almafrica running locally in 15 minutes.

Prerequisites

Ensure you've completed Prerequisites setup.

1. Clone Repository

git clone https://github.com/your-org/almafrica.git
cd almafrica

2. Environment Setup

# Copy environment files
cp .env.production.example .env
cp backend/.env.example backend/.env
cp web/almafrica-web/.env.example web/almafrica-web/.env.local

3. Start Database

docker-compose -f docker-compose.local.yml up -d

Verify PostgreSQL is running:

docker ps | grep postgres

4. Start Backend

cd backend

# Restore dependencies
dotnet restore

# Apply migrations
dotnet ef database update \
--project Almafrica.Infrastructure \
--startup-project Almafrica.API

# Run the API
dotnet run --project Almafrica.API

Backend runs at: http://localhost:5000

Swagger UI: http://localhost:5000/swagger

5. Start Web Dashboard

Open a new terminal:

cd web/almafrica-web

# Install dependencies
pnpm install

# Start development server
pnpm dev

Web runs at: http://localhost:3000

6. Start Mobile App (Optional)

Open a new terminal:

cd mobile/mon_jardin

# Get dependencies
flutter pub get

# Run on device/simulator
flutter run

Verify Everything Works

Backend

curl http://localhost:5000/health
# Should return: healthy

Web

Open http://localhost:3000 in your browser. You should see the login page.

Mobile

The app should launch on your connected device or simulator.

Default Login (Development)

Email: admin@almafrica.com
Password: Admin123!

Common Issues

Port Already in Use

Backend (5000):

lsof -i :5000
kill -9 <PID>

Web (3000):

lsof -i :3000
kill -9 <PID>

Database Connection Failed

  1. Verify Docker is running: docker ps
  2. Check PostgreSQL container logs: docker logs almafrica-postgres-1
  3. Verify DATABASE_URL in backend/.env

Migration Errors

# Drop and recreate database
dotnet ef database drop --force
dotnet ef database update

Next Steps