Overview
This guide walks you through setting up the complete development environment for the Calculus Learning Platform, including both the Vue 3 frontend and FastAPI backend.Prerequisites
Before you begin, ensure you have the following installed:Required Software
Node.js
Version 20.19.0+ or 22.12.0+
Python
Version 3.8+ recommended
PostgreSQL
Version 12+ recommended
Verify Installations
Check that you have the correct versions:Installation Steps
Install Frontend Dependencies
Navigate to the project root and install the Vue 3 frontend dependencies:This will install the following key packages:
- vue (3.5.22) - Core Vue framework
- vue-router (4.6.3) - Client-side routing
- vite (7.1.11) - Build tool and dev server
- axios (1.13.2) - HTTP client for API requests
- tailwindcss (4.1.16) - CSS framework
- @vitejs/plugin-vue - Vite plugin for Vue SFCs
Install Backend Dependencies
Navigate to the backend directory and install Python dependencies:Or using Python 3 explicitly:This installs:
- fastapi - Modern web framework for building APIs
- uvicorn - ASGI server for running FastAPI
- psycopg2-binary - PostgreSQL adapter for Python
- pydantic - Data validation using Python type hints
- python-multipart - For handling file uploads
Consider using a virtual environment to isolate dependencies:
Create Database Tables
Create the required database schema:
Forum 3 has a special table structure with additional columns for table data (
t6_r1_c1, t6_r1_c2, etc.).Forum 5 includes BYTEA columns for image storage: imagen_pregunta_3, imagen_1, imagen_2, imagen_3.Run the Backend Server
Start the FastAPI backend with Uvicorn:Or use the Python command directly:You should see output like:
Run the Frontend Server
In a new terminal, start the Vite development server:The frontend will start on
http://localhost:5173 (default Vite port):Access the Application
Open your browser and navigate to:You should see the login page. Test the installation by:
- Creating a test account
- Logging in
- Navigating to Forum 1
- Verifying the backend connection is working
The frontend makes API calls to the backend at the URL specified in the Vue components (currently
https://proyecto-ingenieria-software-6ccv.onrender.com). For local development, update these URLs to http://127.0.0.1:8000.Configuration
Update API Base URL
For local development, you’ll need to update API endpoints in the Vue components:src/views/Login.vue(line 277)src/views/foro_1.vue(line 394, 427, 462)- All other forum components
CORS Configuration
The backend is already configured to accept requests from any origin (line 16-22 inmain.py):
back/main.py
Building for Production
Frontend Build
dist/ directory.
Preview Production Build
Backend Deployment
For production deployment, run Uvicorn without the--reload flag:
Consider using a process manager like Supervisor or systemd for production deployments.
Troubleshooting
Frontend Issues
Error: Cannot find module 'vue'
Error: Cannot find module 'vue'
Make sure you’ve installed all dependencies:
Port 5173 already in use
Port 5173 already in use
Kill the process using that port or specify a different port:
API requests failing
API requests failing
Verify:
- Backend is running on port 8000
- API base URL is correct in Vue components
- No CORS errors in browser console
Backend Issues
Error: No module named 'fastapi'
Error: No module named 'fastapi'
Install Python dependencies:
Database connection error
Database connection error
Check:
- PostgreSQL is running
- Database credentials are correct in
main.py - Database exists and tables are created
Port 8000 already in use
Port 8000 already in use
Find and kill the process, or use a different port:
Development Workflow
Recommended Setup
-
Terminal 1: Run backend with auto-reload
-
Terminal 2: Run frontend with hot module replacement
- Terminal 3: Available for database commands, git, etc.
Code Structure
Next Steps
API Reference
Explore the FastAPI endpoints and data models
Quick Start
Get started using the platform