Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .docker/docker-compose.beta.yml

This file was deleted.

9 changes: 8 additions & 1 deletion .docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
- db_table=us_code_2025
build:
context: ../backend
dockerfile: .docker/Dockerfile.fastapi
dockerfile: .docker/Dockerfile
volumes:
- ../backend:/usr/src/app/
ports:
Expand All @@ -50,6 +50,13 @@ services:
- congress_postgres
networks:
parser:
entrypoint: "uvicorn"
command:
- "congress_fastapi.app:app"
- "--host"
- "0.0.0.0"
- "--port"
- "8080"
congress_viewer_app:
image: congress_viewer_app:latest
container_name: congress_viewer_app
Expand Down
11 changes: 0 additions & 11 deletions .docker/nginx.dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- name: Build containers
run: cd /home/mustyoshi/Github/congress-dev && docker-compose -f .docker/docker-compose.yml -f .docker/docker-compose.prod.yml build
- name: Deploy
run: cd /home/mustyoshi/Github/congress-dev && bash start_prod.sh
run: cd /home/mustyoshi/Github/congress-dev && bash scripts/start_prod.sh
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
requirements-frozen.txt
install-cmd: cd backend && pip install -r requirements.txt -r requirements-fastapi.txt -r requirements-test.txt && pip install -e .
- name: Run tests
run: cd backend && pytest billparser
run: cd backend && pytest congress_parser
16 changes: 5 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
**.pyc
**/node_modules
frontend/yarn-error.log
.DS_Store

.vscode
.docker/docker-compose.local.yml
backend/venv/
venv/

.resources/
*.backup
import.sh

.DS_Store
.volume
.resources
*.backup
8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
![congress dot dev](https://github.com/mustyoshi/congress-dev/raw/master/.github/banner.png "Congress.dev")
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/uses-js.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com)
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/made-with-typescript.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com)

---

## Setup

### Required Software

### Ubuntu
```
sudo apt-get update
sudo apt install libpq-dev python3-dev python3.13-venv build-essential gcc gfortran libc6 libxml2-dev libxslt-dev
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
curl -fsSL https://get.pnpm.io/install.sh | sh -x

cd backend/
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt -r requirements-fastapi.txt -r requirements-test.txt
python3 setup.py develop

cd ../hillstack
cp .env.example .env
pnpm install
```

### Docker

#### Docker `>= 19.0`
Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers.
Expand All @@ -26,8 +45,8 @@ docker-compose -f .docker/docker-compose.yml up -d

**Advance Usage** - If you rename [docker-compose.local-example.yml](./.docker/docker-compose.local-example.yml) to `docker-compose.local.yml` you can run this script to use our API instead of running the database yourself.
```bash
chmod +x ./start_local.sh
sh ./start_local.sh
chmod +x ./scripts/start_local.sh
sh ./scripts/start_local.sh
```

### Loading the database
Expand All @@ -36,18 +55,10 @@ From the backend folder, you will need to tell it to parse some files before you
```bash
docker exec -it docker_parser_api bash

python3 -m billparser.importers.releases
python3 -m billparser.importers.bills
python3 -m congress_parser.importers.releases
python3 -m congress_parser.importers.bills

```

A semi up to date postgres dump is available for [download](https://files.congress.dev/congress_beta.backup).

Assuming you're running the normal docker-compose and an empty database named us_code, you can run this to restore from the backup.
```bash
pg_restore -h localhost -U parser -d us_code -F C us_code_beta.backup
```

---

## Contributing
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/alembic/env.py → backend/.alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from alembic import context

from billparser.db.models import Base, AppropriationsBase, PromptsBase, SensitiveBase, AuthenticationBase
from congress_db.models import Base, AppropriationsBase, PromptsBase, SensitiveBase, AuthenticationBase

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy import Text
import billparser
import congress_db

# revision identifiers, used by Alembic.
revision: str = "bf2269ea67a1"
Expand All @@ -32,12 +32,12 @@ def upgrade() -> None:
sa.Column("legislation_content_id", sa.Integer(), nullable=True),
sa.Column(
"actions",
billparser.db.models.CastingArray(JSONB(astext_type=Text())),
congress_db.models.CastingArray(JSONB(astext_type=Text())),
nullable=True,
),
sa.Column(
"citations",
billparser.db.models.CastingArray(JSONB(astext_type=Text())),
congress_db.models.CastingArray(JSONB(astext_type=Text())),
nullable=True,
),
sa.ForeignKeyConstraint(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sqlalchemy.dialects import postgresql
from sqlalchemy.schema import CreateSchema
from sqlalchemy import Text
import billparser
import congress_db

# revision identifiers, used by Alembic.
revision: str = 'f6488f13146c'
Expand Down Expand Up @@ -226,7 +226,7 @@ def upgrade() -> None:
sa.Column('heading', sa.String(), nullable=True),
sa.Column('content_str', sa.String(), nullable=True),
sa.Column('content_type', sa.String(), nullable=True),
sa.Column('action_parse', billparser.db.models.CastingArray(JSONB(astext_type=Text())), nullable=True),
sa.Column('action_parse', congress_db.models.CastingArray(JSONB(astext_type=Text())), nullable=True),
sa.Column('legislation_version_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['legislation_version_id'], ['legislation_version.legislation_version_id'], ondelete='CASCADE'),
sa.ForeignKeyConstraint(['parent_id'], ['legislation_content.legislation_content_id'], ),
Expand Down
4 changes: 2 additions & 2 deletions backend/.docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.13-slim

RUN apt update
RUN apt install wget build-essential -y
Expand All @@ -9,4 +9,4 @@ RUN pip3 install -r requirements.txt
COPY . /usr/src/app
WORKDIR /usr/src/app

ENTRYPOINT ["python3", "-m", "billparser"]
ENTRYPOINT ["sh"]
13 changes: 0 additions & 13 deletions backend/.docker/Dockerfile.fastapi

This file was deleted.

9 changes: 8 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
**.pyc
**.zip


*.code-workspace
bills/
notebooks/
usc/
.vscode/
*.ipynb
.pytest_cache
__pycache__

**.pyc
**.egg-info/
dist/
build/
.sources/
.sources/

.venv
venv
1 change: 0 additions & 1 deletion backend/.python-version

This file was deleted.

2 changes: 1 addition & 1 deletion backend/alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[alembic]
# path to migration scripts
script_location = alembic
script_location = .alembic

# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
# Uncomment the line below if you want the files to be prepended with date and time
Expand Down
3 changes: 0 additions & 3 deletions backend/billparser/__init__.py

This file was deleted.

Loading