Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/lffiesco-svg/gastromovil/llms.txt

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

Getting GastroMóvil running on your local machine takes about ten minutes. The application uses Daphne as its ASGI server (instead of the usual runserver) because Django Channels requires a real ASGI runtime to handle WebSocket connections for real-time order tracking and driver dispatch. Follow the steps below to go from a fresh clone to a fully functional local instance.
GastroMóvil uses channels.layers.InMemoryChannelLayer as its default channel layer, which is configured in settings.py. This means you do not need a Redis server for local development — WebSocket messages are routed in-process. The InMemoryChannelLayer is not suitable for production multi-worker deployments, but it works perfectly for a single local process.

Prerequisites

Before you begin, make sure you have the following available on your machine:
  • Python 3.11 or newer — GastroMóvil targets Python 3.11+; check with python --version.
  • MySQL — A locally running MySQL instance with permission to create databases.
  • Cloudinary account — Free tier is sufficient; you will need your cloud name, API key, and API secret.
  • Resend account — A free Resend account provides the API key for transactional email (verification codes, password recovery).
  • Groq API key — Sign up at console.groq.com to obtain a key for the LangChain-powered AI chatbot.

1

Clone the repository

Clone the GastroMóvil repository and navigate into the project root:
git clone https://github.com/lffiesco-svg/gastromovil.git
cd gastromovil
2

Create and activate a virtual environment

Create a Python virtual environment to isolate the project’s dependencies from your system Python:
python -m venv .venv
Then activate it:
# macOS / Linux
source .venv/bin/activate

# Windows (PowerShell)
.venv\Scripts\Activate.ps1
3

Install Python dependencies

Install all required packages from the pinned requirements file:
pip install -r requirements.txt
This installs Django 6.0.3, Daphne 4.2.1, Django Channels 4.3.2, Django REST Framework 3.17.0, SimpleJWT 5.5.1, LangChain-Groq 1.1.2, django-allauth 65.15.1, PyMySQL 1.1.2, cloudinary, django-cloudinary-storage, WhiteNoise 6.12.0, django-tailwind 4.4.2, Resend 2.30.1, and all their transitive dependencies.
4

Create a .env file

GastroMóvil reads configuration from a .env file in the project root via python-dotenv and python-decouple. Create the file and populate every variable:
# Django core
SECRET_KEY=your-long-random-secret-key-here
DEBUG=True

# MySQL database
DB_NAME=gastromovil_dev
DB_USER=root
DB_PASSWORD=your_mysql_password
DB_HOST=127.0.0.1
DB_PORT=3306

# Email (SMTP via Gmail — used for password recovery)
EMAIL_HOST_PASSWORD=your_gmail_app_password

# Contact form email password
CONTACTO_EMAIL_PASSWORD=your_contact_email_password

# Resend (transactional email API)
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxx

# Cloudinary (media storage)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

# Groq (LangChain AI chatbot)
GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxx
Set USE_DB_SSL=False (or simply omit it — the default is False) when connecting to a local MySQL instance. Railway’s hosted MySQL requires USE_DB_SSL=True because it enforces TLS connections; omitting SSL locally avoids certificate validation errors against 127.0.0.1.
5

Run database migrations

Make sure your local MySQL server is running and the database named in DB_NAME exists, then apply all migrations:
# Create the database first (run once)
mysql -u root -p -e "CREATE DATABASE gastromovil_dev CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

# Apply migrations
python manage.py migrate
6

Create a superuser

Create an admin account to access the Django admin panel at /admin/:
python manage.py createsuperuser
Enter a username, email address, and password when prompted. You can then log into /admin/ to manage restaurants, users, and orders.
7

Build Tailwind CSS

GastroMóvil uses the django-tailwind package to compile its Tailwind CSS stylesheet. Run the build command before starting the server so that all styles are available:
python manage.py tailwind build
This compiles the Tailwind configuration from the theme app and outputs the production CSS into the static directory.
8

Start the Daphne ASGI server

GastroMóvil must be served by Daphne (not Django’s built-in runserver) because Django Channels requires a real ASGI process to accept WebSocket connections. Start it with:
daphne -b 0.0.0.0 -p 8000 gastromovil.asgi:application
Daphne will load gastromovil/asgi.py, which wires HTTP traffic to get_asgi_application() and WebSocket traffic to the pedidos and repartidores channel routing tables behind AuthMiddlewareStack.
9

Open the application

Navigate to http://localhost:8000 in your browser. You should see the GastroMóvil homepage. The Django admin is available at http://localhost:8000/admin/.Key URLs to explore:
URLDescription
/Homepage — restaurant listing
/admin/Jazzmin-powered Django admin
/usuarios/login/Login page
/register/Customer registration
/panel/Staff admin panel
/panel-restaurante/Restaurant owner dashboard
/panel-repartidor/Driver dispatch panel
/api/login/JWT token endpoint (POST)
/api/pedidos/Orders REST API

Build docs developers (and LLMs) love