Prerequisites
Before you begin, ensure you have:- Python 3.8 or higher installed
- pip package manager
- Basic understanding of REST APIs
Start the Server
Install Dependencies
Install all required packages from the requirements.txt file:Key dependencies include:
- FastAPI: Modern, fast web framework for building APIs
- Uvicorn: ASGI server for running FastAPI applications
- Pydantic: Data validation using Python type annotations
- OR-Tools: Google’s optimization tools for scheduling
Run the Development Server
Start the FastAPI server using Uvicorn:The server will start on
http://localhost:8000 with auto-reload enabled for development.The
--reload flag enables hot-reloading, automatically restarting the server when code changes are detected.Make Your First API Call
Let’s find available classrooms for a specific course and time slot.Check Available Classrooms
The most common operation is checking which classrooms are available for a course at a specific time. This endpoint applies all restrictions: capacity, compatibility, and availability.Understanding the Response
The API returns comprehensive information about available and unavailable classrooms:Key Response Fields:
aulas_disponibles: Classrooms that meet all requirements (capacity, type compatibility, time availability)aulas_no_disponibles: Classrooms that don’t meet requirements, with reasons whytotal_disponibles: Count of available classrooms
Reserve a Classroom
Once you’ve found an available classroom, reserve it for your course:Explore the API
Now that you have the basics working, explore more endpoints:Get Catalog Data
Retrieve all classrooms, courses, teachers, and resources
Manage Schedules
Create and manage complete semester schedules
View Reservations
List all classroom reservations and their status
API Documentation
Interactive API documentation (Swagger UI)
Interactive API Documentation
FastAPI automatically generates interactive API documentation. With your server running, visit:- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Next Steps
Installation Guide
Detailed setup instructions and configuration options
API Reference
Complete API endpoint documentation
Architecture
Learn about the system’s design patterns
Constraint Validation
Learn about the validation system
Common Issues
Port already in use
Port already in use
If port 8000 is already in use, specify a different port:
Module not found error
Module not found error
Ensure you’re running the command from the project root directory and all dependencies are installed:
Invalid time format error
Invalid time format error
Time must be in HH:MM format (24-hour). Valid examples: “08:00”, “14:30”, “23:59”
Invalid day error
Invalid day error
Day must be one of: Lunes, Martes, Miércoles, Jueves, Viernes, Sábado, Domingo