Skip to content

bighnesh0007/dwcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DWCode banner Typing SVG



A LeetCode-style coding platform built exclusively for MuleSoft DataWeave developers.

Practice data transformations, compete in timed contests, and sharpen your skills with AI-generated problems β€” all in a browser-based Monaco editor connected to a live DataWeave 2.0 compiler.

Stop practicing transformations in a scratch Anypoint project you'll never open again. Solve real problems. Race the clock. Climb the leaderboard. Let AI throw new challenges at you until %dw 2.0 feels like a second language.



Next.js React TypeScript MongoDB Clerk Gemini Docker

Open Source PRs Welcome Made for Muleys

🌍 Why DWCode Exists

Every MuleSoft developer knows the feeling: you can wire up an API in your sleep, but hand you a gnarly groupBy β†’ pluck β†’ reduce chain under interview pressure and suddenly the docs are open in three tabs.

DataWeave is a language. Languages get sharp with reps, not tutorials.

DWCode is the dojo. It gives you an endless supply of curated and AI-generated transformation puzzles, a real compiler to check your work against hidden test cases, and a scoreboard that turns "I should practice more" into "I'm rank #3 and I'm not stopping."

Built by the community, for the community. πŸ’œ

✨ Features

πŸ‹οΈ Problem Workspace β€” your training ground

The main event. A clean split-pane battle station:

  • Split-pane layout: Problem description | Monaco editor | Console β€” everything in one view, zero context-switching
  • Run code against custom JSON input, or click Submit to evaluate all test cases at once
  • Real-time pass/fail feedback with per-test-case diff output β€” see exactly where your output drifted
  • Built-in countdown timer to simulate interview pressure (or just keep you honest)
  • Bookmark any problem for later revision
  • Reveal Solution toggle with optional hints
  • My Notes tab β€” auto-saved, per-problem markdown notes so future-you remembers the trick
  • Discussion tab β€” comment thread per problem

πŸ€– AI Problem Generator β€” the endless boss fight

Never run out of problems again.

  • One-click generation via Google Gemini 2.5 Flash
  • Configure difficulty (Easy / Medium / Hard), category, and an optional topic
  • Returns a full problem: description, examples, constraints, starter code, test cases, hidden test cases, hints, and a reference solution
  • Problems are saved immediately to the database and appear in the problem list

πŸ† Contests β€” prove it under pressure

  • Create time-boxed contests with any subset of problems
  • Public or invite-code-only visibility
  • Auto-computed status: upcoming β†’ active β†’ ended
  • Participant scoring: Hard Γ—5, Medium Γ—3, Easy Γ—1

πŸ“Š Leaderboard β€” the wall of legends

  • Global ranking based on weighted score across all accepted submissions
  • Per-user breakdown: Easy / Medium / Hard solved, acceptance rate, total submissions
  • Live aggregation β€” no manual sync required

πŸ› Free Playground β€” no rules, just DataWeave

  • Standalone editor with no problem constraints β€” bring your own chaos
  • Three-panel layout: Input payload | DataWeave script | Output
  • Instant execution, copy-to-clipboard, reset, and execution time display

✍️ Blog β€” the community's brain

  • Community blog with full CRUD
  • Write posts using a rich text editor; published posts are publicly visible

πŸ‘€ User Profiles β€” your story so far

  • Progress overview: total solved, by difficulty, bookmarks
  • Submission history and personal stats

πŸͺ™ Coins System β€” because winning should feel good

  • Gamification layer: earn coins for accepted solutions
  • Transaction history visible in user profile

πŸ” Admin Panel β€” mission control

  • Role management and user administration via dedicated /admin routes
  • Protected by Clerk authentication and custom role checks

πŸ— Tech Stack

Every piece was chosen to keep the loop tight: write DataWeave β†’ run against a real compiler β†’ get instant truth.

Layer Technology
Framework Next.js 16 (App Router)
Language TypeScript 5
UI Tailwind CSS v4, shadcn/ui, Lucide Icons
Editor Monaco Editor (@monaco-editor/react)
Auth Clerk (@clerk/nextjs)
Database MongoDB via Mongoose
AI Google Gemini 2.5 Flash (@google/genai)
State Zustand
Compiler Backend DataWeave runtime (Docker / external service)
Containerisation Docker Compose
Font Geist (via next/font)

πŸš€ Getting Started

From git clone to green checkmarks in five steps.

Prerequisites

  • Node.js β‰₯ 18
  • Docker (for MongoDB and optional DataWeave compiler backend)
  • A Clerk account β€” clerk.com
  • A Google Gemini API key β€” ai.google.dev

1. Clone & Install

git clone https://github.com/your-username/dwcode.git
cd dwcode
npm install

2. Environment Variables

Copy the example env file and fill in your values:

cp .env.example .env.local
# .env.local

# MongoDB connection string
MONGODB_URI=mongodb://localhost:27017/dwcode

# Google Gemini API key (for AI problem generation)
GEMINI_API_KEY=your_gemini_api_key_here

# Clerk authentication keys (from your Clerk dashboard)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...

# Clerk redirect paths
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up

3. Start MongoDB

docker-compose up -d

This spins up a MongoDB instance at localhost:27017 with a persistent volume.

4. Start the DataWeave Compiler Backend

The code execution engine is a separate DataWeave runtime service. By default the app points to https://dwlbackend.onrender.com. To run it locally, start the companion Docker container and update DATAWEAVE_BACKEND_URL in your env file accordingly.

5. Run the Development Server

npm run dev

The app starts on http://localhost:8000 β€” open it, pick a problem, and start transforming. πŸŽ‰

πŸ“‚ Project Structure

dwcode/
β”œβ”€β”€ app/                        # Next.js App Router pages & API routes
β”‚   β”œβ”€β”€ api/                    # REST API handlers
β”‚   β”‚   β”œβ”€β”€ execute/            # DataWeave code execution proxy
β”‚   β”‚   β”œβ”€β”€ generate/           # AI problem generation (Gemini)
β”‚   β”‚   β”œβ”€β”€ problems/           # Problem CRUD
β”‚   β”‚   β”œβ”€β”€ submissions/        # Submission tracking
β”‚   β”‚   β”œβ”€β”€ contests/           # Contest management
β”‚   β”‚   β”œβ”€β”€ leaderboard/        # Score aggregation
β”‚   β”‚   β”œβ”€β”€ bookmarks/          # Bookmark toggle
β”‚   β”‚   β”œβ”€β”€ notes/              # Per-problem notes
β”‚   β”‚   β”œβ”€β”€ coins/              # Gamification coins
β”‚   β”‚   β”œβ”€β”€ blog/               # Blog posts
β”‚   β”‚   β”œβ”€β”€ comments/           # Problem discussion threads
β”‚   β”‚   └── admin/              # Admin: users & roles
β”‚   β”œβ”€β”€ problems/[slug]/        # Problem workspace (split-pane editor)
β”‚   β”œβ”€β”€ playground/             # Free DataWeave playground
β”‚   β”œβ”€β”€ contests/               # Contest list & detail
β”‚   β”œβ”€β”€ leaderboard/            # Global leaderboard
β”‚   β”œβ”€β”€ blog/                   # Blog list, detail & editor
β”‚   β”œβ”€β”€ profile/                # User profile page
β”‚   β”œβ”€β”€ create/                 # Manual problem creation form
β”‚   └── admin/                  # Admin dashboard
β”œβ”€β”€ components/                 # Shared UI components (Navbar, Comments, etc.)
β”œβ”€β”€ models/                     # Mongoose schemas (Problem, Submission, Contest…)
β”œβ”€β”€ lib/                        # Database connection, utilities
β”œβ”€β”€ scripts/                    # Seed scripts
β”œβ”€β”€ public/                     # Static assets
β”œβ”€β”€ docker-compose.yml          # MongoDB container
└── Dockerfile                  # App Dockerfile

πŸ”‘ Key API Routes

Method Route Description
GET/POST /api/problems List or create problems
POST /api/execute Run DataWeave code
POST /api/generate Generate problem with AI
GET/POST /api/contests List or create contests
GET /api/leaderboard Fetch ranked leaderboard
POST /api/submissions Submit a solution
GET/POST /api/bookmarks Toggle bookmark
GET/PUT /api/notes Read/write problem notes
GET /api/coins User coin balance
GET/POST /api/blog Blog post management
GET/POST /api/comments Problem discussion

🐳 Docker

Start only MongoDB:

docker-compose up -d

Build and run the full app in Docker:

docker build -t dwcode .
docker run -p 8000:8000 --env-file .env.local dwcode

πŸ—Ί Roadmap Ideas

Want to help shape where DWCode goes next? These are open for the taking:

  • πŸ“… Daily challenge streaks (keep the muscle warm)
  • 🏒 Company-tagged problem sets for interview prep
  • 🧡 DataWeave "pattern of the week" community writeups
  • πŸ₯‡ Team leagues and seasonal contests

Have an idea? Open an issue and let's talk.

🎁 Our Gift to the MuleSoft Community

DWCode is open source β€” because the best integrations are the ones we build together. πŸ΄πŸ’œ

We didn't build DWCode to lock it away behind a paywall. We built it because we are the MuleSoft community β€” and every Muley deserves a place to sharpen their DataWeave without spinning up yet another throwaway Mule app.

So here it is. Free. Open. Yours. Fork it, self-host it, remix it, ship it. This is our contribution to the flow β€” now add yours.

Every Muley makes the mule stronger. Here's how you can plug in:

  • 🧩 Add a problem β€” dreamt up a devious transformation? Drop it in and stump the leaderboard.
  • πŸ› Squash a bug β€” see something misbehaving? A PR is worth a thousand issues.
  • πŸ“– Write a blog post β€” teach a DataWeave pattern that took you three hours to crack.
  • ✨ Build a feature β€” the roadmap above is a menu, not a limit.
  • ⭐ Star the repo β€” the cheapest, kindest way to say "keep going."
%dw 2.0
output application/json
var community = payload.developers
---
{
  status: "open source, forever",
  gift: "DWCode",
  from: "us",
  to: "the MuleSoft community",
  yourMove: community map (dev) -> dev ++ { contributed: true }
}

An API is only as good as the community that connects to it. Same goes for a practice platform. πŸ”Œ

🀝 Contributing

DWCode gets better every time a MuleSoft dev throws in a problem, fixes a bug, or writes a blog post. Jump in:

  1. Fork the repo and create a feature branch: git checkout -b feat/your-feature
  2. Make your changes and ensure the app builds: npm run build
  3. Run lint: npm run lint
  4. Open a pull request with a clear description

Every contribution β€” a single test case or a whole new feature β€” makes the whole community sharper. πŸ™Œ

πŸ“„ License

MIT β€” feel free to use, fork, and extend. Go build something great.


%dw 2.0
output application/json
---
{
  project: "DWCode",
  builtWith: "πŸ’œ",
  gift: "open source, to the MuleSoft community",
  from: "one Muley to every Muley",
  message: "Keep weaving. Keep shipping. Keep leveling up.",
  yourTurn: "fork it β†’ improve it β†’ give it back"
}

⭐ If DWCode helped you level up, drop a star β€” it fuels the mission. ⭐

DWCode footer

About

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages