ArguMentor is a platform to train reasoning and decision-making skills. Users can construct arguments to challenging questions, improve with AI-driven feedback and track their progress.
docker compose build
docker compose upAccess the application at http://localhost:8000.
Create and activate a virtual environment, for example via uv:
uv venv
source .venv/bin/activateInstall dependencies in editable mode:
uv pip install -e .Install JavaScript dependencies:
npm installInstall PostGreSQL:
brew install postgresqlCreate a database:
brew services start postgresql
psql -U postgres -c "CREATE DATABASE argumentor;"Apply all existing db migrations:
flask db upgradeStart app:
DEV=true USE_LLM_EVALUATOR=false python -m src.appStart app with gunicorn (production setup):
gunicorn --bind localhost:8000 src.app:appInstall dev dependencies:
uv pip install -e ".[dev]"Create a .env file from .env_template and specify values.
Install pre-commit hooks for auto-formatting:
pre-commit installRun tests:
pytest tests/Deploy to Heroku:
git push heroku mainSetting up buildpacks for heroku (in case app needs to be configured from scratch):
heroku buildpacks:add heroku/pythonRecreate db for local development:
flask recreate_dbUpgrading users:
flask list_users
flask upgrade_userThis project uses Flask-Migrate (and Alembic) to manage database schema changes. Follow these guidelines to keep your migration history clean and your environments in sync.
-
Update models.py
-
Generate a New Migration Script:
flask db migrate -m "Describe your changes here"This will generate a migration script in the migrations/versions/ directory. Always review it to ensure it reflects your intended changes.
- Apply the migration:
flask db upgrade- Push changes and deploy to Heroku
The Procfile is configured to run migrations on each deploy, which ensures that Heroku automatically applies any pending migration scripts during the release phase.
To handle expired subscriptions automatically, set up a daily check using Heroku Scheduler:
- Install the Heroku Scheduler add-on:
heroku addons:create scheduler:standard- Open the Scheduler dashboard:
heroku addons:open scheduler-
Add a new job with the following settings:
- Frequency: Daily
- Time: Select a low-traffic time (e.g., 3:00 AM UTC)
- Command:
curl "https://<add-domain-here>.herokuapp.com/check-subscription-expirations?api_key=$SECRET_KEY"
-
Make sure the
SECRET_KEYenvironment variable is set in your Heroku app:
heroku config:set SECRET_KEY=your_secure_api_keyThis ensures expired subscriptions are automatically downgraded to the free tier when they reach their end date.
