A comprehensive, interactive learning platform for aspiring developers
Live Demo โข Documentation โข Contributing โข Report Bug
CodeLearnHub is a modern, full-stack educational platform designed to help developers learn programming through interactive tutorials, hands-on exercises, and real-world projects. The platform covers a wide range of topics from beginner-friendly programming fundamentals to advanced concepts in AI, data science, and software engineering.
- ๐ฏ Interactive Learning - Hands-on code examples with syntax highlighting and live execution
- ๐ Comprehensive Documentation - 200+ articles covering 7 major technology categories
- ๐ก Practice Exercises - 500+ coding exercises with hints, solutions, and test cases
- ๐ง Knowledge Quizzes - Interactive quizzes to test your understanding
- ๐ผ Interview Preparation - Curated interview questions for each topic
- ๐ Dark/Light Mode - Seamless theme switching for comfortable reading
- ๐ OAuth Authentication - Secure login with GitHub and Google
- ๐ Progress Tracking - Track your learning journey and achievements
- ๐ Notifications - Stay updated with new content and activities
- ๐ฑ Responsive Design - Beautiful UI on desktop, tablet, and mobile
| Technology | Purpose |
|---|---|
| React 19 | UI Framework with latest features |
| React Router 7 | Client-side routing |
| Tailwind CSS 3.4 | Utility-first styling |
| Framer Motion | Smooth animations |
| Radix UI | Accessible component primitives |
| React Syntax Highlighter | Code syntax highlighting |
| React Markdown | Markdown rendering |
| Lucide React | Beautiful icons |
| Sonner | Toast notifications |
| Technology | Purpose |
|---|---|
| FastAPI | High-performance Python API |
| MongoDB Atlas | Cloud database |
| Motor | Async MongoDB driver |
| PyJWT | JWT authentication |
| Authlib | OAuth integration |
| Uvicorn | ASGI server |
codelearn/
โโโ ๐ backend/
โ โโโ server.py # Main FastAPI application
โ โโโ article_generator.py # Article template system
โ โโโ seed_articles.py # Comprehensive seed data
โ โโโ requirements.txt # Python dependencies
โ โโโ uploads/ # User uploads directory
โ
โโโ ๐ frontend/
โ โโโ ๐ public/
โ โ โโโ index.html # HTML entry point
โ โ
โ โโโ ๐ src/
โ โ โโโ ๐ components/
โ โ โ โโโ ArticleComponents.jsx # Interactive article elements
โ โ โ โโโ Navbar.jsx # Navigation bar
โ โ โ โโโ Footer.jsx # Site footer
โ โ โ โโโ ProtectedRoute.jsx # Auth route wrapper
โ โ โ โโโ ๐ ui/ # Reusable UI components
โ โ โ โโโ button.jsx
โ โ โ โโโ card.jsx
โ โ โ โโโ dialog.jsx
โ โ โ โโโ ... (50+ components)
โ โ โ
โ โ โโโ ๐ context/
โ โ โ โโโ AuthContext.jsx # Authentication state
โ โ โ โโโ ThemeContext.jsx # Theme management
โ โ โ
โ โ โโโ ๐ pages/
โ โ โ โโโ HomePage.jsx # Landing page
โ โ โ โโโ DocumentationPage.jsx # Docs hub
โ โ โ โโโ DocArticlePage.jsx # Article viewer
โ โ โ โโโ DocCategoryPage.jsx # Category listing
โ โ โ โโโ ArticleAdminPage.jsx # Admin dashboard
โ โ โ โโโ CoursesPage.jsx # Courses catalog
โ โ โ โโโ ProjectsPage.jsx # Project showcase
โ โ โ โโโ ...
โ โ โ
โ โ โโโ ๐ services/
โ โ โ โโโ api.js # API client
โ โ โ
โ โ โโโ ๐ hooks/
โ โ โ โโโ use-toast.js # Toast hook
โ โ โ
โ โ โโโ ๐ lib/
โ โ โ โโโ utils.js # Utility functions
โ โ โ
โ โ โโโ App.js # Main app component
โ โ โโโ App.css # Global styles
โ โ โโโ index.js # React entry point
โ โ
โ โโโ ๐ plugins/
โ โ โโโ health-check/ # Health monitoring
โ โ โโโ visual-edits/ # Dev tools
โ โ
โ โโโ package.json
โ โโโ tailwind.config.js
โ โโโ craco.config.js
โ โโโ components.json
โ
โโโ ๐ tests/
โ โโโ __init__.py
โ
โโโ design_guidelines.json
โโโ README.md
- Node.js 18+ and npm/yarn
- Python 3.10+
- MongoDB Atlas account (or local MongoDB)
- Git
-
Clone the repository
git clone https://github.com/anilveersingh1308/codelearn.git cd codelearn -
Set up the Backend
cd backend # Create virtual environment python -m venv venv # Activate virtual environment # Windows: .\venv\Scripts\activate # macOS/Linux: source venv/bin/activate # Install dependencies pip install -r requirements.txt # Create .env file cp .env.example .env # Edit .env with your MongoDB URI and OAuth credentials
-
Set up the Frontend
cd frontend # Install dependencies npm install # Create .env file (optional) cp .env.example .env.local
-
Seed the Database
cd backend # Start the server python -m uvicorn server:app --reload --port 8001 # In another terminal, seed the articles curl -X POST http://localhost:8001/api/seed/articles
-
Start Development Servers
# Terminal 1 - Backend cd backend python -m uvicorn server:app --reload --port 8001 # Terminal 2 - Frontend cd frontend npm start
-
Access the Application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8001
- API Docs: http://localhost:8001/docs
# MongoDB
MONGO_URL=mongodb+srv://<username>:<password>@cluster.mongodb.net/
DB_NAME=codelearnhub
# JWT
JWT_SECRET=your-super-secret-key
JWT_ALGORITHM=HS256
# OAuth - GitHub
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
# OAuth - Google
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# App
FRONTEND_URL=http://localhost:3000
BACKEND_URL=http://localhost:8001REACT_APP_API_URL=http://localhost:8001/api
REACT_APP_ENV=development| Category | Topics | Description |
|---|---|---|
| ๐ป Programming Languages | Python, JavaScript, TypeScript, Java, C++ | Core language fundamentals |
| ๐ Web Development | React, Node.js, HTML/CSS, APIs | Full-stack web technologies |
| ๐ฑ Mobile Development | React Native, Flutter | Cross-platform mobile apps |
| ๐ Data Science & AI | Pandas, NumPy, Machine Learning | Data analysis and ML |
| ๐ค AI & Prompt Engineering | ChatGPT, LLMs, Prompt Design | AI communication skills |
| ๐งฎ Algorithms & DSA | Big O, Arrays, Trees, Graphs | Interview preparation |
| โ๏ธ Software Engineering | Git, Testing, System Design | Professional practices |
| โ๏ธ Cloud & DevOps | Docker, AWS, CI/CD | Deployment and infrastructure |
Each article includes:
- ๐ Rich Content - Markdown with syntax highlighting
- ๐ป Code Examples - Runnable code with explanations
- ๐๏ธ Practice Exercises - Hands-on challenges with solutions
- โ Knowledge Quiz - Test your understanding
- ๐ผ Interview Questions - Prepare for job interviews
- ๐ External Resources - Curated learning materials
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/auth/github |
Initiate GitHub OAuth |
| GET | /api/auth/google |
Initiate Google OAuth |
| GET | /api/auth/callback/{provider} |
OAuth callback |
| GET | /api/auth/me |
Get current user |
| POST | /api/auth/logout |
Logout user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/docs/articles |
List all articles |
| GET | /api/docs/articles/{slug} |
Get article by slug |
| GET | /api/docs/categories |
List all categories |
| GET | /api/docs/categories/{slug}/articles |
Articles by category |
| GET | /api/docs/search?q= |
Search articles |
| POST | /api/docs/articles/{slug}/quiz/submit |
Submit quiz answers |
| POST | /api/docs/articles/{slug}/helpful |
Submit feedback |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/seed/articles |
Seed article database |
| GET | /api/docs/stats |
Get documentation stats |
Built with Radix UI primitives and styled with Tailwind CSS:
- Accordion - Collapsible content sections
- Alert Dialog - Confirmation modals
- Avatar - User profile images
- Badge - Status indicators
- Button - Multiple variants and sizes
- Card - Content containers
- Carousel - Image/content sliders
- Command - Command palette
- Dialog - Modal dialogs
- Dropdown Menu - Action menus
- Form - Form validation with React Hook Form
- Navigation Menu - Site navigation
- Popover - Floating content
- Progress - Progress indicators
- Scroll Area - Custom scrollbars
- Select - Dropdown selects
- Skeleton - Loading placeholders
- Slider - Range inputs
- Switch - Toggle switches
- Tabs - Tabbed interfaces
- Toast - Notifications
- Tooltip - Hover information
- And many more...
# Run frontend tests
cd frontend
npm test
# Run backend tests
cd backend
pytestThis project uses a split deployment approach:
- Frontend โ Vercel (free tier available)
- Backend โ Render (free tier available)
-
Create a Render Account
- Go to render.com and sign up
- Connect your GitHub account
-
Create a New Web Service
- Click "New +" โ "Web Service"
- Connect your GitHub repository
- Configure the service:
Name: codelearnhub-backend Region: Oregon (US West) Branch: main Root Directory: backend Runtime: Python 3 Build Command: pip install -r requirements.txt Start Command: uvicorn server:app --host 0.0.0.0 --port $PORT
-
Add Environment Variables
- In the Render dashboard, go to Environment tab
- Add these variables:
Variable Value MONGO_URLYour MongoDB Atlas connection string DB_NAMEcodelearnhubFRONTEND_URLhttps://your-app.vercel.app(update after Vercel deploy)CORS_ORIGINShttps://your-app.vercel.appGITHUB_CLIENT_IDYour GitHub OAuth App Client ID GITHUB_CLIENT_SECRETYour GitHub OAuth App Secret GOOGLE_CLIENT_IDYour Google OAuth Client ID GOOGLE_CLIENT_SECRETYour Google OAuth Secret -
Deploy
- Click "Create Web Service"
- Wait for deployment (takes 2-5 minutes)
- Note your backend URL:
https://your-backend.onrender.com
-
Create a Vercel Account
- Go to vercel.com and sign up
- Connect your GitHub account
-
Import Project
- Click "Add New..." โ "Project"
- Select your GitHub repository
-
Configure Project
Framework Preset: Create React App Root Directory: frontend Build Command: npm run build (or yarn build) Output Directory: build Install Command: npm install (or yarn install) -
Add Environment Variables
- In the project settings, go to Environment Variables
- Add:
Variable Value REACT_APP_BACKEND_URLhttps://your-backend.onrender.comREACT_APP_ENVproduction -
Deploy
- Click "Deploy"
- Wait for deployment (takes 1-2 minutes)
- Your app is live at:
https://your-app.vercel.app
After getting your Vercel URL:
- Go back to Render dashboard
- Update
FRONTEND_URLandCORS_ORIGINSwith your Vercel URL - Redeploy the backend
GitHub OAuth:
- Go to GitHub Developer Settings
- Edit your OAuth App
- Update Authorization callback URL to:
https://your-backend.onrender.com/api/auth/callback/github
Google OAuth:
- Go to Google Cloud Console
- Edit your OAuth 2.0 Client
- Add to Authorized redirect URIs:
https://your-backend.onrender.com/api/auth/callback/google
After deployment, seed your database:
curl -X POST https://your-backend.onrender.com/api/seed/articlesOr visit: https://your-backend.onrender.com/docs and use the Swagger UI.
# Build and run with Docker Compose
docker-compose up --build- MongoDB Atlas cluster created and IP whitelist configured (allow 0.0.0.0/0 for cloud services)
- GitHub OAuth App created with correct callback URL
- Google OAuth App created with correct redirect URI
- Backend deployed to Render with all environment variables
- Frontend deployed to Vercel with REACT_APP_BACKEND_URL set
- Backend CORS updated with Vercel URL
- Database seeded with initial articles
- Test login with GitHub and Google
- Test all major features
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow the existing code style
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Be respectful and constructive
This project is licensed under the MIT License - see the LICENSE file for details.
- React - UI Framework
- FastAPI - Backend Framework
- Tailwind CSS - CSS Framework
- Radix UI - Component Primitives
- Lucide - Icons
- MongoDB Atlas - Database
- Framer Motion - Animations
Anil Singh - @anilveersingh1308
Project Link: https://github.com/anilveersingh1308/codelearn
โญ Star this repo if you find it helpful! โญ
Made with โค๏ธ by the CodeLearnHub Team