Automated setup scripts for quickly getting the Rahat Platform development environment up and running.
Before running the bootstrap script, ensure you have the following installed on your system:
- Git - Version control system
- Docker - Container platform (with Docker Compose)
- pnpm - Fast, disk space efficient package manager
- Node.js - JavaScript runtime (v16 or higher recommended)
Run the following command to set up the entire Rahat Platform:
curl -sSL https://raw.githubusercontent.com/dipesh-rumsan/bootstrap-scripts/main/bootstrap.sh | bashOr, if you've cloned this repository:
chmod +x bootstrap.sh
./bootstrap.shThe bootstrap.sh script automates the following setup process:
- Checks if Git and Docker are installed
- Exits with helpful error messages if dependencies are missing
- Clones the
rahat-platformrepository (if not already present) - Switches to the
devbranch - Installs all project dependencies using pnpm
- Creates
.envfiles from.env.exampletemplates - Sets up environment variables for:
- Root project
- Dev tools (Docker Compose services)
- Generates mnemonic phrases for wallet creation
- Retrieves Ganache blockchain accounts
- Creates Docker volumes for:
- PostgreSQL database (
rahat_pg_data) - PgAdmin (
rahat_pg_admin_data) - Ganache (local blockchain) (
rahat_ganache_data) - Redis (
rahat_redis_data) - Graph node (
rahat_pg_graph_data) - IPFS (
rahat_ipfs_data)
- PostgreSQL database (
- Creates Docker networks (
rahat_platform,rahat_projects) - Starts Docker Compose services for dev tools and graph node
- Generates Prisma client
- Runs database migrations
- Seeds development data for multiple projects:
- El Salvador settings
- C2C (Cash-to-Cash) settings
- AA (Anticipatory Action) settings
- CVA (Cash and Voucher Assistance) settings
- RP (Rahat Platform) settings
- Kenya settings
- Cambodia settings
- Chain settings
- Communication settings
- Offramp settings
- Deploys smart contracts to local Ganache network
- Configures The Graph indexing protocol
- Generates graph code
- Creates and deploys local graph node
- Outputs the Graph URL for querying
- Prompts to set up Rahat Project AA (Anticipatory Action)
- If accepted, runs:
triggersBootstrap.sh- Sets up rahat-project-triggersaaBootstrap.sh- Sets up rahat-project-aa
Sets up the rahat-project-triggers:
curl -sSL https://raw.githubusercontent.com/dipesh-rumsan/bootstrap-scripts/main/triggersBootstrap.sh | bashThis script:
- Clones rahat-project-triggers repository
- Installs dependencies with pnpm
- Builds the project
- Creates
.envfiles - Runs database migrations and seeding
Sets up the rahat-project-aa (requires triggers to be set up first):
curl -sSL https://raw.githubusercontent.com/dipesh-rumsan/bootstrap-scripts/main/aaBootstrap.sh | bashThis script:
- Checks for rahat-project-triggers as a prerequisite
- Clones rahat-project-aa repository
- Switches to
seed-setupbranch - Creates
.envfiles - Sets up project-specific configuration
The bootstrap script includes several utility functions that can be used independently:
create_env- Create environment files from examplesgenerate_mnemonic- Generate blockchain wallet mnemonicscreate_rahat_volumes- Create Docker volumesstart_dev_tools- Start Docker Compose servicesstop_dev_tools- Stop Docker Compose servicesremove_rahat_volumes- Remove Docker volumesmigrate_seed- Run database migrations and seedingcontract_setup- Deploy smart contracts and setup graphgraph_setup- Configure and deploy The Graphreset- Stop services, remove volumes, and clean modules
- Ensure you have SSH keys configured for GitHub
- Or modify the git clone commands to use HTTPS instead
- Verify Docker Desktop is running
- Check if ports are already in use (5432, 6379, 8545, etc.)
- Run
docker psto see running containers
- Install pnpm globally:
npm install -g pnpm - Verify Node.js version:
node --version
- Ensure Docker PostgreSQL container is running
- Check database connection settings in
.envfiles - Try restarting Docker services:
docker compose down && docker compose up -d
.
├── rahat-platform/ # Main platform repository
│ ├── tools/
│ │ └── docker-compose/ # Docker configurations
│ ├── prisma/ # Database schemas and migrations
│ └── ...
├── rahat-project-triggers/ # (Optional) Triggers project
└── rahat-project-aa/ # (Optional) Anticipatory Action project
If you need to start fresh, the bootstrap script includes a reset function:
# This will:
# - Stop all Docker services
# - Remove Docker volumes
# - Remove node_modules and build artifacts
resetAfter successful setup:
-
Access Services:
- PgAdmin: http://localhost:5050
- Ganache: http://localhost:8545
- Graph Node: Check terminal output for URL
-
Start Development:
cd rahat-platform pnpm dev -
View Documentation:
- Check the rahat-platform README for development guidelines
- Review environment variables in
.envfiles
-
The script uses color-coded output:
- 🟢 Green: Success messages
- 🔵 Blue: Information/Process messages
- 🔴 Red: Error messages
- 🟡 Yellow: Warning messages
-
All Docker volumes persist data between restarts
-
The setup includes multiple country-specific configurations (Kenya, Cambodia, El Salvador)
-
Graph URL is automatically exported to environment variables
Refer to individual project repositories for license information.
For issues or contributions, please refer to the main Rahat Platform repository.
Happy coding! 🚀