| .vscode | ||
| admin | ||
| campaign_manager | ||
| features | ||
| GIS/SLD | ||
| git-hooks | ||
| migrations | ||
| tests | ||
| .envrc | ||
| .envrc.ps1 | ||
| .gitignore | ||
| alembic.ini | ||
| developer-requirements.txt | ||
| Dockerfile | ||
| README.md | ||
| requirements.txt | ||
| TODO.MD | ||
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
- PostgreSQL 18 - Database
- Python 3.13 - Software
- Alembic - Database migrations
- Behave - Feature definition, Behavior Driven Development
- Flask - Web framework
- SQlModel - ORM
- Pytest - Unit testing
- mypy - Static type checking
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