Sounds API is a comprehensive backend system built with Flask that powers an educational platform focused on language learning and pronunciation improvement. The system supports multi-role users (admins and clients), level-based content management, video lessons, exam systems, and detailed progress tracking.
- Multi-language Support: Full Arabic and English localization
- User Management: Registration, authentication, and role-based access control
- Level System: Structured learning levels with videos and exams
- Video Management: YouTube integration with progress tracking
- Question System: Interactive questions with answer validation
- Exam System: Initial and final exams with score tracking
- Progress Reporting: Detailed user progress reports in multiple formats
- Admin Dashboard: Comprehensive administration tools
- File Upload: Secure image upload for level covers
- Backend Framework: Flask
- Database: SQLAlchemy ORM with SQLite/PostgreSQL support
- Authentication: JWT tokens with Flask-JWT-Extended
- Security: Bcrypt for password hashing
- Localization: Custom multi-language support (English/Arabic)
- File Handling: Secure file uploads with UUID renaming
- Validation: Comprehensive input validation system
- Clone the repository:
git clone https://github.com/mahmoodhamdi/sounds_api.git
cd sounds_api
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables:
export SECRET_KEY='your-secret-key'
export JWT_SECRET_KEY='your-jwt-secret'
export DATABASE_URL='sqlite:///site.db' # or your PostgreSQL URL
- Initialize the database:
python app.py
Start the development server:
python app.py
The API will be available at http://localhost:5000
POST /register
- User registrationPOST /login
- User login (supports Google login)
GET /users/<id>
- Get user profilePATCH /users/<id>
- Update user informationGET /admin/users
- Get all users (admin only)DELETE /admin/users/<id>
- Delete user (admin only)
GET /levels
- Get all available levelsPOST /levels
- Create new level (admin only)PUT /levels/<id>
- Update level (admin only)DELETE /levels/<id>
- Delete level (admin only)
POST /levels/<id>/videos
- Add video to levelPOST /videos/<id>/questions
- Add question to videoPOST /questions/<id>/submit
- Submit question answer
POST /exams/<level_id>/initial
- Submit initial examPOST /exams/<level_id>/final
- Submit final exam
GET /report
- Get user progress report (markdown/JSON)GET /users/<id>/levels
- Get user's purchased levels
The API uses JWT tokens for authentication. Include the token in the Authorization header:
Authorization: Bearer <your_token>
The API supports English (en) and Arabic (ar) languages. Specify language using:
- Query parameter:
?lang=ar
- Form data:
lang=ar
- Header:
Accept-Language: ar
Key models include:
- User: User accounts with roles
- Level: Learning levels with pricing
- Video: YouTube videos with questions
- Question: Interactive questions
- UserLevel: User progress per level
- ExamResult: Exam scores and results
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Commit changes:
git commit -m 'Add feature'
- Push to branch:
git push origin feature-name
- Submit a pull request
This project is proprietary and confidential. All rights reserved.
Mahmood Hamdi
- Email: hmdy7486@gmail.com
- WhatsApp: +201019793768
- GitHub: mahmoodhamdi
For technical support or questions, please contact the developer directly via email or WhatsApp.