- The Community Network Builder helps you estimate and understand the cost of building and operating a community network anywhere in the world.
- Users can select the frequencies available in their context or proceed with the default ISM bands of 2.4GHz and 5.8GHz, which are widely available globally.
- You can model mobile or Wi‑Fi networks, fixed wireless, fibre‑to‑the‑home, public access facilities, or any combination of these. Radio coverage accounts for terrain visibility and land cover around each configured location.
- Users design the network by adding locations, radii, and technologies. Area is derived from location radii, while population can be modelled from coverage geometry or overridden with a household count for an individual location.
- The Association for Progressive Communications (APC) commissioned Systems Knowledge Concepts (SKC) and Telco2 to develop a quantitative economic and financial model to enable the evaluation of the financial sustainability of different community‑based communications solutions in under‑serviced communities.
- Systems Knowledge Concepts is an Australian economics consultancy specialising in telecommunications and economic development. Telco2 designs and builds innovative networks for broadband, public safety, utilities, and the Internet of Things.
- Simon Molloy and Barry Burgan of SKC worked with Jonathan Brewer of Telco2 to develop and integrate the model into an Excel sheet. This team collaborated with Carlos Rey‑Moreno and Mike Jensen of APC on the work in 2024.
- Telco2 ported the Excel model to Python and developed a prototype web user interface for it in 2025.
- Matthew Holloway developed a single‑page architecture user interface for the application in 2026.
- An advisory committee accompanied this process: Jane Coffin, Revi Sterling, Laina Green, Steve Song, Ben Matranga and representatives of Connect Humanity (initially Jochai Ben‑Avie, and later Erica Mesker, Brian Vo and Nathalia Foditsch).
- The development of this application is part of the Local Networks initiative, a collective effort led by APC and Rhizomatica in partnership with grassroots communities and support organisations in Africa, Asia and Latin America and the Caribbean. Its production was supported by the "Meaningful community‑centred connectivity" project implemented with financial support from the Swedish International Development Cooperation Agency (Sida) and UK International Development from the UK Government through its Digital Access Programme. The views expressed here do not necessarily reflect the supporters' views.
- FastAPI (Python) for the web API and server-rendered endpoints
- Pydantic v2 for request/response models and validation
- Pandas for data handling and tabular computations
- numpy‑financial for financial calculations
- Requests for upstream HTTP calls
- python‑dotenv for environment configuration
- Jinja2 templates (via FastAPI) for server‑rendered pages
- React + TypeScript (see
spa/src/...with.tsxfiles) - Vite build pipeline producing static assets in
spa/distserved by FastAPI at/assets
- Menu and lookup data come from the immutable SQLite seed at
app/data/app.db. - Container startup copies the seed into the ignored
runtime/directory when no runtime database exists, then applies Alembic migrations to that copy. - Coverage and population modelling uses the GLO-30 viewshed, ESA WorldCover, and WorldPop services.
- Documentation/QSG content is now in git and is rendered into
/documentationand/qsgrespectively.
The application requires all three APIs below and valid bearer tokens for them. The network model does not function if an API is unavailable or incorrectly configured.
GLO-30 supplies viewsheds from the Copernicus GLO-30 digital elevation model. The application uses each viewshed to calculate the visible radio-coverage area from a tower.
ESA WorldCover supplies land-cover fractions for a coverage area. The application uses its tree-cover and mangrove fractions to estimate vegetation loss and reduce the calculated radio range.
WorldPop estimates the population inside a coverage area for a selected country. The application uses this estimate when a user does not supply a household-count override for a location.
- Single repo with a Python FastAPI backend and a static SPA frontend.
- Backend mounts static directories and serves:
/— public sign-in page/app— SPA entry/docs— authenticated API documentation for API-enabled users/qsg— Quick Start Guide/documentation— user documentation/login— authentication page for administrators and API-enabled users/api/*— lookup and modelling routes
Prerequisites
- Git
- Docker Engine
- Docker Compose
- Copy
.env.exampleto.envand provide the deployment values. - Set
JWT_SECRETto a long random value before you start the application. - Set
SESSION_COOKIE_SECURE=truefor a production HTTPS deployment. - Coverage calculations require
GLO30_API_URL,GLO30_API_TOKEN,ESAWC_API_URL,ESAWC_API_TOKEN,WPOP_API_URL, andWPOP_API_TOKEN. - Generated viewsheds are cached in
cache/geojsonby default; setGEOJSON_CACHE_DIRECTORYto a persistent volume path to override it. Entries expire after 30 days. When the cache exceeds 1 GB, least-recently-used entries are removed first.
Build and run through Docker Compose:
docker compose up --buildRun the backend suite in its dedicated Python 3.14 test image:
docker compose build test
docker compose run --rm test pytestOpen in your browser:
- App: http://localhost:8000/
- Sign in (unlinked): http://localhost:8000/login
- OpenAPI (Swagger UI): http://localhost:8000/docs
- Quick Start Guide: http://localhost:8000/qsg
- Documentation: http://localhost:8000/documentation
- Database Admin (administrator session only): http://localhost:8000/admin/database/
Create the first administrator after the application database starts:
docker compose run --rm web-locnet python -m app.admin create-admin admin@example.comThe command reads the password from the terminal. It does not print or store the plain password.
Remove a user with the administration command:
docker compose run --rm web-locnet python -m app.admin remove-user user@example.comThe production database is runtime/app.db. Docker Compose bind-mounts the host runtime/ directory into the application container.
The same directory is mounted read/write by the internal sqlite-web service. It is
available only through the Nginx-protected administrator editor at /admin/database/;
sqlite-web has no published port or separate credentials.
A normal image rebuild does not replace this file. At container startup, the entry point completes these actions:
- It checks for the runtime database.
- If the runtime database is absent, it copies
app/data/app.dbtoruntime/app.db. - If the runtime database exists, it does not copy the seed database.
- It applies pending Alembic migrations to the runtime database.
- It starts the application with the existing data.
Thus, docker compose up --build keeps the production users, API tokens, caches, and other runtime data.
The production docker-compose.yml file is not in Git. A Git pull does not update this file.
Complete these steps before the first deployment of this database layout:
- Stop the application.
- Back up the existing
app/data/app.dbfile outside the repository. - Pull the application changes.
- Copy the database backup to
runtime/app.db. - Update
docker-compose.ymlfromdocker-compose.yml.example. - Make sure that
DATABASE_URLpoints to/app/runtime/app.db. - Make sure that Compose mounts
./runtimeat/app/runtime. - Build and start the application.
- Examine the application and the Alembic revision before you remove the backup.
Do not rely on the image build to transfer the old production database. Copy the stopped database explicitly.
Use this procedure for each production update:
- Stop
web-locnetbefore you copy the SQLite file. - Copy
runtime/app.dbto a backup location outsideruntime/. - Pull the application changes.
- Review changes in
docker-compose.yml.example. - Apply necessary changes to the production
docker-compose.ymlfile. - Run
docker compose up --build -d. - Examine the application logs for Alembic errors.
- Test the application before you remove the backup.
The entry point applies each pending migration once. A migration can change existing data, so keep a backup for each deployment.
The file app/data/app.db is an immutable seed database. A rebuild does not copy a changed seed over an existing runtime database.
Supply reference-data changes through an Alembic data migration or another explicit import process. Do not edit the production seed database.
Production data can be lost in these conditions:
- An operator deletes or replaces
runtime/app.db. - The Compose mount points to a different host directory.
- A new server starts without a copy of the existing
runtime/directory. - A migration deletes or incorrectly changes data.
- The SQLite file becomes corrupt and no usable backup exists.
To move the application to a new server, stop the old application and transfer runtime/app.db before startup.
Production docs and quick start
- Quick Start Guide: https://locnet.io/qsg
- Documentation: https://locnet.io/documentation
- The public SPA uses the separate
/web/api/*browser-service routes. - An administrator can enable persistent API access for a normal user.
- Every
/api/*request requires that token asAuthorization: Bearer TOKEN. - The application stores only the token digest and shows the plain token once.
- Signed-in normal users and administrators can open Swagger at
/docs.
Playwright is a browser automation and end-to-end testing framework for web applications. It is useful for checking that the app behaves correctly in real browsers, with real user actions such as clicking, typing, selecting options, and waiting for UI updates. The official documentation is here: Playwright docs.
This repository keeps its Playwright tests in the separate playwright/ package. The current tests are:
playwright/tests/locnet.spec.ts- Verifies that the app loads and the page title contains
Community Network Builder. - Loads sample builder data into the browser, fills out a representative network configuration, clicks
Calculate network, and checks that the report section appears.
- Verifies that the app loads and the page title contains
playwright/tests/technologies.spec.ts- Opens the app, selects a country, and verifies that the
Introductionsection is visible after the page updates.
- Opens the app, selects a country, and verifies that the
Install and run Playwright through Docker Compose:
docker compose run --rm --no-deps playwright npm ci
docker compose run --rm playwright npm testThe Playwright service starts an isolated application on port 8011. It uses disposable users, data, geospatial services, and map services.
- Issues and pull requests are welcome. Please discuss major changes via an issue before submitting a PR.
- © 2024–2026 APC, SKC, Telco2, ISOC and contributors. See repository's LICENSE file for details.
- For general support, please join the Community Network Builder Mailing list