No description
Find a file
2025-11-25 17:11:25 +13:00
.vscode work in progress which has been lingering 2024-02-05 16:06:46 +13:00
admin :fix functional dockerfile 2025-11-25 12:07:37 +13:00
campaign_manager :feat adds map to jurisdiction types 2025-11-25 17:11:25 +13:00
features work in progress which has been lingering 2024-02-05 16:06:46 +13:00
GIS/SLD :feat zooms to polygon 2025-10-23 13:45:31 +13:00
git-hooks work in progress which has been lingering 2024-02-05 16:06:46 +13:00
migrations :feat finds area by lat lng 2025-11-20 16:52:01 +13:00
tests :feat returns json payload of jurisdictions 2025-11-21 10:56:29 +13:00
.envrc moves to python3.12 2024-04-07 13:53:39 +12:00
.envrc.ps1 :feat start updating index page styles 2025-11-24 19:45:36 -05:00
.gitignore :feat test server setup 2025-11-17 15:43:20 +13:00
alembic.ini first database migration 2024-05-27 15:35:28 +12:00
developer-requirements.txt first database migration 2024-05-27 15:35:28 +12:00
Dockerfile :fix functional dockerfile 2025-11-25 12:07:37 +13:00
README.md :clean merge main 2025-11-24 21:23:37 -05:00
requirements.txt :feat creates docker image 2025-11-21 16:07:48 +13:00
TODO.MD :feat login and logout pages 2024-12-30 15:58:35 +13:00

CampaignManager

Current Usage

This project is being used publicly as a source of truth for geographic infomation.

Vision

This software allows a team to co-ordinate a political or public relations campaign. This software includes elements of a Customer Relationship Management (CRM) tool and a project management tool.

Features are defined in the features directory.

Tools

Installation

#TODO: Add installation instructions

Getting to postgres

docker run --name campaignmanager-postgres \
    -e "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" \
    -p  127.0.0.1:5432:5432 \
    -d postgres

Usage

Very early days

flask run --debug

The --debug flag enables hot-reloading and detailed error pages for development.

Migrations

python -m alembic revision --autogenerate -m "reason"

Then review the changes in the generated file in the alembic/versions directory. Then apply the changes with:

python -m alembic upgrade head

Grants

If you're not logging in as the database owner (which is the design for production, but overhead for dev) then you'll need:

GRANT ALL ON DATABASE ? TO ?;
GRANT ALL ON SCHEMA public to ?;
GRANT ALL ON ALL TABLES IN SCHEMA public to ?;

You might need this too:

SELECT 'ALTER TABLE '|| table_name||' OWNER TO ?;'
FROM Information_schema.tables
WHERE table_schema = 'public';

Docker

To build the docker image simply run:

docker build -t campaign-manager .

Then

docker save -o ~/Downloads/CM-20251124.tar campaign-manager

Upload with scp then install with

OAuth

The OAuth logins require configuration at the far end.

Nationbuilder

The "App" in Nationbuilder uses this callback URL http://127.0.0.1:5000/login/nationbuilder/authorized

Support

No support for this version

Contributing

Python code is formatted with black and linted with flake8 Development has been done on OSX 14, dependencies on that platform un not desired, but probably exist.

#TODO: Add contributing guidelines

Authors and acknowledgment

Steven Ensslen

License

GNU AFFERO GENERAL PUBLIC LICENSE Version 3 https://www.gnu.org/licenses/agpl-3.0.html