A comprehensive web application that teaches AI fundamentals through AI-generated interactive courses. Built with React frontend and Flask backend, featuring dynamic course creation powered by OpenAI.
- AI-Generated Content: Courses and lessons dynamically created using OpenAI GPT models
- Interactive Learning: Engaging course structure with sections and lessons
- Modern UI: Clean, responsive design built with React and Tailwind CSS
- Course Management: Create, browse, and manage AI courses
- Real-time Updates: Live course content generation and updates
- React 19 - Modern React with latest features
- Vite - Fast build tool and dev server
- Tailwind CSS 4 - Utility-first CSS framework
- React Router - Client-side routing
- Radix UI - Headless UI components
- Lucide React - Beautiful icons
- Axios - HTTP client
- Flask 3.1 - Python web framework
- SQLAlchemy - Database ORM
- SQLite - Local database
- OpenAI API - AI content generation
- Flask-CORS - Cross-origin resource sharing
- Python-dotenv - Environment variable management
AI-Powered-app-Teaching-AI-Fundamentals/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Main application pages
│ │ ├── services/ # API service layer
│ │ └── assets/ # Static assets
│ ├── public/ # Public static files
│ └── package.json # Frontend dependencies
├── backend/ # Flask backend API
│ ├── models/ # Database models
│ ├── routes/ # API route handlers
│ ├── services/ # Business logic services
│ ├── instance/ # Database files
│ └── requirements.txt # Backend dependencies
├── start-dev.sh # Development server startup script
├── setup.sh # Initial project setup script
└── build.sh # Production build script
- Node.js (v18+ recommended)
- Python (v3.8+ recommended)
- OpenAI API Key (for AI content generation)
-
Clone the repository
git clone <repository-url> cd AI-Powered-app-Teaching-AI-Fundamentals
-
Set up the backend
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Set up the frontend
cd frontend npm install
-
Environment Configuration
Create a
.env
file in the backend directory:SECRET_KEY=your-secret-key-here OPENAI_API_KEY=your-openai-api-key DATABASE_URL=sqlite:///courses.db
Quick Start (Recommended)
# Start both frontend and backend servers
./start-dev.sh
Manual Start
# Terminal 1: Backend
cd backend
source venv/bin/activate
python app.py
# Terminal 2: Frontend
cd frontend
npm run dev
Access the Application
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
# Build the application for production
./build.sh
cd frontend
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
cd backend
source venv/bin/activate
python app.py # Start Flask development server
GET /api/courses
- Retrieve all coursesPOST /api/courses
- Create a new courseGET /api/courses/{id}
- Get specific course detailsPOST /api/courses/{id}/generate-content
- Generate AI content for course
Variable | Description | Required |
---|---|---|
SECRET_KEY |
Flask secret key for sessions | Yes |
OPENAI_API_KEY |
OpenAI API key for content generation | Yes |
DATABASE_URL |
Database connection string | No (defaults to SQLite) |
The application uses SQLite by default with the following models:
- Course - Main course entity
- CourseSection - Course sections/chapters
- Lesson - Individual lessons within sections
Database is automatically created on first run.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Backend won't start
- Ensure Python virtual environment is activated
- Check that all dependencies are installed:
pip install -r requirements.txt
- Verify OpenAI API key is set in
.env
file
Frontend build fails
- Clear node modules:
rm -rf node_modules package-lock.json
- Reinstall dependencies:
npm install
- Check Node.js version (v18+ recommended)
Database errors
- Delete the database file:
rm backend/instance/courses.db
- Restart the backend to recreate tables
- Use the development script
./start-dev.sh
for optimal development experience - Enable React DevTools browser extension for debugging
- Monitor API requests in browser Network tab
- User authentication and profiles
- Course progress tracking
- Interactive quizzes and assessments
- Multi-language support
- Video content integration
- Advanced AI tutoring features
For questions or support, please open an issue on GitHub or contact the development team.
Happy Learning! 🎓🤖