Polis-compatible API implementation for LitePolis
Project description
LitePolis Router Default
A drop-in backend for the Polis 1.0 frontend, built on the LitePolis infrastructure.
If you're running a Polis instance (the civic engagement platform with opinion clustering) and want a lightweight, modular backend, this package provides the full /api/v3/* API surface that Polis clients expect — including client-admin, client-participation, and client-report.
What This Is
litepolis-router-default is an API router package for LitePolis. It handles authentication, conversations, participants, comments, votes, and invites — everything the Polis frontend needs to function.
Prerequisites
- Python 3.10+
- LitePolis installed (
pip install litepolis)
Deploy with LitePolis
The recommended way to use this package is through litepolis-cli, which manages all router and database packages for you.
LitePolis uses a packages.txt file (like requirements.txt) to declare which packages your deployment needs. The default location is ~/.litepolis/packages.txt. You can add into the packages.txt file instead of using litepolis-cli deploy.
1. Install the LitePolis CLI
pip install litepolis
2. Confirm this router is in your deployment
litepolis-router-default is included by default if you install with litepolis[default]. You can verify:
litepolis-cli deploy list-deps
If it's not listed, add it:
litepolis-cli deploy add-deps litepolis-router-default
3. Initialize configuration
litepolis-cli deploy init-config
Edit the generated config file to set your secret key and other settings:
nano ~/.litepolis/config.conf
4. Start the server
litepolis-cli deploy serve
Your Polis-compatible API will be available at http://localhost:8000/api/v3/.
You can now point any Polis frontend (e.g. the CivicTechTo/polis clients) at this URL as the backend.
Configuration
Key settings in ~/.litepolis/config.conf:
| Setting | Default | Description |
|---|---|---|
jwt_secret |
dev-secret-key |
Change this in production |
jwt_expire_hours |
168 |
Token lifetime (7 days) |
LITEPOLIS_PORT |
8000 |
Port to serve on |
Connecting a Polis Frontend
Once your LitePolis server is running, configure the Polis frontend to point to your server's address. In the CivicTechTo/polis repo, this is typically the API_URL environment variable in the client configuration.
The API base path is:
http://<your-server>:<port>/api/v3
Supported Polis API Endpoints
This router implements the full Polis v3 API:
- Auth — register, login, logout, password reset
- Users — profile read/update
- Conversations — create, list, update, open/close
- Participants — join conversations, session init
- Comments — submit, moderate, get next for voting
- Votes — agree / disagree / pass
- Invites — create and join via invite code
Note: Math/visualization endpoints (
/math/pca,/math/pca2) currently return stub data. Full clustering output requires a separate math service.
Known Limitations
- Math/PCA visualization is not yet computed (stub endpoints)
- Email notifications are not implemented
- Social/OIDC login is not yet supported
Related
- LitePolis — the core platform
- LitePolis Database Default — the default database layer
- Polis (CivicTechTo) — the frontend this router is compatible with
- Awesome LitePolis — browse available LitePolis packages
License
See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file litepolis_router_default-0.1.0.tar.gz.
File metadata
- Download URL: litepolis_router_default-0.1.0.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1fb488eb57bcf8ad6b5f73a5030701b898aacd10580802225392305eac52dea
|
|
| MD5 |
12dbb247d7ff774a47b4ad6686420170
|
|
| BLAKE2b-256 |
1be595c8fb95eb7fcdefb86b906f25ca9e4fbba4809f38f3f9f87d7c518379f8
|
Provenance
The following attestation bundles were made for litepolis_router_default-0.1.0.tar.gz:
Publisher:
python-publish.yml on NewJerseyStyle/LitePolis-router-default
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litepolis_router_default-0.1.0.tar.gz -
Subject digest:
e1fb488eb57bcf8ad6b5f73a5030701b898aacd10580802225392305eac52dea - Sigstore transparency entry: 1048149611
- Sigstore integration time:
-
Permalink:
NewJerseyStyle/LitePolis-router-default@06c77bbfa0f259cfb572e60841d577077d02df5f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/NewJerseyStyle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@06c77bbfa0f259cfb572e60841d577077d02df5f -
Trigger Event:
release
-
Statement type:
File details
Details for the file litepolis_router_default-0.1.0-py3-none-any.whl.
File metadata
- Download URL: litepolis_router_default-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1e70a636d5beb2f479036c0d48d49e4954e42e1e35dfea9e70b895427470bb0
|
|
| MD5 |
76f64021de9fb96d8964c09458c274d2
|
|
| BLAKE2b-256 |
60489c50d692a9d18efe09dc10a8dd19d0faf99c1e03371fb2d41a8d0607e2fc
|
Provenance
The following attestation bundles were made for litepolis_router_default-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on NewJerseyStyle/LitePolis-router-default
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litepolis_router_default-0.1.0-py3-none-any.whl -
Subject digest:
c1e70a636d5beb2f479036c0d48d49e4954e42e1e35dfea9e70b895427470bb0 - Sigstore transparency entry: 1048149665
- Sigstore integration time:
-
Permalink:
NewJerseyStyle/LitePolis-router-default@06c77bbfa0f259cfb572e60841d577077d02df5f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/NewJerseyStyle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@06c77bbfa0f259cfb572e60841d577077d02df5f -
Trigger Event:
release
-
Statement type: