Dec 2025 – Present
MangaKaCR POS & Inventory Platform
The point-of-sale, inventory and back-office platform that runs MangaKaCR, a manga bookstore in San José. I designed and built every part of it on my own.
My roleSole developer: architecture, backend, frontend, testing, CI/CD and production operations
- automated test methods
- 1,385
- automated test methods
- API endpoints
- 180
- API endpoints
- lines of C#
- 75k+
- lines of C#
- Razor components
- 107
- Razor components
- database migrations
- 40
- database migrations

MangaKaCR is an independent manga bookstore in San José. It used to run its counter sales and invoicing on a third-party accounting system; I replaced it with a platform built from scratch around how the store actually works: counter sales with several payment methods, layaways, cash-register shifts, bulk restocks, client cashback, back-in-stock alerts and a printable catalog that updates itself every day.
I was the only person on the project. I designed the architecture and domain model, wrote the API, the admin web app, the PDFs and emails, the automated tests and the CI/CD pipelines, migrated the infrastructure twice, and I deploy and support it in production. The store let me publish it here.
Architecture
The back office is two .NET 9 applications, each split into clean-architecture layers (Domain → Application → Infrastructure → Presentation, plus a composition project for dependency injection):
- Mangaka.Api: an ASP.NET Core Minimal API with 20 endpoint groups, JWT authentication, an administrator-only policy, global ProblemDetails error handling and two background services.
- Mangaka.Invoicing: the staff-facing Blazor Server app (MudBlazor + ApexCharts) with 28 screens and ~100 Razor components. It talks to the API through a typed client generated with Microsoft Kiota from the API's OpenAPI document, so a contract change breaks the build instead of production.
- A rich domain model: entities and self-validating value objects (Price, Cost, CABYS code, cédula, email, phone, storage location…) with domain exceptions translated to HTTP responses at the edge.
- PostgreSQL with 40 EF Core migrations, product images in Cloudflare R2, transactional email through Resend, documents with QuestPDF, a daily Google Drive sync and lookups against Costa Rica's Hacienda API.
Point of sale
- A multi-tab POS: each vendor's open draft invoices come back as tabs, scoped to whoever is signed in.
- Sales to a walk-in client or a registered one. Typing a cédula fetches the registered name from Hacienda's public API, cached for an hour (including not-found results) to avoid hammering the service.
- Six payment methods (cash with change, card, bank transfer, SINPE Móvil, CompraClick) plus combined payments split across methods, per-line price overrides and time-limited offers by amount or percentage.
- Emitting an invoice decrements stock and assigns its consecutive number, continuing the third-party accounting system's numbering through a dedicated migration so the store's sequence never broke.
- Voids within a 24-hour window, administrators only: stock is restored, quantity-limited offers are credited back and an audit entry is recorded.
- 80 mm POS tickets and A4 receipts generated with QuestPDF, receipts emailed to the client, and a combined A4 PDF export of many receipts at once.
- Client cashback: 10% accrues on each sale, the whole balance can be redeemed (capped at the total), it's reversed on voids, and the cashier can opt a sale out. Layaway payoffs deliberately don't earn it.
Live sync across open tabs
The store keeps several tabs open at once: the POS at the counter, the product grid, an edit page in the back. So that none of them works with stale stock or prices, I implemented an in-process publish/subscribe pattern on top of Blazor Server, where every open tab is a circuit living in the same server process.
- Publishers: two singleton notifiers, one for products and one for offers. The application services raise an event after every successful save (single edits, quantity changes, bulk price and visibility updates, offer create/edit/delete) with only the fields the screens need.
- Subscribers: the POS, the product grid and table, and the edit page subscribe when they render and unsubscribe when they're disposed. Each one marshals the event onto its own circuit before touching state, so updates arrive in place without a reload.
- Fault isolation: every subscriber is invoked independently inside its own try/catch, so a closed or failing tab can't stop delivery to the rest, and a notification can never fail the save that triggered it.
- Offer events carry every affected product, including ones an edit removed from the offer, so each tab re-evaluates the right prices. An edit page only shows a notice instead of overwriting what you're typing, and ignores the echo of its own save.
- A deliberate single-server design: scaling out behind a load balancer would swap the in-memory notifiers for a distributed backplane such as Redis pub/sub, without touching the subscribers.
Layaways and cash-register shifts
- Apartados (layaways) reserve stock and lock each line's price at creation, collect an initial payment and later partial payments, enforce an expiration at least 30 days out, return stock if cancelled and finally convert into a full invoice, with their own tickets and receipts.
- Turnos (shifts) open with a starting cash amount, log manual cash-in movements and close with the counted cash and observations. Anything that collects money is blocked while no shift is open.
- Shift reports reconcile sales and layaway payments per period, covered by integration tests against a real database.
Inventory and catalog
- Products with validated CABYS tax codes, authors, categories, collections (with alternate names), publishers, demographics, types, storage location, visibility and image uploads to Cloudflare R2 with a crop-and-manage UI.
- Search ranked by match quality, filters, sorting and infinite scroll, plus bulk delete, price and visibility actions and one-click product duplication.
- Bulk restock drafts: a restock can be saved and resumed. Applying it updates every product's stock and location, writes one audit entry per change and freezes its report.
- “Avisar cuando llegue”: clients can watch sold-out products. Only a genuine out-of-stock to in-stock transition queues them, and a background service bundles everything that came back for a client into a single email after a one-hour window.
- A background service renders the full Product List PDF every morning and overwrites a fixed Google Drive file, so the link the store shares with customers never changes.
Sales analytics
I built the store's business-intelligence layer end to end, from the domain contracts and three API endpoints to the analytics screens, so the owners can see what sells, who buys it and how the store is doing against last month or last year.
- Ranked breakdowns across 8 dimensions: author, collection, category, publisher, demographic, product, client and vendor, by revenue and units, with infinite scroll and server-side search. Clicking any slice drills down: it becomes a removable filter chip that narrows every other chart.
- Trend comparisons: revenue or units bucketed by day, week or month and overlaid on the previous period or the same range a year earlier, aligned bucket by bucket (empty days included) so the two series line up on one axis.
- Honest revenue recognition: layaway deposits count as revenue on the day they're collected, and the already-paid part of each layaway's final invoice is backed out so it's never counted twice. The average ticket uses invoices only, so deposits don't inflate it.
- Headline KPIs are computed from the full filtered dataset rather than the paged rankings, which would undercount once more products sold than fit on a page. Co-authored titles credit every author, a documented trade-off.
- A homepage dashboard with today's and this month's revenue, invoice count, average ticket and the month's top author and product, plus shift reports charting income per closed shift and the payment-method mix.
Administration and auditing
- Sign-in through a self-hosted Better Auth service that issues the JWTs the .NET apps validate. The first sign-in creates an access request that an administrator approves (assigning a role) or rejects. Administrators can't change their own role or status.
- Searchable audit trails for products (with field-level change detail), clients, sales and invoices, plus company settings (tax regime, economic activity, terms and notes) that print on every receipt.
Quality, delivery and operations
- Over 1,300 automated tests across the domain, application, infrastructure and presentation projects, including integration tests that run against a real PostgreSQL in Testcontainers for the risky paths (cashback, layaway payoffs, shift reconciliation, cascade deletes).
- GitHub Actions for build and test, CodeQL analysis, and Docker images for every service pushed to GHCR on every merge to main, built on a self-hosted Docker runner I set up. A deploy job then calls Coolify's API and waits for the rollout to finish or fail. Local SonarQube analysis with coverage.
- Mid-project I migrated images from Supabase Storage to Cloudflare R2 and auth and database to Neon, bridging Neon's EdDSA-signed JWTs into .NET's token validation. In October I moved everything again, to a VPS managed with Coolify: Postgres with its own backups, and Neon Auth replaced by a self-hosted Better Auth server that serves the same endpoints and JWTs, so no C# auth code changed and existing users and password hashes carried over.
- Product images live in a Cloudflare R2 bucket served from a custom subdomain, images.mangaka.co.cr, so the POS and the online store load them from the store's own domain.
- A Git flow with feature branches, versioned releases promoted from development to main, and a published import schema for bulk-loading products crawled from the store's online shop.
Built with
Screenshots
Next project
MangaKaCR Online Store →



