Backwell API is a robust application designed to create optimal schedule combinations for students by leveraging two powerful microservices: a Rust-based scheduling engine and a Django backend for managing courses and instructors.
- 🌟 Features
- 📦 Technologies Used
- 🔧 Installation
- 🚀 Running the Application
- 🛠️ Services Overview
- 📚 API Endpoints
- 📄 Example Usage
- 📝 Contributing
- 📜 License
- 📫 Contact
- Microservices Architecture: Separates scheduling logic and course management for scalability.
- Rust Performance: Utilizes Rust's
actix-web
framework for high-performance API operations. - Django Backend: Manages courses, professors, subjects, and classrooms efficiently.
- Dockerized Setup: Simplifies deployment and environment consistency.
- JSON-Based API: Easy integration with other systems and services.
- Rust 🦀
- Django 🐍
- Docker 🐳
- Actix-web 🔗
- PostgreSQL 🐘
Before getting started, ensure you have the following installed on your system:
- Git - Version control system
- Docker - Containerization platform
- Docker Compose - Tool for defining and running multi-container Docker applications
-
Clone the Repository
git clone https://github.com/your-username/backwell-api.git cd backwell-api
-
Download Docker
If you haven't installed Docker yet, follow the official Docker installation guide for your operating system.
-
Build and Run the Containers
docker-compose up --build
This command will build the Docker images and start the containers for both the Rust API and Django backend.
-
Verify Services are Running
Ensure that the following services are up and running:
- Web-1 (Django Backend)
- DB-1 (PostgreSQL Database)
- Rust App (Backwell API)
You can verify by checking the Docker containers:
docker ps
-
Access the Services
- Django Backend: http://localhost:8001
- Rust API: https://localhost:8082
Once the Docker containers are up and running, the microservices can be accessed via the following ports:
- Django Backend API:
http://localhost:8001
- Rust Scheduling API:
https://localhost:8082
You can interact with the APIs using tools like Postman or cURL.
Backwell API is built using Rust and the actix-web
framework. It is responsible for generating class schedules based on available courses and professors.
- Endpoint:
/generate_schedule
- Method:
POST
- Purpose: Generates compatible schedule groupings based on the provided course data.
Key Features:
- High-performance scheduling algorithms
- Secure communication with the Django backend
- JSON-based request and response handling
The Django backend manages the core data for the application, including courses, professors, subjects, and classrooms. It provides RESTful endpoints for data retrieval and management.
Key Features:
- CRUD operations for courses, professors, subjects, and classrooms
- Admin interface for easy data management
- Integration with the Rust API for scheduling
- URL:
https://localhost:8082/v1/api/generate_schedule
- Method:
POST
- Description: Generates schedule combinations based on selected courses.
Request Body Example:
{
"courses": ["Ética", "Persona y sociedad"],
"minimum": 1
}
The Django backend provides several endpoints to manage courses and related entities:
- Courses:
http://localhost:8001/api/cursos
- Professors:
http://localhost:8001/api/profesores
- Subjects:
http://localhost:8001/api/materias
- Classrooms:
http://localhost:8001/api/salones
Each endpoint supports GET
, POST
, PUT
, and DELETE
methods for comprehensive data management.
Use the following cURL
command to generate a schedule:
curl -X POST https://localhost:8082/v1/api/generate_schedule \
-H "Content-Type: application/json" \
-d '{
"courses": ["Mathematics", "Physics"],
"minimum": 2
}'
Expected Response:
{
"schedule_groups": [
[
{
"id": 1,
"materia": {"id": 101, "codigo": "MATH101", "nombre": "Mathematics", "no_de_catalogo": "101"},
"profesor": {"id": 5, "nombre": "Dr. Smith"},
"salon": {"id": 10, "nombre": "Room A", "capacidad": 30},
"hora_inicio": "08:00",
"hora_fin": "10:00",
"lunes": true,
"martes": false,
"miércoles": true,
"jueves": false,
"viernes": true
},
...
],
...
]
}
This response provides groups of compatible course schedules, ensuring no conflicts in timings, instructors, or classrooms.
Contributions are welcome! Please follow these steps to contribute:
-
Fork the Repository
-
Create a New Branch
git checkout -b feature/YourFeatureName
-
Commit Your Changes
git commit -m "Add some feature"
-
Push to the Branch
git push origin feature/YourFeatureName
-
Open a Pull Request
Please ensure your code follows the project's coding standards and includes appropriate tests.
This project is licensed under the MIT License.
For any inquiries or support, please contact:
- Email: isiguenza@up.edu.mx
- GitHub: @JavierRangel2004
✨ Empowering students with optimized scheduling solutions! ✨