Skip to content

Interactive C programming learning platform with online compiler, tutorials, and dynamic assignments. Built with React, Node.js, and MongoDB.

Notifications You must be signed in to change notification settings

Anish-2005/Programming-for-Problem-Solving-ES-CS291

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–₯️ C Programming Lab - Interactive Learning Platform

A comprehensive web-based C programming learning platform with an integrated compiler, interactive tutorials, and dynamic lab assignments.

C Programming Lab React Node.js MongoDB License

🌟 Overview

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.

🎯 Key Features

  • πŸ”§ 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

πŸ—οΈ Architecture

Frontend (React + Vite)

  • 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

Backend (Node.js + Express)

  • 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

External APIs

  • Judge0 API for C code compilation and execution
  • Secure API key management with environment variables

πŸš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (local or cloud instance)
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/Anish-2005/Programming-for-Problem-Solving-ES-CS291.git
    cd Programming-for-Problem-Solving-ES-CS291
  2. Setup Frontend

    cd c
    npm install
  3. Setup Backend

    cd ../c-backend
    npm install
  4. Environment Configuration

    Create .env file in the c-backend directory:

    MONGODB_URI=mongodb://localhost:27017/c-assignments
    VITE_ADMIN_PIN=your-admin-pin
    VITE_BACKEND_URL=http://localhost:3001
  5. Start the Development Servers

    Terminal 1 (Backend):

    cd c-backend
    node server.js

    Terminal 2 (Frontend):

    cd c
    npm run dev
  6. Access the Application

    • Frontend: http://localhost:5173
    • Backend API: http://localhost:3001

🎯 Platform Features

🏠 Landing Page

  • 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

πŸ“š Learn Page

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

πŸ”§ Online Compiler

  • 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

πŸ§ͺ Labs & Assignments

  • 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

πŸ“ Project Structure

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

πŸ”§ API Endpoints

Assignments Management

  • GET /api/c-assignments - Fetch all assignments
  • POST /api/c-assignments - Create new assignment
  • PUT /api/c-assignments/:id - Update assignment
  • DELETE /api/c-assignments/:id - Delete assignment

Assignment Structure

{
  "title": "Assignment Title",
  "icon": "FiTerminal",
  "problems": [
    {
      "question": "Problem statement",
      "code": "// Template code",
      "output": "Expected output"
    }
  ],
  "createdAt": "2024-01-01T00:00:00.000Z"
}

🎨 UI/UX Design

Color Scheme

  • Primary: Blue gradient (from-blue-50 to-cyan-50)
  • Accent: Cyan (cyan-400 to blue-500)
  • Text: Dark blue (blue-900)
  • Background: Light gradient with glassmorphism effects

Animations

  • 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

Icons

  • React Icons: Consistent iconography throughout the app
  • Feather Icons: Clean, modern icon style
  • Dynamic Icons: Admin-selectable icons for assignments

πŸ§‘β€πŸ’» For Educators

Admin Features

  • 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

Course Integration

  • 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

πŸš€ Deployment

Frontend (Vercel)

The frontend is configured for easy deployment on Vercel:

cd c
npm run build
# Deploy to Vercel

Backend (Railway/Heroku)

The backend is ready for deployment on cloud platforms:

cd c-backend
# Set environment variables
# Deploy to your preferred platform

Environment Variables

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

🀝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Areas for Contribution

  • 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

πŸ“± Mobile Experience

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

πŸ”’ Security Features

  • 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

πŸ“Š Performance

  • 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

πŸŽ“ Learning Path

Beginner Level

  1. Start with Landing Page: Understand the platform overview
  2. Explore Learn Page: Go through interactive tutorials
  3. Practice with Compiler: Write and run simple C programs
  4. Complete Basic Labs: Start with Unit 1-3 assignments

Intermediate Level

  1. Advanced Topics: Units 4-7 (Arrays, Algorithms, Functions, Recursion)
  2. Complex Programs: Multi-function programs with data structures
  3. Memory Management: Pointers and dynamic allocation
  4. File Operations: Reading and writing files

Advanced Level

  1. System Programming: Low-level programming concepts
  2. Advanced Data Structures: Linked lists, trees, graphs
  3. Algorithm Implementation: Sorting, searching, optimization
  4. Project Development: Complete C programming projects

πŸ“ž Support

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

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • 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

πŸ“ˆ Future Enhancements

  • 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

About

Interactive C programming learning platform with online compiler, tutorials, and dynamic assignments. Built with React, Node.js, and MongoDB.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published