ApplicationsMITIntermediate

Local JSON API

Build a small notes application that saves data locally and works in the browser.

By Actium Labs · 10 minutes to set up

Follow publisher

What you’ll build

Learn how a complete application fits together: a Python HTTP server, a SQLite database and a browser client. Create, list and delete notes. This local development starter binds to localhost; add authentication and a production server before exposing it to the internet.

Make it yours

  1. Download and extract

    Open a terminal inside the local-json-api folder.

  2. Start the application

    The database is created automatically in this folder.

    python3 server.py
  3. Use it

    Open http://127.0.0.1:8765 in your browser. Add a note, refresh and check that it persists.

  4. Run tests

    Tests use a temporary database, leaving your notes unchanged.

    python3 -m unittest discover -v

Explore the source

Loading source…
Open raw source ↗

Questions and improvements

Share what you build, ask for help or suggest a variation.

Start a discussion →