LitCode
🚀 Inspiration
Inspired by LeetCode, we envisioned a platform that transforms the solitary coding practice into an engaging and competitive experience.
💡 What It Does
LitCode allows users to create accounts and engage in 1v1 LeetCode-style battles over a LAN server. Here's how it works:
- Create an Account: Users sign up and authenticate seamlessly using Clerk.
- Queue Up: Select a topic and queue for a match.
- Matchmaking: The server pairs players based on their selected topics.
- Battle Mode: Both players receive the same coding question.
- Compete: Solve the problem with speed and correctness.
- Determine the Winner: The server evaluates the solutions based on program execution speed and accuracy to declare the winner.
Experience the thrill of coding competitions in real-time with friends or peers!
🛠️ How We Built It
- Backend: Built with Flask running on a LAN server to handle matchmaking and game logic.
- Frontend: Developed using Next.js for a responsive and dynamic client experience. -DB: MongoDB to store the questions, matches history, and user information
- UI/Design: Styled with TailwindCSS to ensure a beautiful and interactive user interface.
- Authentication: Implemented user creation and authentication seamlessly with Clerk.
- Code Evaluation: Utilized Judge0 API for code correctness and performance assessment.
⚔️ Challenges We Ran Into
- Server Development: Initial attempts with C++ for the server were unsuccessful, leading us to switch to Flask.
- Networking Issues: Configuring the server with ngrok didn't work as expected, prompting us to dive deeper into computer networking and LAN configurations.
- Feature Implementation: Attempting to create DSA visualizers for all questions proved challenging and didn't pan out.
- API Limitations: Faced rate limitations with the Judge0 API, requiring optimization and strategic API usage.
🏆 Accomplishments We're Proud Of
- Real-Time Multiplayer: Successfully enabling users to play against each other in real-time.
- Reliable Connectivity: Achieved a stable and quick connection between players on the LAN.
- Stunning UI/UX: Designed a beautiful and interactive interface that enhances user experience.
- Comprehensive Questions: Curated a rich set of coding questions covering various topics for diverse challenges.
📚 What We Learned
- Docker Containers: Leveraged Docker for managing Python interpreters effectively.
- LAN Setup with Flask: Gained expertise in setting up and managing LAN servers using Flask.
- TypeScript Visualizers: Learned to create dynamic visualizers for coding questions using TypeScript.
- State Management: Implemented state and data stores with Zustand and efficiently fetched data to components.
🔮 What's Next for LitCode
- Internet Hosting: Expand beyond LAN by hosting the platform over the internet for global accessibility.
- Enhanced Content: Add more coding questions and interactive features to enrich the user experience.
- Feature Enhancements: Introduce additional functionalities like leaderboards, user profiles, and more competitive modes.
- Elo and leaderboard sytem: Make it more competitive and create a community of DSA enjoyers!
🔗 Repository
📝 How to Use
- Sign Up: Create an account using your email.
- Select Topic: Choose the coding topic you want to battle in.
- Start Match: Queue up and wait for an opponent.
- Battle: Solve the given question as quickly and correctly as possible.
- Win: See who has the faster and more accurate solution!
Log in or sign up for Devpost to join the conversation.