Skip to content

Development Quick Start

Michael Pisman edited this page Aug 7, 2025 · 1 revision

Development Quick Start

Prerequisites

  • Python 3.11 or higher
  • MongoDB (local or cloud instance)
  • Git

Clone the Repository

git clone https://github.com/csed-ucm/psephos.git

Or using GitHub CLI:

gh repo clone csed-ucm/psephos

Set Up Development Environment

Create Virtual Environment

pip install virtualenv
python -m venv venv

Activate the virtual environment:

Linux/macOS:

source venv/bin/activate

Windows:

venv\Scripts\activate

Install Dependencies

pip install -r requirements.txt

For testing and development tools:

pip install -r test-requirements.txt

Running the API

Option 1: Using Main Script

python main.py run --reload --port 8000

Option 2: Editable Installation

Install the package in editable mode:

pip install -e .

Then run:

unipoll-api run --reload --port 8000

Configuration

Create a .env file in the project root:

MONGODB_URL=mongodb://localhost:27017
SECRET_KEY=your-secret-key-here
ADMIN_EMAIL=admin@example.com
HOST=0.0.0.0
PORT=9000
RELOAD=True
ORIGINS=*

Or use the interactive configuration wizard:

unipoll-api setup

Verify Installation

Once running, visit:

  • API Documentation: http://localhost:9000/docs
  • Alternative Docs: http://localhost:9000/redoc
  • Health Check: http://localhost:9000/ (should return API info)

Next Steps

Clone this wiki locally