SurfSmart
SurfSmart is a web application with a Flask backend and a React/Vite frontend.
Deployment Overview
-
System packages
sudo dnf install -y git python3.12 python3.12-virtualenv nodejs npm redis -
Clone the repository
git clone <repo-url> /opt/surfsmart cd /opt/surfsmartRemove any bundled virtual environment if present:
rm -rf backend_flask/flask -
Create a Python virtual environment and install dependencies
python3.12 -m venv venv source venv/bin/activate pip install --upgrade pip pip install -r backend_flask/requirements.txt -
Environment variables Create a
.envfile and define at least the following:MONGO_URI="mongodb+srv://<user>:<pass>@cluster.mongodb.net/?retryWrites=true&w=majority" SECRET_KEY="replace_with_random_secret" FRONTEND_ORIGIN="https://surfsmart.tech" FLASK_CONFIG="production" CELERY_BROKER_URL="redis://localhost:6379/0" CELERY_RESULT_BACKEND="redis://localhost:6379/0" -
Systemd services See
surfsmart-backend.serviceandsurfsmart-celery.serviceexamples in the repository root for running Gunicorn and Celery as services. -
Build the React frontend
cd frontend_react npm install npm run buildThe build artifacts will be located in
frontend_react/dist. -
Nginx configuration Configure Nginx to serve the static frontend and proxy
/api/requests to Gunicorn running the Flask application.
This is only a brief outline. Adjust file paths and domain names to your environment.