-
video demonstration: https://drive.google.com/file/d/1HWKsy8HBT9FhZYVGBuIhp3AnNhtWNRFH/view?usp=sharing
-
linkto deployed website: https://basalt-tst.onrender.com/
-
link to deployed documentation: https://basalt-tst.onrender.com/docs/
Basalt is a platform for creating structured educational content, including lessons, quizzes, and questions. It features two-factor registration for secure user onboarding, password reset functionality, dynamic lesson generation, and text-to-speech (TTS) capabilities.
-
Two-Factor Registration: Users register with email verification to ensure secure account creation.*
-
Password Reset: Users can initiate a password reset process via email.*
-
User Authentication: Secure login and authentication using OAuth2 and JWT tokens.*
-
Create Lessons: Dynamically generate lessons with text and quizzes.
-
Manage Lessons: Update or delete lessons created by the user.
-
Lesson Audio: Automatically generate audio files for lessons using TTS.
-
Quizzes: Create, retrieve, update, and delete quizzes for lessons.
-
Questions: Add, edit, and delete questions in quizzes.
-
Submit Quiz: Evaluate quiz submissions and provide a summary of correct answers.
- FastAPI: High-performance web framework for building APIs.
- SQLAlchemy: SQL toolkit and ORM library for database management.
- Alembic: Database migration tool integrated with SQLAlchemy.
- Edge-TTS: Text-to-speech integration for audio generation.
- SQLite: Lightweight relational database for development.
.
├── README.md
├── alembic
│ ├── README
│ ├── env.py
│ ├── script.py.mako
│ └── versions
│ ├── 71cdd40d5af2_audio.py
│ └── fcf1cfbd25cf_fist_migration.py
├── alembic.ini
├── app
│ ├── config.py
│ ├── database
│ │ ├── base.py
│ │ └── models.py
│ ├── main.py
│ ├── repositories
│ │ ├── lessons.py
│ │ ├── questions.py
│ │ ├── quizzes.py
│ │ └── users.py
│ ├── routers
│ │ ├── auth.py
│ │ ├── generate.py
│ │ ├── lessons.py
│ │ ├── questions.py
│ │ └── quizzes.py
│ ├── schemas
│ │ ├── lessons.py
│ │ ├── questions.py
│ │ ├── quizzes.py
│ │ ├── users.py
│ │ └── verification_code.py
│ └── utils
│ ├── code_generator.py
│ ├── email_utils.py
│ ├── lesson_generator.py
│ ├── security.py
│ └── tts.py
├── requirements.txt
└── sql_app.db
9 directories, 32 files
-
Clone the Repository:
git clone https://github.com/dimalbek/basalt_tst.git cd basalt_tst
-
Set up a Virtual Environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Create .env File in the root directory and fill it with the following content:
# Email Configuration [email protected] MAIL_PASSWORD=your_email_password # JWT Settings ALGORITHM=HS256 ACCESS_TOKEN_EXPIRE_MINUTES=60 SECRET_KEY=your_secret_key # API Keys OPENAI_API_KEY=your_openai_api_key
-
Initialize the Database:
alembic upgrade head
-
Run the Application:
uvicorn app.main:app --reload
The API will now be accessible at http://127.0.0.1:8000 . You may check endpoints at http://127.0.0.1:8000/docs .
- POST /auth/users/register/initiate: Initiate user registration with email verification.
- POST /auth/users/register/confirm: Complete registration by verifying the email.
- POST /auth/users/login: Log in with email and password to obtain a JWT token.
- POST /auth/users/password-reset/initiate: Start the password reset process by sending a verification code to the email.
- POST /auth/users/password-reset/confirm: Complete password reset using the verification code.
- POST /lessons: Create a new lesson for the current user.
- GET /lessons: Retrieve all lessons for the current user.
- GET /lessons/{lesson_id}: Retrieve a specific lesson by ID.
- PUT /lessons/{lesson_id}: Update a specific lesson by ID.
- DELETE /lessons/{lesson_id}: Delete a specific lesson by ID.
- GET /lessons/{lesson_id}/audio: Retrieve the audio file for a lesson.
- POST /quizzes: Create a new quiz for a lesson.
- GET /quizzes/{quiz_id}: Retrieve a specific quiz by ID.
- PUT /quizzes/{quiz_id}: Update a specific quiz by ID.
- DELETE /quizzes/{quiz_id}: Delete a specific quiz by ID.
- POST /quizzes/{quiz_id}/submit: Submit answers for a quiz and evaluate results.
- POST /questions: Add a new question to a quiz.
- GET /questions/{question_id}: Retrieve a specific question by ID.
- PUT /questions/{question_id}: Update a specific question by ID.
- DELETE /questions/{question_id}: Delete a specific question by ID.
Developed by Dinmukhamed Albek.