A comprehensive web-based C programming learning platform with an integrated compiler, interactive tutorials, and dynamic lab assignments.
The C Programming Lab is a modern, interactive web application designed to revolutionize how students learn C programming. This platform combines theoretical concepts with hands-on practice through an integrated online compiler, dynamic lab assignments, and comprehensive tutorials.
- π§ Online C Compiler: Write, compile, and run C programs directly in your browser
- π Interactive Learning Modules: Step-by-step tutorials with live code examples
- π§ͺ Dynamic Lab Assignments: Admin-manageable assignments with automatic grading
- π¨ Modern UI/UX: Beautiful, responsive interface built with React and Framer Motion
- π± Mobile-Friendly: Fully responsive design for learning on any device
- π Admin Panel: Secure assignment management with PIN-based authentication
- Modern React 19 with functional components and hooks
- Framer Motion for smooth animations and transitions
- React Router for seamless navigation
- Tailwind CSS for responsive styling
- React Icons for consistent iconography
- Express.js server with RESTful API design
- MongoDB with Mongoose for data persistence
- CORS enabled for cross-origin requests
- Helmet for security headers
- Compression for optimized responses
- Judge0 API for C code compilation and execution
- Secure API key management with environment variables
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- Git
-
Clone the repository
git clone https://github.com/Anish-2005/Programming-for-Problem-Solving-ES-CS291.git cd Programming-for-Problem-Solving-ES-CS291
-
Setup Frontend
cd c npm install
-
Setup Backend
cd ../c-backend npm install
-
Environment Configuration
Create
.env
file in thec-backend
directory:MONGODB_URI=mongodb://localhost:27017/c-assignments VITE_ADMIN_PIN=your-admin-pin VITE_BACKEND_URL=http://localhost:3001
-
Start the Development Servers
Terminal 1 (Backend):
cd c-backend node server.js
Terminal 2 (Frontend):
cd c npm run dev
-
Access the Application
- Frontend:
http://localhost:5173
- Backend API:
http://localhost:3001
- Frontend:
- Hero Section: Animated introduction to C programming
- Feature Highlights: System programming, algorithms, and secure coding
- Live Code Snippets: Rotating examples of C code
- Navigation: Easy access to all platform features
Interactive tutorials covering:
- Pointers & Memory Management: Dynamic allocation, malloc/free
- Arrays & Strings: Data structures and string manipulation
- Structures & Unions: Complex data types
- File I/O Operations: Reading and writing files
- Control Structures: Loops, conditionals, and flow control
- Real-time Compilation: Using Judge0 API
- Syntax Highlighting: Enhanced code editor
- Error Handling: Detailed compilation and runtime error messages
- Output Display: Clean, formatted program output
- Example Programs: Pre-loaded templates to get started
- Dynamic Assignment Management: Admin can create, edit, and delete assignments
- Multi-Problem Structure: Each assignment can contain multiple coding problems
- Icon-based Organization: Visual categorization of assignments
- Responsive Design: Works seamlessly on desktop and mobile
- Secure Admin Access: PIN-based authentication for assignment management
Programming-for-Problem-Solving-ES-CS291/
βββ c/ # Frontend React Application
β βββ src/
β β βββ pages/
β β β βββ Landing.jsx # Home page with hero section
β β β βββ LearnPage.jsx # Interactive tutorials
β β β βββ Compiler.jsx # Online C compiler
β β β βββ Lab.jsx # Lab assignments management
β β βββ App.jsx # Main app component with routing
β β βββ main.jsx # Application entry point
β βββ public/
β β βββ pps.png # Application logo
β βββ package.json # Frontend dependencies
β βββ vite.config.js # Vite configuration
βββ c-backend/ # Backend Node.js Application
β βββ server.js # Express server and API routes
β βββ models/
β β βββ CAssignment.js # MongoDB schema for assignments
β βββ package.json # Backend dependencies
β
βββ README.md # This file
GET /api/c-assignments
- Fetch all assignmentsPOST /api/c-assignments
- Create new assignmentPUT /api/c-assignments/:id
- Update assignmentDELETE /api/c-assignments/:id
- Delete assignment
{
"title": "Assignment Title",
"icon": "FiTerminal",
"problems": [
{
"question": "Problem statement",
"code": "// Template code",
"output": "Expected output"
}
],
"createdAt": "2024-01-01T00:00:00.000Z"
}
- Primary: Blue gradient (
from-blue-50 to-cyan-50
) - Accent: Cyan (
cyan-400
toblue-500
) - Text: Dark blue (
blue-900
) - Background: Light gradient with glassmorphism effects
- Framer Motion: Smooth page transitions and micro-interactions
- Loading States: Elegant loading indicators
- Hover Effects: Interactive button and card animations
- Responsive Transitions: Optimized for all screen sizes
- React Icons: Consistent iconography throughout the app
- Feather Icons: Clean, modern icon style
- Dynamic Icons: Admin-selectable icons for assignments
- Secure Access: PIN-based authentication
- Assignment CRUD: Create, read, update, delete assignments
- Multi-Problem Support: Add multiple coding problems per assignment
- Icon Selection: Choose from various icons for visual organization
- Real-time Updates: Changes reflect immediately for students
- Structured Units: 10 comprehensive units covering all C programming topics
- Progressive Learning: From basic syntax to advanced concepts
- Hands-on Practice: Every unit includes practical exercises
- Assessment Ready: Built-in assignment system for evaluation
The frontend is configured for easy deployment on Vercel:
cd c
npm run build
# Deploy to Vercel
The backend is ready for deployment on cloud platforms:
cd c-backend
# Set environment variables
# Deploy to your preferred platform
MONGODB_URI=your-mongodb-connection-string
VITE_ADMIN_PIN=your-secure-admin-pin
VITE_BACKEND_URL=your-backend-url
RAPIDAPI_KEY=your-judge0-api-key
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- New Learning Modules: Add more C programming topics
- UI/UX Improvements: Enhance the user interface
- Performance Optimization: Improve loading times and responsiveness
- Mobile Features: Add mobile-specific enhancements
- Testing: Add unit and integration tests
The platform is fully responsive and provides an excellent mobile experience:
- Touch-friendly Interface: Optimized for mobile interactions
- Responsive Code Editor: Works seamlessly on mobile devices
- Adaptive Layout: Content reflows perfectly on all screen sizes
- Mobile Navigation: Hamburger menu and touch gestures
- Input Validation: All user inputs are validated and sanitized
- CORS Configuration: Proper cross-origin resource sharing setup
- Helmet Integration: Security headers for protection
- PIN-based Authentication: Secure admin access
- Environment Variables: Sensitive data stored securely
- Vite Build Tool: Lightning-fast development and build processes
- Code Splitting: Optimized bundle size with lazy loading
- Compression: Gzip compression for faster loading
- Efficient Animations: Hardware-accelerated animations with Framer Motion
- Optimized Images: Properly sized and compressed assets
- Start with Landing Page: Understand the platform overview
- Explore Learn Page: Go through interactive tutorials
- Practice with Compiler: Write and run simple C programs
- Complete Basic Labs: Start with Unit 1-3 assignments
- Advanced Topics: Units 4-7 (Arrays, Algorithms, Functions, Recursion)
- Complex Programs: Multi-function programs with data structures
- Memory Management: Pointers and dynamic allocation
- File Operations: Reading and writing files
- System Programming: Low-level programming concepts
- Advanced Data Structures: Linked lists, trees, graphs
- Algorithm Implementation: Sorting, searching, optimization
- Project Development: Complete C programming projects
If you encounter any issues or have questions:
- GitHub Issues: Report bugs and feature requests
- Documentation: Check this README for detailed information
- Community: Join discussions in the repository
- Email: Contact the maintainers for urgent issues
This project is licensed under the MIT License - see the LICENSE file for details.
- Judge0 API: For providing the online C compilation service
- React Community: For the amazing frontend framework
- MongoDB: For the flexible database solution
- Framer Motion: For beautiful animations
- Vercel: For seamless deployment platform
- AI-Powered Code Review: Automated code feedback and suggestions
- Collaborative Coding: Real-time code collaboration features
- Advanced Analytics: Progress tracking and performance metrics
- Mobile App: Native iOS and Android applications
- Multi-language Support: Support for C++, Java, Python
- Video Tutorials: Integrated video learning content
- Gamification: Badges, achievements, and leaderboards
Happy Coding! π
Made with β€οΈ by Anish