A full-stack learning platform that transforms semi-structured exam content into structured data, adaptive study workflows and AI-assisted feedback.
Built with Python, FastAPI, SQLite and JavaScript, the project combines document processing, ETL, Medallion-inspired data layers, backend APIs, spaced repetition, performance analytics and LLM integration in a single working application.
Data note: in the original pipeline, the Bronze layer is composed of the source PDFs (exam papers, answer keys and public notices) preserved in their raw form. Those original PDFs are intentionally not distributed in this public repository. The repository keeps the processed layers and application data required to demonstrate the architecture and run the platform.
This repository is more than a study application. It is an end-to-end engineering project covering:
- Document processing for heterogeneous and imperfect source formats
- Data Engineering with Bronze, Silver, Gold and Curated layers
- ETL and data quality for semi-structured content
- Backend Engineering with Python and FastAPI
- Relational serving and user-state persistence with SQLite
- Applied AI / LLM integration for enrichment and structured feedback
- Learning algorithms through spaced repetition
- Frontend development with JavaScript, HTML and CSS
- Product engineering around a real personal use case
| Feature | Description |
|---|---|
| ποΈ Daily Session | Combines due reviews with new questions using 1 β 3 β 7 β 15 day intervals |
| π― Custom Sessions | Filter by exam, discipline, topic, question state and quantity |
| β Immediate Feedback | Instant correction based on the stored answer key |
| π‘ Explanations | Manual and AI-assisted explanations for answers and distractors |
| πΌοΈ Visual Context | Previously processed images support questions where text extraction is insufficient |
| βοΈ Essay Training | Timed writing practice, history and AI-assisted evaluation |
| π Performance Analytics | Accuracy by topic helps identify areas that require more study |
The data pipeline follows a Medallion-inspired architecture, separating raw source preservation, extraction, structured data, enrichment and application serving.
ββββββββββββββββββββ
β Bronze β original source PDFs
β exams / keys / β raw, unmodified inputs
β notices β
ββββββββββ¬ββββββββββ
β
ββββββββββββββββββββ
β Silver β extracted / intermediate data
ββββββββββ¬ββββββββββ
β
ββββββββββββββββββββ
β Gold β structured questions
ββββββββββ¬ββββββββββ
β
ββββββββββββββββββββ
β Curated β topics + explanations
ββββββββββ¬ββββββββββ
β
ββββββββββββββββββββ
β SQLite β serving + user history
ββββββββββ¬ββββββββββ
β
ββββββββββββββββββββ
β FastAPI β API + application logic
ββββββββββ¬ββββββββββ
β
ββββββββββββββββββββ
β Web Frontend β
ββββββββββββββββββββ
The Bronze layer exists in the original data workflow, but its source PDFs are excluded from this public repository. This keeps the architectural model accurate without redistributing third-party documents.
concurso-datalake/
βββ data/
β βββ bronze/ # original source PDFs (not distributed publicly)
β βββ silver/ # intermediate extracted data
β βββ gold/ # structured questions
β βββ curated/ # topics and explanations
β βββ concurso.db # application data and study history
βββ scripts/
β βββ extract_prova.py
β βββ curate_assuntos.py
β βββ gen_justificativas.py
β βββ build_db.py
βββ app/
βββ main.py # FastAPI application
βββ static/ # HTML/CSS/JavaScript frontend
The Bronze layer is the raw source layer of the pipeline.
In this project it is composed of the original documents used as input, including:
- exam PDFs;
- official answer-key PDFs;
- public notices or related source documents when needed by the extraction workflow.
These files are preserved without semantic transformation so the extraction process can always be traced back to the original document.
For the public GitHub version, the Bronze PDFs are intentionally omitted. This does not change the pipeline design: Bronze remains the conceptual and operational entry point of the data flow.
The Silver layer stores intermediate representations produced from the Bronze documents during extraction and normalization. It provides a boundary between raw document interpretation and the structured application model.
Typical responsibilities include:
- extracted text;
- page-level content;
- normalized characters;
- parser checkpoints;
- intermediate question boundaries;
- references to visual crops when text extraction alone is insufficient.
The Gold layer converts extracted content into structured entities containing fields such as:
- exam;
- discipline;
- topic;
- statement;
- alternatives;
- expected answer;
- page/source reference;
- processing flags.
The Curated layer adds information used by the learning experience, including topic classification and explanations.
Manual curation can coexist with automated enrichment, allowing deterministic information to remain independent from generative content.
Structured data is consolidated into SQLite, which also stores:
- attempts;
- performance history;
- review cycles;
- essays;
- application state.
A FastAPI backend exposes these capabilities to the web frontend.
A central challenge is converting heterogeneous exam PDFs from the Bronze layer into reliable structured data.
The parser handles problems such as:
- single-column and multi-column layouts;
- support text associated with groups of questions;
- formatting differences between document providers;
- degraded characters from text extraction or OCR;
- inconsistent question and alternative markers;
- parser resynchronization when expected markers are missing;
- visual fallback for questions containing tables, formulas or code;
- localized validation instead of failing an entire document because of one malformed question.
This makes the extraction pipeline resilient to real-world document inconsistencies rather than assuming perfectly structured input.
Incorrectly answered questions enter a progressive review cycle:
Incorrect Answer
β
1 day
β
3 days
β
7 days
β
15 days
β
Graduated
A successful review advances the question to the next interval. The daily session can therefore combine due reviews and unseen questions automatically.
The learning state is persisted in the database rather than being derived only from the current browser session.
LLMs are used as an enrichment and feedback layer, not as the authoritative source of exam answers.
Current AI-assisted capabilities include:
- explanation generation;
- distractor analysis;
- structured study feedback;
- essay evaluation;
- multimodal context for questions requiring visual information.
A key design decision is the separation between:
Deterministic / Stored Data Generative Layer
βββββββββββββββββββββββββββ ββββββββββββββββ
Answer key β Explanation
Question structure β Feedback
Study history β Recommendations
This prevents generated text from silently replacing the structured source of truth used by the application.
The application uses a structured dataset generated from previously processed public exam documents.
The original PDFs belong to the Bronze layer, but they are not included in this public repository. Silver/Gold/Curated outputs, visual crops required by specific questions and the application database are retained where needed to demonstrate and operate the platform.
This allows the repository to show the complete Bronze β Silver β Gold β Curated β Serving architecture without acting as a mirror for the original PDF collections.
pip install pdfplumber fastapi "uvicorn[standard]" anthropiccd concurso-datalake
python -m uvicorn app.main:app --port 8000Open:
http://127.0.0.1:8000
Configure external AI credentials through environment variables.
Windows:
set ANTHROPIC_API_KEY=your-keyLinux/macOS:
export ANTHROPIC_API_KEY="your-key"API keys and credentials should never be committed to the repository.
Explanations can be generated incrementally:
python scripts/gen_justificativas.py all
python scripts/build_db.pyThe workflow is designed so enrichment can be interrupted and resumed without requiring the entire dataset to be regenerated from scratch.
Python Β· FastAPI Β· SQLite Β· REST APIs
ETL Β· Medallion Architecture Β· Bronze / Silver / Gold / Curated Β· Data Pipelines Β· Data Normalization Β· Data Quality Β· Structured Datasets
LLM Integration Β· AI-assisted Enrichment Β· Structured Feedback Β· Multimodal Context
JavaScript Β· HTML Β· CSS
Several architectural choices are intentionally visible in this project:
- Treat the original PDFs as an immutable Bronze source layer
- Separate raw source-document preservation from extracted application data
- Preserve intermediate representations before producing final structured entities
- Keep manual curation independent from automated enrichment
- Separate deterministic answer data from generative explanations
- Preserve user history when rebuilding the structured question database
- Contain parsing failures instead of invalidating complete processing runs
- Use a lightweight relational database for application serving
- Keep learning state and application rules independent from the frontend
- Make AI an enrichment component rather than the system's source of truth
- Bronze source-document layer
- Document extraction and structuring pipeline
- Silver / Gold / Curated data layers
- FastAPI application
- Web training interface
- Immediate correction
- 1/3/7/15-day spaced repetition
- Performance analytics
- Manual and AI-assisted explanations
- Essay training with AI-assisted evaluation
- More robust OCR pipeline for scanned documents
- Controlled generation of novel practice questions
- Lakehouse pipeline experimentation in Databricks
- Stateful AI study mentor with graph-based orchestration
This repository demonstrates the engineering implementation of the platform.
The architecture defines the Bronze layer as the original exam, answer-key and notice PDFs used as raw input. Those source files are intentionally not redistributed in this public repository. Third-party trademarks and source materials remain the property of their respective owners.
The project is intended for learning, experimentation and demonstration of software engineering, data engineering and applied AI techniques.
Jailson Bezerra
Software Engineering Β· Automation Β· Data Β· AI
- LinkedIn: https://linkedin.com/in/jailsonsb
- Portfolio: https://jailson.es