SocraticCode is an AI-powered coding tutor that teaches programming through guided hints and step-by-step problem solving. Instead of giving you the answer directly, it provides hints at three different levels to help you learn and understand the solution process.
-
Three-Level Hint System:
- Level 1: Conceptual questions to guide your thinking
- Level 2: Stepwise algorithmic instructions
- Level 3: Detailed pseudocode with examples
-
Progressive Learning: Hints unlock as you progress through levels
-
Session Tracking: Your progress is saved as you work through problems
-
Multiple Programming Languages: Support for JavaScript, Python, Java, C++, and more
-
Problem Categories: Algorithms, Data Structures, Arrays, Strings, Math, etc.
-
Difficulty Levels: Beginner, Intermediate, Advanced
- Frontend: React with TypeScript
- Backend: Node.js with Express
- Database: MongoDB with Mongoose
- Styling: CSS3 with modern design
- Node.js (v14 or higher)
- MongoDB (local installation or MongoDB Atlas)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd CalHacks
-
Install dependencies
# Install root dependencies npm install # Install backend dependencies cd server npm install # Install frontend dependencies cd ../client npm install
-
Set up environment variables
Create a
.envfile in theserverdirectory:PORT=4001 MONGODB_URI=mongodb://localhost:27017/socraticcode NODE_ENV=development
-
Start MongoDB
Make sure MongoDB is running on your system:
# If using local MongoDB mongod # Or if using MongoDB Atlas, update the MONGODB_URI in .env
-
Seed the database
cd server npm run seed -
Start the application
# From the root directory npm run dev # Or start them separately: # Terminal 1 - Backend cd server && npm run dev # Terminal 2 - Frontend cd client && npm start
- Browse Problems: Visit
http://localhost:3000to see available problems - Filter Problems: Use the filter options to find problems by difficulty, language, or category
- Start Learning: Click "Start Problem" to begin working on a problem
- Request Hints: Use the hint buttons to get guided help:
- Start with Level 1 for conceptual guidance
- Progress to Level 2 for algorithmic steps
- Use Level 3 for detailed pseudocode
- Write Code: Use the code editor to implement your solution
- Submit Solution: Submit your code when ready
GET /api/problems- Get all problems (with optional filters)GET /api/problems/:id- Get a specific problemPOST /api/problems- Create a new problem (admin)
GET /api/hints/:problemId/:level- Get hint for specific levelGET /api/hints/:problemId- Get all hints for a problem
POST /api/sessions- Create a new sessionGET /api/sessions/:sessionId- Get session detailsPUT /api/sessions/:sessionId- Update session (record hints, attempts)
CalHacks/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ ├── types/ # TypeScript types
│ │ └── ...
├── server/ # Node.js backend
│ ├── models/ # MongoDB models
│ ├── routes/ # API routes
│ ├── middleware/ # Express middleware
│ └── ...
└── package.json # Root package.json
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
- Code execution and testing
- User authentication and profiles
- Progress tracking and analytics
- More programming languages
- Mobile app version
- Collaborative problem solving
- AI-powered hint generation