Ensure the following are installed:
-
Python 3.8 or higher
- macOS:
brew install python3
- Fedora:
sudo dnf install python3 python3-pip
- Ubuntu:
sudo apt install python3 python3-pip
- macOS:
-
Node.js and npm
- macOS:
brew install node
- Fedora:
sudo dnf install nodejs npm
- Ubuntu:
sudo apt install nodejs npm
- macOS:
-
Redis
- macOS:
brew install redis
- Fedora:
sudo dnf install redis
- Ubuntu:
sudo apt install redis
Start Redis:
- macOS:
brew services start redis
- Fedora:
sudo systemctl start redis
- Ubuntu:
sudo systemctl start redis
- macOS:
-
Clone the repository:
git clone https://github.com/atakanakin/BrainRot.git cd BrainRot
-
Setup the backend environment:
cd backend python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Navigate to the
frontend
folder:cd frontend
-
Setup the frontend environment:
npm install
Ensure Redis is installed and running:
- macOS:
brew services start redis
- Fedora:
sudo systemctl start redis
- Ubuntu:
sudo systemctl start redis
Run the React frontend:
cd frontend
npm start
The frontend will be available at http://localhost:3000
.
Run the Celery worker and Flask backend in separate terminals:
cd backend
source venv/bin/activate
celery -A app.celery worker --loglevel=info
cd backend
source venv/bin/activate
python3 app.py
The backend will be available at http://localhost:5000
.
-
Separate Processes:
- The
celery
worker andpython app.py
need to be run in different terminals because both are blocking processes.
- The
-
Ensure Redis is Running:
- If Redis is not running, tasks queued by Celery will not be processed.
-
Default Ports:
- Frontend:
http://localhost:3000
- Backend:
http://localhost:5000
- Frontend:
-
If You Face Node.js Issues:
- Use the following command before running
npm start
:export NODE_OPTIONS=--openssl-legacy-provider
- Use the following command before running