The SIWES (Students Industrial Work Experience Scheme) API provides a platform for managing logbook entries for students undergoing their industrial training. It supports operations for creating, retrieving, updating, and deleting log entries associated with students, schools, departments, companies, and supervisors. This API is ideal for educational institutions, students, and companies participating in SIWES programs.
- Student Management: Add, update, retrieve, and delete student records.
- School Management: Manage school details.
- Department Management: Handle departmental information within schools.
- Company Management: Manage company profiles linked to student internships.
- Logbook Management: Students can create, retrieve, update, and delete entries in their logbooks based on their daily activities.
- Date Restrictions: Students can only fill the logbook for today and future dates.
- Overwrite Existing Entries: If a student fills the logbook for a date already filled, the API overwrites the existing entry with the new data.
- Search/Filter Functionality: Search for logs by based on date range and/or work status
- FastAPI: As the web framework for building APIs.
- SQLAlchemy: For ORM.
- SQLite: As the database for local development.
- Pydantic: For data validation.
- Python 3.8+
- pip
- Clone the repository
git clone https://github.com/Hordunlarmy/APIs
cd APIs/siwesAPI
- Set up a virtual environment (optional but recommended)
python3 -m venv venv
source venv/bin/activate # On Windows use venv\Scripts\activate
pip install -r requirements.txt
Create a file named .env in the root directory and add environment-specific variables:
database = sqlite:///./blog.db
Start the server with:
python3 main.py
This command starts the application with live reloading enabled, which is useful during development.
The application is structured around MVC architecture, where:
- Models are defined using SQLAlchemy ORM. These models represent User, Post, and Comment.
- Controllers (or routes) are defined in FastAPI. Each route handles specific logic for processing requests and returning responses.
- Views are represented by Pydantic models which validate and serialize request and response data.
For full documentation, visit http://localhost:8000/docs after starting the server. This will provide access to an interactive Swagger UI where you can test all API endpoints.
To run this project using Docker, run docker-compose up --build