2025-06-10 12:02:57 +08:00
2025-06-10 12:02:57 +08:00
2025-06-10 12:02:57 +08:00
2025-06-10 12:02:57 +08:00
2025-06-09 17:53:19 +08:00
2025-06-10 12:02:57 +08:00
2025-06-10 12:02:57 +08:00
2025-06-09 09:50:37 +00:00
2025-06-10 12:02:57 +08:00
2025-06-10 12:02:57 +08:00
2025-06-10 12:02:57 +08:00

SurfSmart

SurfSmart is a web application with a Flask backend and a React/Vite frontend.

Deployment Overview

  1. System packages

    sudo dnf install -y git python3.12 python3.12-virtualenv nodejs npm redis
    
  2. Clone the repository

    git clone <repo-url> /opt/surfsmart
    cd /opt/surfsmart
    

    Remove any bundled virtual environment if present:

    rm -rf backend_flask/flask
    
  3. 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
    
  4. Environment variables Create a .env file 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"
    
  5. Systemd services See surfsmart-backend.service and surfsmart-celery.service examples in the repository root for running Gunicorn and Celery as services.

  6. Build the React frontend

    cd frontend_react
    npm install
    npm run build
    

    The build artifacts will be located in frontend_react/dist.

  7. 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.

Description
No description provided
Readme 214 KiB
Languages
Python 62.4%
JavaScript 23.2%
CSS 10.3%
PowerShell 2.1%
C 1.1%
Other 0.8%