Problem
There was no simple, efficient way to follow online reading with real progress tracking and organization.
technical case study
Web App • System
An app for organizing online reading, with chapter tracking, status and easy pick-up where you left off.
Overview of readings organized into lists.
Filtering by status and search.
Progress tracking per chapter.
There was no simple, efficient way to follow online reading with real progress tracking and organization.
A system with lists, statuses and chapter control was built to keep reading continuous.
The app became a solid foundation for further development and everyday use.
Active project with ongoing improvements.
The project came from the need to follow readings scattered across the internet in an organized way, keeping history, progress and context.
Card-based interface with dynamic filters, search and status changes. Modular JavaScript updates the UI without a full page reload.
PHP architecture with separated responsibilities (services, repositories), handling business rules, persistence and data organization.
Tables for readings, lists and their relationship. Status, chapter and ordering control keep data consistent and fast to retrieve.
Submitted data is processed before being stored to avoid inconsistencies.
Services and repositories keep the interface from accessing the database directly.
Prevents duplicates and keeps saved readings consistent.
The project started as a personal solution for organizing online reading.
Lists, statuses and chapter control were implemented.
Responsibilities were separated and the code structure improved.
A working system with a foundation ready for future expansion.
function initLeiturasUI(leituraDataRaw) {
const leituraData = Array.isArray(leituraDataRaw) ? leituraDataRaw : [];
/* ========== Filtro por texto ========== */
const searchInput = document.getElementById("searchInput");
if (searchInput) {
searchInput.oninput = function () {
const termo = this.value.toLowerCase();
document.querySelectorAll(".js-leitura-card").forEach(card => {
const titulo = card.querySelector(".card-title")?.textContent.toLowerCase() || '';
const descricao = card.querySelector(".card-text")?.textContent.toLowerCase() || '';
const match = titulo.includes(termo) || descricao.includes(termo);
card.style.display = match ? "" : "none"; // não força block/flex
});
};
}
/* ========== Filtro por status ========== */
const statusFiltroEl = document.getElementById('statusFiltro');
if (statusFiltroEl) {
statusFiltroEl.onchange = function () {
const statusFiltro = this.value;
document.querySelectorAll(".js-leitura-card").forEach(card => {
const id = card.querySelector(".statusSelect")?.dataset.id
|| card.dataset.id;
const leitura = leituraData.find(l => String(l.id) === String(id));
const mostrar = (
statusFiltro === "0" ||
(leitura && String(leitura.status) === String(statusFiltro))
);
card.style.display = mostrar ? "" : "none";
});
};
}
public function applyPasta(int $id, array $body): void {
$pastaId = (int)$id;
if ($pastaId <= 0) throw new Exception('pasta_id inválido');
$add = $this->sanitizeIds($body['add'] ?? []);
$remove = $this->sanitizeIds($body['remove'] ?? []);
if (!$add && !$remove) return;
// não deixar o mesmo id nos dois
$addSet = array_flip($add);
$remove = array_values(array_filter($remove, fn($x) => !isset($addSet[$x])));
$this->repo->applyPastaChanges($pastaId, $add, $remove);
}
private function sanitizeIds($arr): array {
if (!is_array($arr)) return [];
$out = [];
foreach ($arr as $v) {
$n = (int)$v;
if ($n > 0) $out[$n] = true;
}
return array_keys($out);
}
public function applyPastaChanges(int $pastaId, array $add, array $remove): void {
$this->pdo->beginTransaction();
try {
if (!empty($add)) {
$stmt = $this->pdo->prepare(
"INSERT IGNORE INTO pagina_pasta (pagina_id, pasta_id) VALUES (:pagina_id, :pasta_id)"
);
foreach ($add as $paginaId) {
$stmt->execute([
':pagina_id' => (int)$paginaId,
':pasta_id' => $pastaId
]);
}
}
if (!empty($remove)) {
$in = implode(',', array_fill(0, count($remove), '?'));
$stmt = $this->pdo->prepare(
"DELETE FROM pagina_pasta WHERE pasta_id = ? AND pagina_id IN ($in)"
);
$params = array_merge([$pastaId], array_map('intval', $remove));
$stmt->execute($params);
}
$this->pdo->commit();
} catch (Throwable $e) {
$this->pdo->rollBack();
throw $e;
}
}
The system brought all readings into one place and made picking up where you left off easier, creating a solid base for new features.
How important a well-defined architecture is from the start, so the project can grow without rework.