Work / Comercial Template
comercial-template
A full-stack application for client records and commercial proposals.
Repository: https://github.com/lughlammas/comercial-template · commit 3ead252
- Status
- Public repository · not deployed
- Stack
- Next.js App Router, TypeScript, Tailwind, NextAuth, Prisma + SQLite, @react-pdf
- Tests run
npm test→ 24/24 · typecheck exit 0 · 2026-10-19- Source
- github.com/lughlammas/comercial-template @ 3ead252
01Problem
The problem this project takes on is proposals written in documents and spreadsheets: totals calculated by hand, no history per client, and a clean PDF that has to be formatted again every time. It tests whether that flow (client → proposal → line items → total → PDF) can be a small, reliable, reusable application.
02Context
A demonstration application with a Brazilian Portuguese interface and synthetic seed data. It is not deployed and has no users; no production adoption is claimed.
03Solution
- Email and password registration and login, with bcrypt-hashed passwords and JWT sessions.
- A protected dashboard, plus creation, listing and detail views for clients and proposals.
- Line items with quantities, prices and totals rounded to cents.
- A PDF of each proposal generated on the server and downloaded only by its owner.
scripts/e2e-smoke.mjs + seeded demo) · 2026-10-19 09:23 BRT04Architecture
A single Next.js App Router application in TypeScript. Pages are React Server Components that query the database through Prisma (SQLite); writes go through Server Actions; one route handler renders PDFs with @react-pdf/renderer. Middleware blocks protected routes without a session. A Dockerfile and a standalone build are configured.
05Evidence
- 24/24 unit tests passed (4 files: money, server actions, middleware, PDF route), and the typecheck is clean, in the run for this site on 2026-10-19.
- CI passed on the current commit. The "Web validation" workflow runs install, lint, unit tests, production build, typecheck and a browser smoke test against the production build.
- Data isolation is tested: the PDF route returns 401 without a session and 404 for proposals the user does not own, and creating a proposal refuses another user's client.
- The repository documents a browser run on 2026-10-07 with 13/13 checks, including a second user receiving 404 on the first user's records. That run was not repeated for this site.
Links
- Public repository: https://github.com/lughlammas/comercial-template
- Commit
3ead252: https://github.com/lughlammas/comercial-template/commit/3ead2526b0a2d5e5f7970b539016dba8f56def3c - CI run "Web validation" on
3ead252(success, public log): https://github.com/lughlammas/comercial-template/actions/runs/37713989999 - Unit tests (source): https://github.com/lughlammas/comercial-template/tree/3ead2526b0a2d5e5f7970b539016dba8f56def3c/tests
- CI workflow: https://github.com/lughlammas/comercial-template/blob/3ead2526b0a2d5e5f7970b539016dba8f56def3c/.github/workflows/ci.yml
- Product walkthrough with the documented 2026-10-07 browser run: https://github.com/lughlammas/comercial-template/blob/3ead2526b0a2d5e5f7970b539016dba8f56def3c/docs/PRODUCT_WALKTHROUGH.md
- The 24/24 run for this site: internal test log, not public. The public CI run above covers the same tests.
06Human role and AI tools
Built through human-directed AI-assisted development: AI tools contributed to product, implementation, QA and documentation, under human direction. The repository contains application source, not an agent platform.
07Tests executed
| Check | Result | Where |
|---|---|---|
npm test |
24/24 passed | run on 2026-10-19 |
npm run typecheck |
exit 0 | run on 2026-10-19 |
| CI "Web validation" | success on 3ead252 |
GitHub Actions |
Browser smoke (test:e2e) |
13/13, documented | repo docs, 2026-10-07, not re-run |
| lint / build / e2e, local | not run for this site |
08Limitations
- No hosted demo or deployment.
- Docker image not verified: the Dockerfile copies a
public/folder that does not exist. - Clients and proposals cannot be edited or deleted; proposal status cannot be changed in the interface.
- No email verification, password reset or login rate limiting.
- Money stored as floating point (rounded per line); BRL and pt-BR hard-coded.
- Schema applied with
db push, without migration history. - 11 high-severity advisories remain in tooling and optional dependencies (0 critical), per
npm auditon 2026-10-19. - No performance, accessibility or security tests.
- Header overflows horizontally below ~420 px (measured at 360/390 px); 'Ver demo' button contrast 1.04:1 and footer text 3.66:1 (WCAG AA requires 4.5:1).
- No LICENSE file.
09Commercial relevance
This is the reference for S02 · Custom Software & MVP: authentication, data ownership, a money calculation with tests, and a document output, delivered with its limits stated. It is also a base that can be adapted to similar flows (quotes, receipts, simple contracts) after an assessment of what each one needs.
→ S02 · Custom Software & MVP Development · Discuss Your Project
Have a problem that should become software?
Describe what you have and what is not working.