Portfolio

BeerCat Website

Website and internal platform for BeerCat, the IT startup we started among family and friends: quotes with versioned PDFs and AI drafts, projects by stage, Webpay payments and a client portal. I built it end to end with Flask, MySQL, Celery + Redis and Gemini.

In development Solo developer
Python Flask MySQL

Leer en español

BeerCat Website

BeerCat: the website and management platform of an IT startup

BeerCat is a Chilean tech startup we started among family and friends. It offers tech support, networking, custom software development, artificial intelligence and cloud services. Since June 2026 I have been building its platform: the public website, where clients come in, and the internal system the team uses to run the whole operation, from the first message to the last payment.

The goal is that nothing gets lost between scattered tools. A message from the website form becomes a quote. The quote goes out as a versioned PDF with open tracking. Once it is accepted, a project is created, moves through stages and collects its payment milestones through a Webpay link. The client follows everything from their own portal.

BeerCat public website: home page with the Roman cat, services and links to the contact form

Overview
RolePart of the founding team. I built the platform end to end: backend, frontend and infrastructure (106 of 106 commits)
PeriodJune 2026 – present
TypeCompany website + internal ERP/CRM + client portal
StatusPublic website live at beercat.cl; the platform is still in active development
CodePrivate; this case study uses screenshots and selected snippets

Stack

LayerTechnologies
BackendPython, Flask 3.1, SQLAlchemy 2, MySQL, Flask-Login, Gunicorn
FrontendJinja templates, framework-free JavaScript, custom CSS with tokens (dark and red theme), Chart.js, Cropper.js, Font Awesome
EmailRedis queue + Celery worker as a separate service, SMTP with retries, HTML templates
PaymentsWebpay Plus (Transbank SDK), with integration and production modes
AIGoogle Gemini (google-genai) to draft proposals and replies
FilesSwappable local / Amazon S3 storage with presigned URLs, CloudFront for static assets, ReportLab for PDFs
SecurityRoles, Cloudflare Turnstile, Google sign-in through explicit linking, audit log, UUIDv7 as the public identifier
DeploymentLinux with two systemd services: the web app and the email worker

Architecture

 Visitors and clients                      BeerCat team (admin, sales, support)
        |                                               |
        v                                               v
 +---------------------------------------------------------------+
 |  Flask (Gunicorn)                                             |
 |  public site | client portal | dashboard | /pago/<token>      |
 +---------------------------------------------------------------+
    |            |               |               |            |
    v            v               v               v            v
  MySQL     Redis (queue)    Gemini API      Webpay Plus   S3 / CloudFront
                 |
                 v
        Celery worker ---> SMTP
  • A Flask monolith with one blueprint per module (quotes, projects, inventory, purchases, portal, payments…). For a small team, a single deployment is easier to run than several services.
  • External services sit behind a manager with a swappable provider. storage, ai, payments and mail_queue are all initialized the same way (init_app), and the rest of the code doesn't know whether a file lives on disk or in S3, or which AI model is answering.
  • The web app never speaks SMTP. It renders the email, drops it in Redis and moves on. If the worker is down, emails wait in the queue until it comes back.

Features by area

AreaWhat it covers
Public websiteHome, services, how we work, FAQ and a contact form with categories; custom legal and error pages
ContactsInbox for website messages, email alert to admins and sales, AI-assisted reply and turning the message into a quote
QuotesSource channel, discovery, proposal (objective, scope, exclusions, timeline, price, payment terms), line items, versioned PDF and sending with open tracking
ProjectsKickoff → Development → Delivery → Support → Completed stages, activity log with notes visible or hidden to the client, payment milestones
PaymentsPublic page per milestone, Webpay checkout, manual recording of transfers and cash
ClientsCompanies and people with Chilean RUT and phone formatting; portal accounts created from their record
Client portalProjects, quotes, pending payments and automatic notices based on progress
OperationsHardware inventory, cash or installment purchases, support contracts and monthly recurring revenue (MRR)
DashboardMetrics per role: sales pipeline, pending payments, MRR, equipment, website visits
SystemUsers with roles, profiles with a croppable photo, audit log, password recovery
DownloadsPage for Sys Bootstrapper (another project of mine) with installers published from a command-line script

Main dashboard: open quotes, pending payments, recurring revenue, active equipment and website visits over the last 14 days

Deep dive

1. From message to quote, with AI as the first draft

Messages from the form land in an inbox. From there, one click turns the contact into a draft quote: the client's message becomes the problem to solve, and if no company has that email yet, one is created. The quote brings together everything that used to be scattered: discovery (the problem, who decides, the deadline, whether data needs migrating) and the proposal (objective, what's included, what's not, timeline, price, payment terms and conditions).

Quote list with filters by status, source channel, estimated value and owner

Every proposal field has a "Generate with AI" button. The browser sends the task and the context that already exists (title, company, problem, the salesperson's idea), and Gemini returns a draft for that field. I built it as a task registry: adding a new button on another screen means adding one entry to the dictionary and a button in the template, with no new endpoint.

# Simplified: each task defines its system instruction and how to build the prompt.
TASKS = {
    'quote_scope_excludes': {
        'system_instruction': _SALES_PERSONA,
        'build_prompt': _build_scope_excludes,  # uses what's already under "includes"
        'temperature': 0.6,
    },
    # quote_objective, quote_payment_terms, contact_reply, project_kickoff_summary…
}

There are eight tasks: six quote fields, the project kickoff summary and the reply to a contact. Tasks that depend on others receive what's already written; for example, "excludes" reads what's under "includes" so it doesn't contradict it. The AI only fills in the form. The team reviews, edits and decides what gets sent.

Quote proposal with Generate with AI buttons on objective, scope, exclusions and payment terms

2. Versioned PDFs and open tracking

Sending a quote generates a PDF with ReportLab and stores it as a new version (quotes/<code>/v<n>.pdf). If nothing changed since the last send, the previous version is reused instead of creating an identical one. Comparing the PDF bytes doesn't work for this, because ReportLab embeds the creation date and every file comes out different. So the hash is computed over the fields that appear in the document.

The email goes out with the PDF attached and a tracking pixel. When the client opens it, the system records the first open, how many times it was opened and from where, and the salesperson sees it on the quote.

3. From accepted quote to project

Accepting a quote creates the project with its sequential code, the client, the owner, the scope and the start date. The conversion is idempotent: if the quote already has a project, it returns that one instead of creating a duplicate. That way a double click or a retry never creates two projects.

The project moves through five stages, with "cancelled" as a side exit. The activity log mixes notes, calls, meetings, emails and stage changes, and each entry is marked as visible or hidden to the client. Whatever is visible is what the client sees in their portal.

Project page: stage bar, general details, payment milestones with their status and activity log

4. Webpay payments that hold up in the real world

Each payment milestone has a public page with an unguessable token. The team copies the link from the project page, and the client also finds it in their portal behind a "Pay" button. From there they pay with Webpay Plus. The money status only changes after the transaction is confirmed server to server with Transbank, never based on what the browser says.

Public payment milestone page: client, project, concept, amount and Pay with Webpay button

The edge cases took the most work:

  • Double returns. An F5, or a duplicated POST and GET, can arrive at the same time. The transaction is locked with SELECT … FOR UPDATE and the confirmation happens only once.
  • A confirmation that fails but went through anyway. If the confirmation errors out, the system checks the real status with Transbank before giving the payment up for lost.
  • Cancellation, timeout and form errors. Webpay returns different parameters in each case (TBK_TOKEN, only the purchase order, or both tokens). Each one leaves the transaction in its own state and the milestone goes back to "pending".
  • A stuck attempt never blocks. A new attempt marks any earlier ones that were left open as timed out.
  • Manual payment and Webpay at the same time. If a Webpay charge arrives for a milestone someone already marked as paid, the manual record isn't overwritten: an alert goes to the activity log and the audit log to check for a possible double charge.
  • Amounts in pesos. Webpay in CLP requires whole amounts, so a milestone with decimals can't be paid online.

Once paid, the milestone is recorded as debit or credit based on the card type, and if the project was still in Kickoff it moves to Development.

5. A client portal with notices that never go stale

Client accounts are created from a person's or company's record and receive their credentials by email. In the portal, clients see their projects, quotes and payments, plus a news panel: "you have a pending payment", "your project is ready for delivery", "we received your payment".

Those notices aren't stored in the database: they are computed on every visit from the projects, quotes and payments. That way no dashboard route has to remember to "emit" a notice, and they never fall out of sync with what the team did. The only thing stored is which notices each account dismissed, keyed per event. A new event (another stage change, another payment attempt) brings a new key, and the notice shows up again. Notices are sorted by urgency, with whatever needs the client's action first.

Client portal: welcome, news with a pending payment and a project ready for delivery, summary and quotes

6. Email in the background

The web app renders the email (HTML, text and attachments) and publishes it to a Redis queue. A Celery worker, running as a separate systemd service with the same code, delivers it over SMTP. Only transient failures are retried (network, timeouts, 4xx replies): up to six times, with exponential backoff and jitter from 30 seconds to 10 minutes. A nonexistent recipient or an invalid payload fails right away.

I documented the known limits instead of hiding them: delivery is "at least once", and an email that runs out of retries only leaves a trace in the log. The queue and SMTP code have 23 tests, with a fake SMTP server and no Redis needed.

7. Security without overdoing it

  • UUIDv7 as the public identifier. URLs, forms and JSON only expose a UUIDv7. The integer id is still the internal key, but it never leaves the server, so nobody can enumerate records or count clients by looking at a URL. Since the first 48 bits of a UUIDv7 are a timestamp, the index grows at the end like an auto-increment one, and it's stored as BINARY(16), half the size of a CHAR(36). I migrated every model in a single change.
  • Changing the password ends other sessions. The identifier stored in the cookie carries a fingerprint of the current password. If the password changes, sessions open in other browsers stop working. Links to set or reset a password use the same fingerprint, so they stop working as soon as they're used.
def get_id(self):
    # What Flask-Login stores in the cookie; changes with every new password.
    return f'{self.uuid}:{self.password_fingerprint()}'
  • Google sign-in only through linking. You first sign in with a BeerCat username and password and, once inside, link your Google account from your profile. From then on, the login looks up the Google identifier, never the email. If the Google email doesn't match the account's, it has to be confirmed before anything is saved.
  • Private files kept out of public reach. The /media proxy only serves public folders (profile photos and installers). Quote PDFs have predictable paths, so they only travel as email attachments. There are tests for this.
  • Small things that add up. Cloudflare Turnstile on login, SameSite=Lax cookies that are Secure under HTTPS, the app refuses to start without a SECRET_KEY, a reset link lasts one hour with at least one minute between requests (tracked in Redis), and temporary passwords avoid ambiguous characters (0/O, 1/l/I) because they're sometimes read off a screen and spoken aloud.
  • Audit log. Key business actions are recorded with the actor, entity, field diff, IP and route. The actor's name is copied into the row, so the record survives even if the user is deleted. The log doesn't record page views or reads, so it doesn't grow out of control.

Audit log: sign-ins, failed attempts, created quotes and registered equipment, with filters by category and date

8. A visual identity with cats

We wanted a brand that was serious but had personality, so BeerCat is dark and red, and it has cats. The home page has a Roman cat with a laptop, "A normal day at BeerCat" shows cats coding and another one asleep on the servers, and the login screen has a cat between beer tanks and server racks. The dashboard and the portal follow the same dark and red palette as the website. Heavy assets (images, the hero video) are served from CloudFront and fall back to /static in development.

A normal day at BeerCat section: a cat coding next to a beer and another one looking after the servers

Sign-in screen with a cat between beer tanks and servers, and Google sign-in

Challenges that taught me something

  • A hash that would change on its own. To avoid creating identical PDF versions, comparing the files doesn't work: ReportLab stores the creation date inside and every PDF comes out different. You have to compare the data, not the file.
  • A payment isn't over when the browser comes back. The clean return is only one of the paths. There are also double returns, cancellations, timeouts and simultaneous manual payments, and each one needed its own handling.
  • Celery on macOS. The worker received the tasks, but the child process crashed: on a Mac the prefork pool uses spawn, not fork. In development I use --pool=solo, and I wrote it down in the queue's README.
  • Integer ids say more than they seem to. /proyectos/7 tells anyone how many projects there are and invites them to try 8. Moving to UUIDv7 touched 43 files, but it closed that door without losing index ordering.

By the numbers

MetricValue
Commits (June – October 2026)106, all mine
Models24 (plus 2 association tables)
Routes~90 across 17 blueprints
Jinja templates62
Python (app)~8,200 lines
Tests33 (email queue, SMTP, sessions, /media, release publishing)
Roles4 (admin, sales, support, client)
AI tasks8

What I take away

BeerCat is the project where I made the most decisions on my own, because there was no other developer to ask. I learned to pick the simple option when it's enough (a monolith, templates with no frontend framework, a single queue just for email) and to spend the effort where money or client data is at stake: payments, sessions, private files. I also take away that an internal system has to be designed around the people who use it every day: if the team has to remember to tell the client something, sooner or later they'll forget.

All screenshots use demo data; names, companies and amounts are fictitious.

Project screenshots

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6 Screenshot 7 Screenshot 8 Screenshot 9 Screenshot 10
← All projects