CodX

CodX
RoleCreator & Software Engineer
PeriodFeb 2025 (Graduation Thesis)
TechNext.js, Supabase, Drizzle, Gemini API, Piston API
LocationSalvador, BA, Brazil 🇧🇷
Company Websitegithub repository ↗

Project Concept

CodX was developed as my final graduation thesis (Trabalho de Conclusão de Curso) for the Analysis and Systems Development degree at the Federal Institute of Bahia (IFBA). The project addresses the high dropout rates and low motivation typical of introductory programming courses. By combining structured RPG elements with modern full-stack web technologies, CodX transforms learning how to code into an engaging, interactive journey.

In introductory programming courses, abstract syntax and lack of immediate progress indicators often cause frustration. CodX implements **Mastery Learning** (Bloom, 1968) and **Scaffolding** models. Instead of arbitrary loops or math puzzles, it contextualizes tasks inside progressive theme-based learning tracks (Trilhas) and courses.

System Architecture

The application integrates the pedagogical strategies of Mastery Learning and scaffolding. Instead of repetitive, context-free syntax exercises, students follow structured learning paths (Trilhas) and courses. The platform features an online editor connected to the remote Piston API for live code execution across 20+ languages. This is accompanied by an AI assistant powered by Google's Gemini API to guide users with contextual tips, helping them debug their solutions in real-time.

Next.js (Fullstack)Hybrid rendering (SSR/SSG) for static roadmaps and dynamic study sessions. API routes handle secure communication.
Drizzle & SupabasePostgreSQL schema mapping and migrations using Drizzle ORM. Supabase serves as a BaaS handling authentication and media storage.
Piston & Gemini APIsPiston API runs code sandboxes in 20+ languages. Google Gemini API powers the pedagogical debugging chatbot helper.
CodX System Flow Architecture
Client WorkspaceServer Execution Layer
Interactive Editor
JavaScript, Python...Sends code payload
/api/run route
Secure API handlerProxies run request
Piston Sandbox
Runs code isolatedcaptures stdout/stderr
Response Parser
Checks test casesErrors vs Success
Visual Output
Green (Success)Red (Syntax Error)

Database Design

The database model uses a relational PostgreSQL structure hosted on Supabase and typed with Drizzle. It tracks user state, XP point metrics, unlocked achievements, and learning roadmap progression.

PostgreSQL Database Schema Relations
usersid (UUID) — Primary Keyemail (VARCHAR)level (INTEGER)xp_points (INTEGER)
user_achievementsid (UUID) — PKuser_id (UUID) — FKbadge_id (VARCHAR)unlocked_at (TIMESTAMP)
user_progressid (UUID) — PKuser_id (UUID) — FKlesson_id (VARCHAR)completed (BOOLEAN)

Gamification & Feedback

CodX's design system is built around the color psychology principles of Faber Birren. It uses carefully selected, customizable complementary color palettes to reduce eye strain and cognitive monotony during long study sessions. Error feedback is chromatically coded (Green for success, Yellow for warnings, and Red for syntax errors) to evoke emotional connections and guide learning actively. At the core is an RPG progression framework: users accumulate experience points (XP) to level up their programmer profile, unlocking rarity-tiered achievements and insígnias (badges) like 'Algorithm Master' or 'Mestre do Loop'.

Interactive Showcase: CodX Workspace Simulator (Aesthetic Theme & Code Engine)
JL
Lv.4
Jean LuizMestre em Python
EXP PROGRESS850 / 1000 XP
Badges
Color Theory Theme
Pedagogical AI Help
sum_numbers.py
# Calcule a soma acumulada de 1 a 5
soma = 0
for i in range(1, 6):
somai
print(soma)
Terminal Output
System idle. Press Run Code to execute Python script.

Milestones

Pedagogical Research & System Specification|Research

Aug 2024

Database Modeling & Supabase Configuration|Backend/DB

Oct 2024

Next.js App Router Setup & Piston API Integration|Fullstack

Nov 2024

Gemini API Chatbot & Color Theory Palettes|AI/UX Design

Dec 2024

Thesis Defense & Vercel Deployment|Release

Feb 2025

Closing Thoughts

The CodX platform successfully demonstrates how combining gamification, real-time code sandboxes, and generative AI can significantly improve student engagement in computer science. The project was defended successfully at IFBA in February 2025.