The Class Schedule Service is a RESTful API that allows users to manage class schedules, teachers, and classes. It provides endpoints to create, retrieve, and delete class schedules, teachers, and classes.
- Python 3.8+
- PostgreSQL
- SQLAlchemy
- FastAPI
- Pydantic
-
Clone the repository:
git clone https://github.com/yourusername/class-schedule-service.git cd class-schedule-service
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
-
Set up the database:
- Create a PostgreSQL database.
- Update the
DATABASE_URL
in theconfig.py
file with your database credentials.
-
Run the database migrations:
alembic upgrade head
-
Start the FastAPI server:
uvicorn main:app --reload
-
Access the API documentation: Open your browser and navigate to
http://127.0.0.1:8000/docs
to view the interactive API documentation.
To run the tests, use the following command:
pytest