- JavaScript 54.8%
- Python 27.8%
- HTML 9.5%
- Shell 3%
- Just 2%
- Other 2.9%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| apps | ||
| deploy | ||
| virtual_attorney | ||
| .coveragerc | ||
| .dockerignore | ||
| .gitignore | ||
| .isort.cfg | ||
| .pre-commit-config.yaml | ||
| ansible.cfg | ||
| build.config.js | ||
| bun.lock | ||
| docker-compose-deploy.yml | ||
| docker-compose.yml | ||
| docker-entrypoint.sh | ||
| Dockerfile | ||
| justfile | ||
| manage.py | ||
| package.json | ||
| pyproject.toml | ||
| pytest.ini | ||
| README.md | ||
| uv.lock | ||
Virtual Attorney
✏️ Develop
To begin you should have the following applications installed on your local development system:
- Python >= 3.14.4
- bun
- uv
- just (command runner - installation instructions)
- Postgres >= 17
- git >= 2.26
💪 Setup Manually
1. Get the project
First clone the repository from Github and switch to the new directory:
$ git clone git@github.com:caktus/virtual_attorney.git
$ cd virtual_attorney
2. Set up virtual environment
Next, set up your virtual environment with python3. For example, virtual_attorney.
You will note the distinct lack of opinion on how you should manage your virtual environment. This is by design.
3. Install dependencies
nvm is preferred for managing Node versions and .nvmrc contains the
specific Node version for this project. To install the correct (and latest)
Node version run:
(virtual_attorney)$ nvm install
Now install the project Node packages with npm:
(virtual_attorney)$ npm install
Install Python dependencies with:
(virtual_attorney)$ just setup
NOTE: This project uses uv for Python dependency management. To update dependencies:
(virtual_attorney)$ just update-requirements
To add or modify dependencies, edit the pyproject.toml file and run just update-requirements.
4. Pre-commit
pre-commit is used to enforce a variety of community standards. CI runs it, so it's useful to setup the pre-commit hook to catch any issues before pushing to GitHub and reset your pre-commit cache to make sure that you're starting fresh.
To install, run:
(virtual_attorney)$ pre-commit clean
(virtual_attorney)$ pre-commit install
5. Set up local env variables
Next, we'll set up our local environment variables. We use
django-dotenv to automatically read
environment variables located in a file named .env in the top level directory of the
project (but you may use any other way of setting environment variables, like direnv or
manually setting them). The only variable we need to start is DJANGO_SETTINGS_MODULE:
(virtual_attorney)$ cp virtual_attorney/settings/local.example.py virtual_attorney/settings/local.py
(virtual_attorney)$ echo "DJANGO_SETTINGS_MODULE=virtual_attorney.settings.local" > .env
6. Database
The setup for local development assumes that you will be working with dockerized services.
First add the following line to your .env file:
(virtual_attorney)$ echo "DATABASE_URL=postgres://postgres@127.0.0.1:5435/virtual_attorney" >> .env
The docker-compose.yml sets up environment variables in a file, .postgres.
To use the Docker setup, add these lines to that file:
POSTGRES_DB=virtual_attorney
POSTGRES_HOST_AUTH_METHOD=trust
If you want to connect to the database from your host machine, export the following shell environment variables:
export PGHOST=127.0.0.1
export PGPORT=5435
export PGUSER=postgres
export PGDATABASE=virtual_attorney
7. Migrate and create a superuser
(virtual_attorney)$ docker-compose up -d
(virtual_attorney)$ just migrate
(virtual_attorney)$ just createsuperuser
8. Run the server
(virtual_attorney)$ just run-dev
After initial setup the development server should be run using just run-dev this will remove any deployment containers hanging around and setup using local sources and database.
9. Access the server
The Django admin is at /admin and the Wagtail admin is at /cms.
10. Run tests
virtual_attorney uses pytest as a test runner.
(virtual_attorney)$ just run-tests