PromptBase
Close icon
General
Home
Marketplace
Hire
Create
Login
Sell
Explore
πŸ€– GPT

Elearning Platform Developer

Elearning Platform Developer gpt prompt mini thumbnail
2Eye icon
Views
GPT-4O
TestedTick icon
TipsTick icon
4 examplesTick icon
Expert Developer for Crafting an E-Learning Platform
...more
$4.99
Get prompt
After purchasing, you will gain access to the prompt file which you can use with GPT or the app builder. You'll receive 20 free generation credits with this purchase. By purchasing this prompt, you agree to our terms of service.
2 weeks ago
Related item

Prompt Details

Model
Chat - GPT-4o (gpt-4o)
Token size
173 ($0.00865 / call)
Example input
[ audience type ]: High school students [ programming language ]: Python [ framework/library ]: Flask and React
Example output
Creating an e-learning platform for high school students with **Flask** (backend) and **React** (frontend) requires a systematic approach. Below is a detailed guide for each step: --- ## **1. Setting up a Modular and Scalable Project Structure** ### **Backend: Flask** Create the following structure for your Flask backend: ``` e_learning_backend/ β”‚ β”œβ”€β”€ app/ β”‚ β”œβ”€β”€ __init__.py # Application factory β”‚ β”œβ”€β”€ models.py # Database models β”‚ β”œβ”€β”€ routes/ β”‚ β”‚ β”œβ”€β”€ __init__.py # Blueprint initialization β”‚ β”‚ β”œβ”€β”€ course_routes.py # Course-related endpoints β”‚ β”‚ β”œβ”€β”€ user_routes.py # User-related endpoints β”‚ β”‚ β”œβ”€β”€ feedback_routes.py # Feedback endpoints β”‚ β”œβ”€β”€ services/ β”‚ β”‚ β”œβ”€β”€ auth_service.py # Authentication logic β”‚ β”‚ β”œβ”€β”€ course_service.py # Course-related business logic β”‚ β”œβ”€β”€ utils/ β”‚ β”‚ β”œβ”€β”€ helpers.py # Utility functions β”‚ β”‚ β”œβ”€β”€ validators.py # Data validation β”œβ”€β”€ migrations/ # Flask-Migrate scripts β”œβ”€β”€ config.py # Configuration settings β”œβ”€β”€ requirements.txt # Python dependencies β”œβ”€β”€ run.py # Entry point for the application ``` ### **Frontend: React** Create the following structure for your React frontend: ``` e_learning_frontend/ β”‚ β”œβ”€β”€ public/ # Static assets β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ components/ β”‚ β”‚ β”œβ”€β”€ Header.js # Navigation bar β”‚ β”‚ β”œβ”€β”€ Footer.js # Footer β”‚ β”œβ”€β”€ pages/ β”‚ β”‚ β”œβ”€β”€ Home.js # Homepage β”‚ β”‚ β”œβ”€β”€ CourseDetails.js # Detailed course page β”‚ β”‚ β”œβ”€β”€ Dashboard.js # User dashboard β”‚ β”œβ”€β”€ api/ β”‚ β”‚ β”œβ”€β”€ apiClient.js # Axios client for API requests β”‚ β”œβ”€β”€ App.js # Main component β”‚ β”œβ”€β”€ index.js # Entry point β”œβ”€β”€ package.json # JavaScript dependencies ``` --- ## **2. Designing the Database Schema** Use SQLAlchemy (with Flask) to define the schema. Below is an example: ```python from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(80), unique=True, nullable=False) email = db.Column(db.String(120), unique=True, nullable=False) password = db.Column(db.String(200), nullable=False) role = db.Column(db.String(20), nullable=False) # admin, instructor, learner class Course(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(120), nullable=False) description = db.Column(db.Text, nullable=False) instructor_id = db.Column(db.Integer, db.ForeignKey('user.id')) lessons = db.relationship('Lesson', backref='course', lazy=True) class Lesson(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(120), nullable=False) video_url = db.Column(db.String(200), nullable=False) course_id = db.Column(db.Integer, db.ForeignKey('course.id')) progress = db.relationship('Progress', backref='lesson', lazy=True) class Feedback(db.Model): id = db.Column(db.Integer, primary_key=True) content = db.Column(db.Text, nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('user.id')) course_id = db.Column(db.Integer, db.ForeignKey('course.id')) class Progress(db.Model): id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey('user.id')) lesson_id = db.Column(db.Integer, db.ForeignKey('lesson.id')) completed = db.Column(db.Boolean, default=False) ``` --- ## **3. Implementing User Roles and Secure Authentication** ### **Roles** - Use `role` in the `User` model for access control. ### **Authentication** Use Flask-Login for session management and Flask-JWT-Extended for token-based authentication. Example: ```python from flask_jwt_extended import JWTManager, create_access_token, jwt_required, get_jwt_identity app.config['JWT_SECRET_KEY'] = 'supersecretkey' # Replace with a secure key jwt = JWTManager(app) # Login Route @app.route('/login', methods=['POST']) def login(): data = request.get_json() user = User.query.filter_by(username=data['username']).first() if user and check_password_hash(user.password, data['password']): token = create_access_token(identity=user.id) return jsonify(token=token) return jsonify(message="Invalid credentials"), 401 ``` --- ## **4. Developing APIs** ### Example: Course Management APIs ```python @app.route('/courses', methods=['POST']) @jwt_required() def create_course(): current_user = get_jwt_identity() user = User.query.get(current_user) if user.role != 'instructor': return jsonify({"error": "Unauthorized"}), 403 data = request.get_json() new_course = Course( title=data['title'], description=data['description'], instructor_id=user.id ) db.session.add(new_course) db.session.commit() return jsonify({"message": "Course created"}), 201 ``` --- ## **5. Integrating Video Hosting** Use a service like **Cloudinary** or **AWS S3** for hosting. - Frontend: Use the **React Player** library for embedding videos. - Backend: Upload video files via API and store URLs in the `video_url` field of the `Lesson` model. --- ## **6. Adding Features: Quizzes, Certificates, and Forums** - **Quizzes**: Add a `Quiz` table linked to `Course`, and store questions and options. - **Certificates**: Generate certificates with libraries like `ReportLab` in Python. - **Forums**: Add a `Forum` table with threads and comments linked to `Course`. --- ## **7. Ensuring Responsive Design** Use **Material-UI** or **Tailwind CSS** for a responsive frontend. Test responsiveness on multiple devices. --- ## **8. Commenting and Future Scalability** - Add comments for each function and module explaining its purpose. - Future scalability: - Use **Celery** for task queues (e.g., sending emails). - Integrate a CI/CD pipeline for deployments. - Add support for multiple languages. Let me know if you'd like sample implementations of specific features or help setting up the development environment!
Browse Marketplace