Prerequisites
Before you begin, ensure you have the following installed:Docker
Docker Engine 20.10+ or Docker DesktopDownload Docker
Docker Compose
Docker Compose v2.0+ (included with Docker Desktop)Install Compose
System Requirements: At least 4GB RAM and 10GB free disk space for all containers.
Installation Steps
Clone the Repository
Clone the AmbioSys source code to your local machine:The repository structure includes:
Configure Environment Variables
Create environment files for each service. Start with the backend API:
Backend/web-ambiotec/.env
WhatsApp Bot Configuration
WhatsApp Bot Configuration
Create
Backend/gpt4-ambiotec-bot/.env:Frontend Configuration
Frontend Configuration
Create
Frontend/.env:Set Up the Database
AmbioSys requires a PostgreSQL database. You can either:Option A: Use an External PostgreSQL InstanceRun the database schema creation script:Then run migrations:Option B: Add PostgreSQL to Docker Compose (Recommended for development)Add this service to your And add the volume:
docker-compose.yml:Start the Services
Launch all services with Docker Compose:This will start:
- Redis on port 6379
- Backend API on port 3000
- WhatsApp Bot on port 4500
The frontend is currently commented out in Access it at
docker-compose.yml. To run it:http://localhost:5173Accessing the Application
Frontend
http://localhost:5173React application with Material-UI
Backend API
http://localhost:3000Express.js REST API
WhatsApp Bot
http://localhost:4500GPT-4 powered bot service
API Documentation
http://localhost:3000/api-docsInteractive Swagger API documentation
Default Login Credentials
If you’ve run the database seed scripts, you can log in with:- Username:
admin - Password: Check your database initialization scripts in
DB/DML/DML.sql
Next Steps
Architecture Overview
Learn how the microservices communicate and the data flow
API Reference
Explore available endpoints and request/response formats
Environment Variables
Deep dive into environment variables and system settings
Database Setup
Set up PostgreSQL database and schemas
Troubleshooting
Services won't start
Services won't start
Check Docker logs for errors:Common issues:
- Port already in use: Change ports in
docker-compose.yml - Missing
.envfiles: Ensure all environment files are created - Insufficient resources: Increase Docker memory allocation
Cannot connect to database
Cannot connect to database
Verify database connectivity:Or check PostgreSQL directly:Check these settings in your
.env:PG_HOSTshould match your database hostPG_PORT(default 5432)PG_USERandPG_PASSWORDPG_DATABASE_AMBIOTEC
Redis connection errors
Redis connection errors
Ensure Redis is running:Test Redis connectivity:Should return:
PONGFrontend can't reach backend
Frontend can't reach backend
Verify CORS settings in Check frontend
Backend/web-ambiotec/src/app.js:.env has correct API URL:Hot-reload not working
Hot-reload not working
The backend uses If changes aren’t detected, restart with:
nodemon for hot-reload. Check volume mounts in docker-compose.yml: