Skip to content

ArushKhasru/cuhp-devs

 
 

Repository files navigation

CUHP Devs

Next.js React Express Socket.IO MongoDB Turbo pnpm

CUHP Devs is a coding practice and student developer community platform organized as a Turbo + pnpm monorepo. It combines a Next.js frontend, an Express API, a Socket.IO realtime service, MongoDB-backed shared data models, and a local problem pipeline for coding challenges with generated multi-language boilerplate.

The repository is no longer a generic Turborepo starter. It already contains implemented flows for authentication, onboarding/profile setup, dashboard views, problem practice, realtime chat rooms, community posts/snippets, resources, settings, and public developer profiles.

Overview

Note

A student developer platform that combines coding practice, public profiles, community interaction, realtime chat, and curated learning resources in one monorepo.

Architecture

apps/
  web/             Next.js frontend
  http-backend/    Express REST API
  socket/          Socket.IO realtime service
  problems/        Local problem statements, testcases, and generated boilerplate
packages/
  ui/                    Shared UI components
  db/                    Shared Mongoose models, schemas, and DB scripts
  common/                Shared common package
  boilerplate-generator/ Problem boilerplate generation package
  eslint-config/         Shared lint config
  typescript-config/     Shared tsconfig presets

Apps

Web App

Next.js Zustand Framer Motion Socket.IO Client

  • Built with Next.js App Router and React 19.
  • Uses server components and client components together.
  • Fetches backend data through shared API helpers.
  • Uses Zustand for auth, onboarding, theme, sidebar, and toast state.
  • Uses Framer Motion for animated transitions and richer UI behavior.
  • Uses socket.io-client for realtime community chat features.

HTTP Backend

Express Zod JWT

  • Built with Express + TypeScript.
  • Exposes REST endpoints for auth, users, problems, submissions, code execution, languages, and posts.
  • Uses JWT in cookies for auth.
  • Uses Zod for request validation in the auth flow.
  • Starts a background result worker after MongoDB connection is ready.

Socket Service

Socket.IO MongoDB

  • Separate realtime service using Socket.IO.
  • Authenticates sockets before connection.
  • Handles chat room join/leave flows, member presence, room stats, typing events, message send/delete, and room creation.
  • Watches Mongo post inserts with change streams and broadcasts new posts when supported by MongoDB.

Problems Catalog

Boilerplate Testcases

  • Stores coding challenge assets locally.
  • Each problem can contain Problem.md, Structure.md, testcase input/output files, and generated language boilerplates.
  • Example problem folders in the repo show the expected structure for challenge authoring.

Shared Packages

packages/ui

  • Shared UI library used by the web app.
  • Contains reusable section UIs for dashboard, practice, community, auth, navigation, settings, and profile overview.
  • Includes Monaco editor integration and markdown rendering utilities.

packages/db

  • Shared Mongoose connection, models, schemas, interfaces, and enums.
  • Includes scripts for syncing problems, updating problem data, and seeding testcases into MongoDB.

packages/boilerplate-generator

  • Parses a problem Structure.md file.
  • Generates starter boilerplate and full executable wrappers for C++, Rust, Python, and JavaScript.
  • Supports generation for one problem slug or for all problems in the local catalog.

Tech Stack

Frontend

Tailwind CSS Monaco Editor React Markdown

  • Next.js 16
  • React 19
  • Tailwind CSS 4
  • Framer Motion
  • Zustand
  • Monaco Editor via @monaco-editor/react
  • react-markdown + remark-gfm
  • socket.io-client
  • lucide-react and react-icons

Backend and Realtime

MongoDB bcrypt Piston

  • Express 5
  • Socket.IO
  • MongoDB + Mongoose
  • JWT + cookie-based auth
  • bcrypt
  • Zod
  • Axios
  • Piston-based code execution
  • p-limit for bounded concurrent testcase execution

Tooling

pnpm Turbo TypeScript

  • pnpm workspaces
  • Turborepo
  • TypeScript
  • ESLint
  • Prettier

Known Gaps and Current Problems

Warning

Some sections are fully wired, while others still rely on mocked payloads, staged UI, or infrastructure assumptions such as MongoDB replica-set support for change streams.

This README should reflect the code honestly, so these limitations are worth calling out:

  • The current README.md previously lagged behind the actual product and still looked like a starter repo.
  • Some dashboard, community, and resources content is still mocked or partially hardcoded.
  • Practice category filtering is not fully backed by resolved tag metadata yet.
  • The visible practice Submit button is ahead of the fully polished end-to-end submission UX in the page layer.
  • Mongo change stream based post broadcasting works only when MongoDB is configured appropriately.
  • A few UI sections are clearly scaffolded for future growth, especially side widgets and some resources/settings capabilities.

Scripts

Install Build Dev Lint Types

From the repository root:

pnpm install
pnpm build
pnpm dev
pnpm lint
pnpm check-types

Problem and DB utility scripts:

pnpm generate-boilerplate
pnpm problem-update:db
pnpm problems-sync:db
pnpm testcases-push:db

Local Services

Service Default Port
Web app http://localhost:3000
HTTP backend http://localhost:3001
Socket server http://localhost:4001

Development Notes

  • The workspace uses pnpm and turbo from the repo root.
  • The backend and socket apps depend on the shared @repo/db package.
  • The web app expects the backend and socket services to be available for full functionality.
  • The project includes local problem assets and scripts, so the coding platform is not just UI-only; it already includes challenge content, default code generation, and execution plumbing.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 98.2%
  • Other 1.8%