A Java-based project to set up and manage a PostgreSQL database for US Supreme Court data. This repository includes SQL schema files, Java code for database creation and table setup, and Docker configurations for running PostgreSQL and Adminer.
Features
- Automated creation of PostgreSQL database and tables using Java and Maven
- SQL schema files for key Supreme Court related tables (CallNumbers, Contributors, Items, Resources, Subjects)
- Docker Compose setup for PostgreSQL and Adminer for easy local development and management
- Java utility class to execute SQL files and perform basic database operations
Tech Stack
- Java 11
- Maven for build and dependency management
- PostgreSQL as the relational database
- Docker and Docker Compose for containerized database and Adminer
- Adminer for web-based database management
Getting Started
Prerequisites
- Java 11 or higher installed
- Maven installed
- Docker and Docker Compose installed
Setup
- Clone the repository
git clone https://github.com/justin-napolitano/sup-court-postgres.git
cd sup-court-postgres
- Start PostgreSQL and Adminer containers
docker-compose up -d
- Build the Java project
mvn clean package
- Run the Java application to create the database and tables
mvn exec:java -Dexec.mainClass="com.createdb.Main"
Project Structure
βββ docker-compose.yml # Docker Compose config for PostgreSQL and Adminer
βββ pom.xml # Maven project descriptor
βββ readme.md # This README file
βββ index.md # Notes and initial thoughts
βββ sql/ # SQL schema files for table creation
β βββ CallNumbers.sql
β βββ Contributors.sql
β βββ Items.sql
β βββ Resources.sql
β βββ Subjects.sql
β βββ Users.sql (assumed for future use)
βββ src/ # Java source code
β βββ main/java/com/createdb/
β βββ DatabaseClient.java # Utility for executing SQL and DB operations
β βββ Main.java # Main entry point for DB setup
βββ target/ # Maven build output
Future Work / Roadmap
- Implement web server (e.g., Flask) to serve data from the PostgreSQL database
- Develop frontend UI for browsing and querying Supreme Court data
- Add orchestration and scaling features for production deployment
- Expand database schema to include additional entities and relationships
- Integrate machine learning workflows for data analysis
- Improve error handling and logging in Java code
This project is a foundational step towards building an open-source graph of US Jurisprudence accessible via the web.