Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/FabianeloV/Metodo-simplex/llms.txt

Use this file to discover all available pages before exploring further.

Getting Simplex Optimizer running locally takes just a few minutes. The project is split into two independent services — a Python FastAPI backend and a React + TypeScript frontend — each with its own dependency installation and environment configuration. Follow the steps below to bring both up on your machine with full hot-reload support.

Prerequisites

Make sure the following tools are installed and available on your PATH before you begin:
ToolMinimum versionPurpose
Python3.11+Backend runtime
Node.js18+Frontend runtime
npmBundled with Node.jsFrontend package manager
gitAny recent versionCloning the repository

Backend Setup

1

Clone the repository

git clone https://github.com/FabianeloV/Metodo-simplex.git
cd Metodo-simplex
2

Create a virtual environment

A virtual environment keeps the backend dependencies isolated from your system Python installation.
cd backend
python -m venv .venv
3

Activate the virtual environment

source .venv/bin/activate
Your terminal prompt should now be prefixed with (.venv) to confirm activation.
4

Install Python dependencies

pip install -r requirements.txt
5

Configure environment variables

Copy the example file and edit it as needed. For a default local run no changes are required.
cp .env.example .env
6

Start the development server

uvicorn app.main:app --reload --port 8000
The --reload flag watches for source changes and automatically restarts the server.

Frontend Setup

1

Navigate to the frontend directory

Open a new terminal from the repository root (keep the backend terminal running).
cd frontend
2

Install Node.js dependencies

npm install
3

Configure environment variables

cp .env.example .env
Open .env and confirm (or set) the backend URL:
# URL del backend FastAPI (sin barra final)
VITE_API_URL=http://localhost:8000/api/v1
4

Start the development server

npm run dev
Vite starts a local server on port 5173 with Hot Module Replacement enabled.

Access Points

Once both servers are running, open the following URLs in your browser:
ServiceURL
React frontendhttp://localhost:5173
FastAPI backend (root)http://localhost:8000
Swagger UI (interactive docs)http://localhost:8000/docs
ReDochttp://localhost:8000/redoc
The Vite dev server is pre-configured to proxy any request beginning with /api to http://localhost:8000, so you can call backend endpoints directly from the browser without encountering CORS issues during development.

Environment Variables Reference

Backend (backend/.env)

VariableDefaultDescription
APP_HOST0.0.0.0Interface the Uvicorn server binds to
APP_PORT8000Port the backend listens on
APP_RELOADtrueEnables Uvicorn auto-reload on file changes
CORS_ORIGINShttp://localhost:5173,http://localhost:3000Comma-separated list of allowed CORS origins

Frontend (frontend/.env)

VariableDefaultDescription
VITE_API_URLhttp://localhost:8000/api/v1Base URL for all API requests (no trailing slash)

Health Check

After both servers are running, verify the backend is responding correctly:
curl http://localhost:8000/api/v1/simplex/health
You can also confirm the API root:
curl http://localhost:8000/
# {"message":"Optimización Simplex API","docs":"/docs"}

Common Issues

ModuleNotFoundError on backend start — Make sure your virtual environment is active (you should see (.venv) in your prompt) and that you ran pip install -r requirements.txt inside the backend/ directory.
Frontend shows a blank page or API errors — Double-check that VITE_API_URL in frontend/.env does not have a trailing slash and matches the port your backend is running on (http://localhost:8000/api/v1). Restart npm run dev after any .env change for Vite to pick up new values.
Port already in use — If port 8000 or 5173 is occupied, stop the conflicting process or change the port. For the backend, pass --port <NUMBER> to the uvicorn command and update VITE_API_URL accordingly. For the frontend, Vite will automatically suggest the next available port.

Build docs developers (and LLMs) love