Skip to content

Build your first Micro-SaaS feature: a working local lab

Create, update and retrieve proposals with Python and SQLite; learn to check behavior and understand why this is not yet production SaaS.

Build your first Micro-SaaS feature: a working local lab
In this article

We’ve defined a small job and deliberately excluded unnecessary features. Now we’ll implement one real workflow: create a proposal, find it in a list, change its status and retrieve it after restarting the application.

The goal is not to promise a complete commercial SaaS in a single lesson. We’ll make a local web prototype with SQLite storage, using only Python’s standard library. No cloud account, packages, API tokens or payment provider are required.

By the end: you can start a local web app, enter fictional data, update proposal status and run automated tests. You’ll also understand what remains before the product could responsibly serve real users.

Advertisement Precivo

Before you start

This hands-on route uses Python 3.10 or newer, a terminal and a browser. Nontechnical readers can follow the workflow and apply the same acceptance criteria in a visual builder, but running the commands requires basic terminal skills.

The example lives in the trail repository. It includes:

  • app.py: local HTTP interface, input validation and SQLite persistence.
  • test_app.py: checks for creation, status changes, invalid input and HTML escaping.
  • README: instructions and boundaries.

Use invented data only. There is no authentication, tenant authorization, HTTPS, backup or billing. The server binds to 127.0.0.1 so it is not a public service.

Run it on your computer

If you’ve cloned the repository, enter the example folder. Otherwise get the files from GitHub and keep their structure.

cd examples/saas-propostas-local
python3 --version
python3 app.py

Expected startup message:

Local lesson: http://127.0.0.1:8765 — Ctrl+C to stop

Open http://127.0.0.1:8765 on the same machine. You should see a form and an empty list. 127.0.0.1 is your local computer, not a public URL.

If the port is occupied, stop the conflicting process or change the port in the program. Install Python from a supported source if needed.

Advertisement Flokin

One end-to-end run

This preview shows the expected interface. It is not interactive: to persist data and change statuses, run the Python application on your own computer.

What the local proposal tracker looks like

Illustrative, non-interactive preview of the tested Python app. To create or update a proposal, run the real local code from the repository.

127.0.0.1:8765LOCAL ONLY

Proposal tracker

Teaching demo · no real customer data

New proposal Fictional customer
Ateliê Horizonte
Title
Information website
Create draft
Saved proposals
SENTInformation websiteAteliê Horizonte

Status remains after restarting the local app because it is stored in SQLite.

The diagram is a visual example, not a live SaaS or a public server. See executable code and tests.

Enter these fictional values:

FieldExample
CustomerHorizon Studio
ProposalInformation website
Status at creationDraft

Create the entry. It should appear in the list. Change its status to Sent and submit. The updated state should be visible.

Stop the server with Ctrl+C and run it again. The proposal should remain because the data is stored in a local SQLite file. Persistence is not multi-user readiness: this is still a single-computer teaching exercise.

What do the buttons actually do?

Local lab architecture

The browser communicates with a loopback-only Python server that persists proposals to local SQLite. There is no authentication or tenant isolation.

Diagram source in Mermaid. Illustrative; the text defines the actual rules.

The application uses Python’s standard-library HTTP server and a SQLite table named proposals.

  • Opening the page queries stored records.
  • Creating a proposal validates customer and title, then inserts a row with SQL parameters.
  • Updating status rejects values outside the allowed set.
  • Rendering titles escapes HTML so user input is shown as text.
  • Form posts carry a basic token designed to reject requests without the valid token.

These are useful precautions, but not proof of production security. There is no identity service, authorization, monitoring or data-retention policy. Do not expose the port or add actual customer records.

Verify the behavior with tests

Open a second terminal in the same folder:

python3 -m unittest -v test_app.py

The included test suite checks:

CheckExpected behavior
Create and listNew proposal appears
Change statusNew status persists
Blank titleRequest is rejected
Incorrect form tokenRequest is rejected
Invalid statusRequest is rejected
HTML-like contentDisplayed as text, not executed

A successful run should show test cases with ok and an overall OK result. A failure shows which method to investigate. These tests are provided as part of the tutorial; their actual execution and results must be verified in the reader’s environment or the branch CI before the lesson is approved.

Don’t simply ask an AI assistant to “fix everything” after a failure. Read the error, identify which acceptance criterion failed, and ask for a targeted explanation before changing code.

Use AI without giving away control

A bounded prompt:

Read the lesson’s acceptance criteria and the local application. Explain which code satisfies each rule, identify untested failure cases and suggest one new test at a time. Don’t add packages, improvised authentication, deployment, payments, internet access or real user data. Don’t claim to run tests unless you show the output.

The agent can propose changes, but you still need to rerun the suite. The skill is building and checking a small feature, not letting a model certify itself.

What about no-code?

Build a proposals table, input form, list and status update in a visual builder. Use fictional records and apply the same acceptance criteria. This can teach product flow without Python. It doesn’t demonstrate that the provider safely handles different customers or recovery.

If you cannot verify who is authorized to see every record, do not promote the exercise to external users.

What this prototype is not

This is not a complete SaaS. It cannot safely serve multiple organizations, does not provide operational recovery or billing, and promises no uptime. A browser, server and database don’t automatically make continuously operated software.

The next lesson introduces identity, tenant authorization, recovery and deployment requirements before real users arrive.

Further reading: Python — http.server, Python — sqlite3 and OWASP — Authorization.

More in Tutorials

See all

Advertise

Solopreneurs, makers and creators who use AI and automation every day. Editorial and media formats for brands that bring real value to this reader.

Talk to us about formats

Every partnership goes through editorial approval. No misleading promises.

  1. Sponsored articles Useful content, in the Caminho Solo tone and standard.
  2. Banners and display Placements in strategic areas of the site.
  3. Commercial partnerships Series sponsorships, affiliate partnerships, and custom campaigns.
  4. Native content Guides, tutorials or comparisons featuring your product.

Get in touch

Let's talk

Have questions, suggestions, or want to collaborate? Fill out the form below and we'll get back to you soon.

Prefer email?

contato@caminhosolo.com.br

We respect your privacy. Your data will only be used to respond to your message.