This repository contains my submission for the Pesapal Junior Developer Challenge 2026. It demonstrates a lightweight relational database management system (RDBMS) built from scratch, with a web interface for CRUD operations.
Both backend and frontend live in the same repository for ease of execution and review.
The goal of this challenge was to:
-
Design and implement a simple RDBMS
-
Support:
- Table creation with data types
- Primary keys and unique constraints
- Basic CRUD operations
- Indexing
- Joins (basic)
-
Include an interactive REPL
-
Build a web app demonstrating database CRUD
-
In-memory relational tables
-
Supported data types:
INT– integer valuesSTR– string values
-
Primary keys
-
Auto-incrementing IDs
-
CRUD operations via REST API:
- Create (POST)
- Read (GET)
- Update (PUT / PATCH)
- Delete (DELETE)
-
JSON persistence for tables (
<table_name>_table.json)
I chose FastAPI because:
- Lightweight and fast
- Built-in validation via Pydantic
- Auto-generated interactive documentation
- Easy integration with JSON-based RDBMS
- Allows me to focus on database logic
- Create a Python virtual environment:
git clone https://github.com/mutungapeter/Custom-RDMS.git
cd Custom-RDMS
python -m venv venv
source venv/bin/activate
cd backend
pip install -r requirements.txt- Start FastAPI server:
uvicorn api.main:app --reload- API will be available at:
http://127.0.0.1:8000/docs/
| Method | Endpoint | Description |
|---|---|---|
| POST | /tables/{name} |
Create a table |
| DELETE | /tables/{name} |
Delete a table |
| Method | Endpoint | Description |
|---|---|---|
| GET | /tables/{name}/records |
List all records in table |
| POST | /tables/{name}/records |
Insert new record(s) |
| PUT | /tables/{name}/records/{id} |
Replace entire record |
| PATCH | /tables/{name}/records/{id} |
Update specific fields |
| DELETE | /tables/{name}/records/{id} |
Delete a record |
The RDBMS includes a REPL for direct database interaction.
cd backend
python -m db_engine.repl> CREATE TABLE users
> INSERT INTO users name=John
> INSERT INTO users name=Mary
> SELECT * FROM users
> UPDATE users SET name=Jane WHERE id=1
> DELETE FROM users WHERE id=2
The REPL shows real-time table manipulation without the frontend.
##Frontend – React Web App
The frontend demonstrates CRUD operations using the RDBMS API:
- Table creation & selection
- Record creation
- Record editing (PUT / PATCH)
- Record deletion
- Live updates from backend
Built using:
- React + TypeScript
- Vite (fast dev server)
- Tailwind CSS for styling
- Install dependencies:
cd frontend
npm install- Start development server:
npm run dev- Access the app at:
http://localhost:5173
- Create or select a table from the UI
- Insert records (auto-increment IDs)
- View records in the table
- Update records using PUT / PATCH
- Delete records
- All changes are persisted in JSON files on backend
AI tools were used for:
- Refactoring code
- Debugging minor issues
All database design, integration, and frontend logic were implemented and fully understood by me.
Built for the Pesapal Junior Developer Challenge ’26 By: Peter Sikuku