A Java-based system for managing college football data with a REST API and PostgreSQL database.
college-scores/
├── rest-api/ # REST API server
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/com/example/
│ │ │ │ ├── RestApiApplication.java # Dropwizard app
│ │ │ │ ├── RestApiConfiguration.java # App config
│ │ │ │ └── ConferenceResource.java # REST endpoints
│ │ │ └── resources/
│ │ │ ├── migrations.xml # Database migrations
│ │ │ └── conferences.csv # Initial data
│ │ └── test/
│ │ ├── java/com/example/
│ │ │ └── ConferenceResourceTest.java # Integration tests
│ │ └── resources/
│ │ ├── test-config.yml # Test config
│ │ └── migrations-test.xml # Test migrations
│ ├── config.yml # Production config
│ └── pom.xml # REST API Maven config
│
├── rest-client/ # REST client module (new)
│ └── pom.xml # REST client Maven config
│
├── pom.xml # Parent POM with dependency management
└── server.sh # Server startup script
- Java 21
- Maven for build management
- Dropwizard 4.0.1 web framework
- PostgreSQL database
- JDBI 3.43.0 for database access
- Liquibase for database migrations
- JUnit 5 for testing
- H2 for test database
- Jackson for JSON processing
- REST API for college football data
- Database migrations
- Integration testing
- Dependency analysis
- UTF-8 encoding enforcement
# Build all modules
mvn clean install
# Run dependency analysis
mvn dependency:analyze
# Run tests
mvn test
# Start the server (includes database initialization)
./server.sh
The REST API will be available at:
- Main API: http://localhost:9090
- Admin Interface: http://localhost:9091
Configure PostgreSQL connection in rest-api/config.yml
:
database:
driverClass: org.postgresql.Driver
url: jdbc:postgresql://college-scores-db:5432/
user: postgres
password: postgres
Test configuration uses H2 in-memory database:
database:
driverClass: org.h2.Driver
url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;MODE=PostgreSQL
user: sa
password: sa
- Create model class
- Add database migration
- Create resource class
- Add integration tests
# Check status
java -jar rest-api/target/rest-api-1.0-SNAPSHOT.jar db status rest-api/config.yml
# Apply migrations
java -jar rest-api/target/rest-api-1.0-SNAPSHOT.jar db migrate rest-api/config.yml
Integration tests use:
- H2 in-memory database
- Separate migrations file
- DropwizardAppExtension
- JUnit 5
Running mvn clean install
currently has issues that need to be fixed in order to build the project.
Fix the build and run ./server.sh
and demonstrate being able to access one of the current REST endpoints (http://localhost:9090/api/conferences)
There is ConferenceResourceTest.java
within the rest-api module. It is currently disabled because there is an issue with the test. Enable the tests and fix the issue.
Data is already loaded into a test database. Add an endpoint at /api/teams that allows users to get all teams and another endpoint to query a team by name. If no teams are found, a 404 error message should be returned.
Report and aggregate code coverage in maven for the entire project.
Add a new de-normalized table to Postgres called games. It should have the following columns:
- id (integer)
- season (integer year value)
- week (integer)
- start_date (timestamp)
- venue_name (string)
- home_school_name (string)
- home_points (integer)
- away_school_name (string)
- away_points (integer)
Create a task that will load data from data/games_week_1.csv
. This should do lookups in the database for venue and school names and populate the data accordingly
Obtain a free API key from https://collegefootballdata.com/. Use the documentation from https://apinext.collegefootballdata.com/ to download all games data for year=2025 and week=2 and store in data/games_week_2.csv
. This should have the same format as the previous CSV file and should be used to load week 2 data using the same task created above.
Note that the API gives a lot more information than what's being asked to store.