Development Tools & Run Guide - FEUP-MEIC-DS-2025-26/madeinportugal.store GitHub Wiki
🚀 Development Tools & Run Guide
This section is a step-by-step guide on how to setup and run our application.
Development Tools
Tools Used in the Project
Frontend:
- Node.js & npm (package manager)
- Vite (build tool)
- Vitest (test runner)
Backend:
- Python 3.x
- pip (package manager)
- FastAPI (web framework)
- pytest (test runner)
Both:
- Docker (used to test the full flow before deployment)
Preparing the Development Environment
In order to run the application, some dependencies are required and should be installed in the system. These dependencies include:
- Node.js (v16 or higher);
- npm;
- Python 3.8+;
- pip.
Frontend Development Server
The following commands should be run from the project base directory in order to setup the frontend application:
cd frontend
npm install
npm run dev
The frontend will be available at http://localhost:5173
Backend Development Server
To setup the backend a few more commands are needed. These should be used in a different terminal:
cd backend
# Create and activate a virtual environment (recommended)
python -m venv venv
.\venv\Scripts\Activate # On Windows PowerShell
# source venv/bin/activate # On Linux/Mac
# Install dependencies
pip install -r requirements.txt
# Start the server
uvicorn app.main:app --reload --host 127.0.0.1 --port 8000
The backend API will be available at http://localhost:8000
Production Build (via Docker)
To build and run the application using Docker:
# Frontend
cd frontend
docker build -t vendor-frontend .
docker run -p 5173:5173 vendor-frontend
# Backend
cd backend
docker build -t vendor-backend .
docker run -p 8000:8000 vendor-backend
Deployment is handled automatically when merging into the main branch.
API Documentation, Formats, and Protocols
Backend API:
- Endpoints are defined in routes.py and vendors.py.
- Uses REST and JSON formats.
Frontend–Backend Communication:
- HTTP requests using REST, with JSON payloads.
Environment Variables:
- Each module may include a .env file containing runtime configuration variables, such as API URLs or secrets.
Backend .env Example
# -----------------------------
# Jumpseller API Configuration
# -----------------------------
JUMPSELLER_LOGIN=my_store_login
JUMPSELLER_AUTH_TOKEN=jsl_123456789abcdef
JUMPSELLER_API_BASE_URL=https://api.jumpseller.com/v1
JUMPSELLER_API_TIMEOUT=30
# -----------------------------
# Database Configuration
# -----------------------------
DATABASE_URL=postgresql://admin:securepassword@db:5432/vendors_db
# -----------------------------
# Internal API Integrations
# -----------------------------
CREATE_SELLER_URL=https://madeinportugal.store/api/create-vendor
ADD_PRODUCT_PAGE_URL=https://madeinportugal.store/admin/add-product
# -----------------------------
# Frontend Application URL
# -----------------------------
FRONTEND_URL=https://madeinportugal.store
# -----------------------------
# Application Settings
# -----------------------------
APP_NAME="Vendor Application"
DEBUG=False
Frontend .env Example
VITE_API_URL=https://api.madeinportugal.store