This repository implements the "Finance Buddy" application — a simple Java backend with a TypeScript frontend and related build artifacts. This README documents the purpose and contents of each folder at the repository root so contributors can quickly understand the codebase layout.
Dockerfile— Docker build instructions for containerizing the application.pom.xml— Maven project descriptor: dependencies, build plugins, packaging instructions.dev-sql-notebook.sqlnb— Developer SQL notebook used for exploring or prototyping database queries.sql-worksheet.sql— Ad-hoc SQL worksheet with example queries or schema snippets.
Top-level directories
-
src/— Source code for the project.frontend/— TypeScript frontend application (likely a single-page app or UI assets).package.json— npm metadata and scripts for building and running the frontend.tsconfig.json— TypeScript compiler configuration for the frontend.ts/— Frontend TypeScript source files (UI components, services, build entry points).- Role: This folder contains the client-side application, build scripts, and types. It is responsible for the user interface that interacts with the Java backend.
main/— Java application source files and resources used by the backend.java/— Java source root.com/finance/HelloContainer.java— Example or containerized entry point (may register endpoints or start a server).com/finance/Main.java— Main application class (application startup logic).- Role: Backend application code in Java — controllers, services, domain models and startup.
resources/— Runtime resources packaged with the application.application.properties— Configuration properties used by the Java application (server port, datasource settings, etc.).static/— Static resources that may be served by the backend (e.g., prebuilt frontend assets or static pages).- Role: Holds configuration and static assets required at runtime.
-
test/— Test sources (JUnit or other Java test classes).java/— Java test classes that exercise the backend logic.- Role: Unit and integration tests to verify application behavior.
-
target/— Maven build output (generated duringmvn packageor similar).tech-1.0-SNAPSHOT.jar.original— Original JAR produced by the build process.classes/— Compiled.classfiles and copied resources packaged into the application.generated-sources/— Files produced by annotation processors or build-time code generation.maven-archiver/andmaven-status/— Build metadata used by Maven.- Role: Contains build artifacts and intermediate files; not committed but included here when present.
-
generated-test-sources/— Test-time generated sources (annotation processors, test helpers). -
test-classes/— Compiled test classes produced by the build. -
.github/workflows/— CI configuration for GitHub Actions.ci.yml— Continuous integration workflow used by the repository to build and/or test on push and pull requests.- Role: Automates builds, tests and other checks for pull requests and branches.
-
pom.xml(root) — (already listed) Defines modules/plugins used for building the Java application with Maven.
-
Development flow:
- The frontend in
src/frontendis built with Node/npm. The produced static assets may live infrontend/dist(or similar) and can be served by the Java backend fromsrc/main/resources/static. - The Java backend in
src/main/javais built by Maven (pom.xml). It reads configuration fromsrc/main/resources/application.propertiesand can include the frontend's built files as static resources. - Tests live under
test/and are executed by Maven's test phase.
- The frontend in
-
Build and run (typical commands):
# Build frontend (from repo root)
cd src/frontend
npm install
npm run build
# Build backend
cd ../../
mvn clean package
# Run backend jar (from target/)
java -jar target/tech-1.0-SNAPSHOT.jar(Adjust commands to match actual package.json scripts and pom.xml artifact names.)
The application targets Java 17. Use a JDK 17 installation for the closest match to the Docker image and CI workflow. The tests also avoid Mockito's inline agent, so they can run on a local Java 25 installation, but Java 17 remains the supported application target.
Start the Oracle SQL Developer-backed database container in Docker Desktop and confirm that it exposes localhost:1521 with service FREEPDB1. The default application configuration expects database user dev_user and password change-me; set SPRING_DATASOURCE_URL, SPRING_DATASOURCE_USERNAME, and SPRING_DATASOURCE_PASSWORD if your local values differ.
Start Ollama in Docker Desktop and expose its API on localhost:11434. Pull the model used by the application from a terminal that can reach the Ollama container:
docker exec -it <ollama-container> ollama pull llama3.1
curl http://localhost:11434/api/tagsIf the Ollama container is not named or does not publish port 11434, use its Docker Desktop port mapping and set OLLAMA_BASE_URL through the Spring property ollama.base-url or an equivalent profile configuration.
The secrets endpoints need AWS credentials or a LocalStack endpoint. For local LocalStack testing, set AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SECRETSMANAGER_ENDPOINT to the values exposed by your container. For real AWS, omit explicit credentials when the AWS SDK default credential chain is configured through your environment or IAM role.
From the repository root:
export OLLAMA_BASE_URL=http://localhost:11434
export OLLAMA_MODEL=llama3.1
mvn spring-boot:run -Dspring-boot.run.profiles=plannerThe API starts on http://localhost:8080. Check http://localhost:8080/actuator/health, then import postman/finance-planner.postman_collection.json or use its requests against the API. The planner endpoints are POST /api/v1/plan/generate, POST /api/v1/plan/answer, POST /api/v1/plan/revise, and GET /api/v1/plan/current.
The test profile uses the same Oracle connection configuration as the application and WireMock for the Ollama API. Ensure Oracle is running and that the SPRING_DATASOURCE_* values point to the test schema before running the suite:
mvn testThe verified suite currently covers secret controller/service behavior, planner service behavior, and the end-to-end planner persistence flow.
Before testing, set the required environment variables:
export AWS_REGION=us-east-1
export AWS_ACCESS_KEY_ID=AKIA****
export AWS_SECRET_ACCESS_KEY=wFHx****Then start the application:
mvn spring-boot:runThe application will be available at http://localhost:8080
curl -X GET http://localhost:8080/curl -X GET http://localhost:8080/actuator/healthcurl -X POST http://localhost:8080/api/v1/secrets/createSecret \
-H "Content-Type: application/json" \
-d '{"name": "db_password", "value": "my_secret_password"}'curl -X GET http://localhost:8080/api/v1/secrets/db_passwordcurl -X PUT http://localhost:8080/api/v1/secrets/updateSecret \
-H "Content-Type: application/json" \
-d '{"name": "db_password", "value": "updated_password"}'curl -X DELETE http://localhost:8080/api/v1/secrets/db_passwordCreate multiple secrets:
curl -X POST http://localhost:8080/api/v1/secrets/createSecret \
-H "Content-Type: application/json" \
-d '{"name": "api_key", "value": "key_123456"}'
curl -X POST http://localhost:8080/api/v1/secrets/createSecret \
-H "Content-Type: application/json" \
-d '{"name": "jwt_token", "value": "token_abcdef"}'Retrieve secrets:
curl -X GET http://localhost:8080/api/v1/secrets/api_key
curl -X GET http://localhost:8080/api/v1/secrets/jwt_tokenUpdate secrets:
curl -X PUT http://localhost:8080/api/v1/secrets/updateSecret \
-H "Content-Type: application/json" \
-d '{"name": "api_key", "value": "key_updated_123"}'-
Where to look first:
- Backend startup and REST endpoints:
src/main/java/com/finance/Main.javaand nearby classes. - Frontend entry points and UI logic:
src/frontend/ts/. - Maven build customizations: top-level
pom.xml. - CI jobs:
.github/workflows/ci.yml.
- Backend startup and REST endpoints:
-
Cleaning up build artifacts: run
mvn cleanto removetarget/contents. -
If you add new frontend build steps, ensure the CI workflow in
.github/workflows/ci.ymlinstalls Node and runs the frontend build before packaging the backend (if backend packaging depends on frontend assets).
If you're contributing or need context about design decisions, open an issue or a PR describing the change. The repository owner and branch information is in the repository metadata.
Generated: concise folder overview for maintainers and contributors.
