The Open Case Filing System (OCFS) is a state-of-the-art platform designed to enhance court proceedings efficiency. It offers a modern solution for managing court operations, leveraging the latest technology to streamline processes.
Report Bug
·
Request Feature
Under Heavy Construction.
Table of Contents
A worthy contender in the race for a replacement to the Case Management / Electronic Case Filing System.
Devcontainer Setup (Recommended) Follow these steps to set up OCFS using a development container in Visual Studio Code:
-
Prerequisites:
- Ensure Docker is installed and running on your local machine.
- Ensure git is installed and running on your operating system of choice.
git --version - Install Visual Studio Code or a code editor that supports devcontainers.
- Install devcontainers extension in VS Code.
git clone git@github.com:federal-courts-software-factory/open-case-filing-system.git
-
Setup:
- Open Visual Studio Code in the open-case-filing-system directory. If you have Visual Studio Code installed in your system path:
code open-case-filing-system - Use the Windows/Linux hotkey:
Ctrl + SHIFT + Por OSX hotkey:CMD + SHIFT + Pto open up the window. - Search for "dev containers" and select "Dev Containers: Rebuild and Reopen in Container."
- The code will load in a development container, providing an isolated environment.
- to work with git inside the container, it might be necessary to run
git config --global --add safe.directory /workspaces/open-case-filing-system
- Open Visual Studio Code in the open-case-filing-system directory. If you have Visual Studio Code installed in your system path:
To set up OCFS locally:
-
Environment Setup:
- Copy
.devcontainers/.envfile to the open-case-filing-system root directory. - This step enables running the application locally.
- Copy
-
Database Deployment:
- Deploy a Postgres Docker container using:
docker-compose up -f .devcontainer/docker-compose.yml
- Deploy a Postgres Docker container using:
To configure the database: postgres needs to be running, (type postgres into terminal)
- Navigate to the API directory:
cd docket-api
- Run the following commands:
- Create the database:
sqlx database create - Apply migrations:
sqlx migrate run - Start the application:
cargo run
Execute tests in a separate window:
- Ensure the server is running (
cargo run). - Run tests with:
cargo watch -q -c -w tests/ -x "test -q quick_dev -- --nocapture"
- Flag definitions:
-q: Quiet mode-c: Clear screen before each run-w: Watch files for changes
If you encounter database issues:
- Reset Database:
- Warning: This will destroy your current database.
- Run:
sqlx database drop -f; sqlx database create; sqlx migrate run
- If our pipelines are failing because our database isn't connected. We need to run this first.
cargo sqlx prepare --workspace
OCFS employs a cutting-edge tech stack, aiming for high developer productivity and customer satisfaction.
- Devcontainer and Minikube Integration: Our development containers automatically start a Minikube Kubernetes instance, streamlining development, testing, and deployment directly to Kubernetes.
- Current Repository Structure: Currently, both application and deployment code coexist in the same repository. This setup is temporary and aimed at accelerating development. Eventually, we'll adopt the best practice of separating these concerns.
- Load Balancer with Minikube: For load balancing using Istio, use the command:
minikube tunnel. - Future Plans: We plan to document best practices for mirroring production Kubernetes environments on local machines. Additionally, future enhancements will include more sophisticated CI/CD pipelines and architectural components like Istio and Argo Rollouts.
- Current Isolation Approach: Presently, we achieve environment isolation using different namespaces. However, we plan to transition to unique and independent clusters in the future.
- Development Environment: We deploy to a 'dev' namespace with a unique namePrefix to ensure isolation during testing.
- Staging Environment: After initial testing, we promote development images to a 'staging' environment for further performance testing and validations.
- Production Environment: Once thoroughly tested (minimum 2 weeks in staging), we move resources to the 'prod' namespace for production deployment.
-
Automated Deployment: Argocd is used to monitor our Git repository. It tracks changes and automatically updates the cluster.
-
Configuration Management: We manage our resources using kustomize in the
clusters/folder, preferring it over Helm.- Add our repo and applications to argo (manually from cli)
argocd app create docket-api --repo https://github.com/federal-courts-software-factory/open-case-filing-system.git --path clusters/apps/docket-api/overlays/dev-cluster --dest-server https://kubernetes.default.svc --dest-namespace dev --self-heal --sync-policy automated --sync-retry-limit 5 && argocd app create web --repo https://github.com/federal-courts-software-factory/open-case-filing-system.git --path clusters/apps/web/overlays/dev-cluster --dest-server https://kubernetes.default.svc --dest-namespace dev --self-heal --sync-policy automated --sync-retry-limit 5- Expose the Argocd service so you can reach the web ui:
kubectl port-forward svc/argocd-server -n argocd 8080:443
- In your browser go to:
http://localhost:80880
- Find the randomly created admin password:
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
- Admin login: use the username,
adminand use password from kubectl get secret command directly above.
This step should not be needed, but in case somebody didn't run as expected you can always cd into the open case filing system directory on your computer and run the following: Notice: --upsert flag is required if you already applied these applicationSets before.
-
argocd appset create clusters/environment/appsets/dev-docket-api.yaml --upsert && argocd appset create clusters/environment/appsets/dev-web.yaml --upsert
- Efficient Package Management: We use Cargo workspaces to manage packages efficiently, offering benefits like unified dependencies and reduced overhead in space and time.
- Main database driver We currently use postgres as our main driver until we can move to surealdb.
- Database Flexibility: SurealDB is our choice for database management, given its flexibility in handling SQL and graph queries, which suits the complex needs of the legal system.
- Enhanced UI Reactivity: We plan to use htmx for our web interface. It enhances HTML to increase UI reactivity without the need for JavaScript, leading to faster performance and simplified development.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'feat: add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- License Type: This work is licensed under a Creative Commons Attribution 4.0 International License.
