Developer Setup
This guide will help you set up the Loonflow development environment on your local machine.
Prerequisites
Before starting, ensure you have the following installed:
Python 3.12.x (latest stable version of Python 3.12)
Node.js 22.x (latest stable version of Node.js 22)
Redis (for generating unique ticket serial numbers and Celery async tasks)
PostgreSQL(database)
Backend Setup
Navigate to the backend directory:
cd backend
Create configuration file:
Copy
settings/dev.py.sampletosettings/config.pyin the settings directory.cp settings/dev.py.sample settings/config.py
Configure settings:
Edit
settings/config.pyand update the following configurations:Database configuration (connection settings)
Redis address configuration
Log path configuration
Other environment-specific settings
Create and activate a Python virtual environment:
python3.12 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements/dev.txt
Start Redis:
Redis is required for:
Celery async tasks (script execution, status hooks, notification hooks)
Make sure Redis is running before proceeding.
Initialize the database:
python manage.py makemigrations python manage.py migrate
Create a superuser:
python manage.py createsuperuser
Start the backend server:
python manage.py runserver
The backend will be available at
http://{your_ip}:8000.
Frontend Setup
Navigate to the frontend directory:
cd frontend
Install dependencies:
yarn install --immutable
Start the frontend development server:
yarn startThe frontend will be available at
http://{your_ip}:3000.
Celery Worker (Optional)
For local development, the Celery worker is optional unless you need the following features:
Script execution
Status hooks
Notification hooks
If you need these features, start the Celery worker:
Navigate to the backend directory:
cd backend
Start the Celery worker:
celery -A tasks worker -l info -Q loonflow
Access the Application
Once both the backend and frontend are running, access the application at:
http://{your_ip}:3000
The frontend is configured to proxy API requests to the backend at http://{your_ip}:8000.