{"id":18602089,"url":"https://github.com/build-on-aws/java-fm-playground","last_synced_at":"2025-06-20T20:35:59.197Z","repository":{"id":205846912,"uuid":"706419698","full_name":"build-on-aws/java-fm-playground","owner":"build-on-aws","description":"Explore how you can use Amazon Bedrock with Java in a dynamic environment! It includes a Spring Boot app and a Next.js frontend, perfect for learning and experimentation with generative AI on AWS.","archived":false,"fork":false,"pushed_at":"2024-05-10T02:26:34.000Z","size":727,"stargazers_count":13,"open_issues_count":1,"forks_count":11,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-11T05:09:35.018Z","etag":null,"topics":["amazon-bedrock","aws","bedrock","generative-ai","generative-art","image-generation","java","large-language-models","llm","nextjs","sample-app","spring-boot","web-development"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit-0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/build-on-aws.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-17T23:12:23.000Z","updated_at":"2024-12-22T17:01:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"79777d63-703b-482e-8753-243f0dee0764","html_url":"https://github.com/build-on-aws/java-fm-playground","commit_stats":null,"previous_names":["build-on-aws/java-fm-playground"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/build-on-aws/java-fm-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/build-on-aws%2Fjava-fm-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/build-on-aws%2Fjava-fm-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/build-on-aws%2Fjava-fm-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/build-on-aws%2Fjava-fm-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/build-on-aws","download_url":"https://codeload.github.com/build-on-aws/java-fm-playground/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/build-on-aws%2Fjava-fm-playground/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261013037,"owners_count":23096964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-bedrock","aws","bedrock","generative-ai","generative-art","image-generation","java","large-language-models","llm","nextjs","sample-app","spring-boot","web-development"],"created_at":"2024-11-07T02:10:17.212Z","updated_at":"2025-06-20T20:35:54.185Z","avatar_url":"https://github.com/build-on-aws.png","language":"JavaScript","readme":"# ☕ Java FM Playground\n\nWelcome to the Java Foundation Model (FM) Playground, a sandbox for exploring Java integration with **Amazon Bedrock**.\n\n\u003e 🚨 **Important:** This application is for educational purposes and not intended for production use.\n\n## Overview\n\nThis repository includes a **Spring Boot** application and a **Next.js** frontend, both executable locally. Below is a screenshot of the app in action.\n\n![Screenshot of the Java FM Playground](resources/screenshot.png)\n\n## ⚠ Important\n\n- Running this application might result in charges to your AWS account. For more details, see [Amazon Bedrock Pricing](https://aws.amazon.com/bedrock/pricing/).\n- This app is configured to run in `us-east-1` and has not been tested in every AWS Region. For more information see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).\n- We recommend that you grant your code least privilege, i.e. only the minimum permissions required by the application. You can find an IAM Policy document with the required permissions in this repository at `resources/bedrock-access-policy.json` ([display policy](./resources/bedrock-access-policy.json)).\n\n## Prerequisites\n\nEnsure you have the following installed:\n\n- Java JDK 17+ (e.g. [Amazon Corretto](https://aws.amazon.com/corretto), a free distro of the JDK)\n- [Apache Maven](https://maven.apache.org/install.html) for the backend server\n- [Node.js (v18.17+)](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) for the frontend application\n- You must have an [AWS account](https://aws.amazon.com/free/), and have your default credentials and AWS Region configured as described in the [AWS Tools and SDKs Shared Configuration and Credentials Reference Guide](https://docs.aws.amazon.com/credref/latest/refdocs/creds-config-files.html).\n- You must request access to the models before you can use them. For more information, see [Model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html). To run the app, you need access to the following models in `us-east-1`:\n  - Anthropic Claude\n  - AI21 Labs Jurassic-2 Mid\n  - Stability AI Stable Diffusion XL\n\n## Running the Application\n\nAfter verifying the prerequisites, follow these steps:\n\n### Clone the repository\n\nOpen a terminal, navigate to a directory of your choice, and execute the following command:\n\n```shell\ngit clone https://github.com/build-on-aws/java-fm-playground.git\n```\n\n### Backend Setup\n\nIn the `java-fm-playground/backend` directory, run:\n\n```shell\nmvn spring-boot:run\n```\n\nOnce the server is running, you will see the following output:\n\n```shell\n...\n2023-11-13T14:19:02.862+01:00  INFO 34848 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 55500 (http) with context path ''\n2023-11-13T14:19:02.868+01:00  INFO 34848 --- [main] a.c.e.b.SpringFmPlaygroundApplication    : Started SpringFmPlaygroundApplication in 1.415 seconds (process running for 1.659)\n```\n\n\u003e 🛠 The backend runs on port 55500 by default. See below for port changes.\n\n### Frontend Setup\n\nIn a **new terminal window**, navigate to the `frontend` directory and install the packages required by running the following command:\n\n```shell\nnpm install\n```\n\nAfter successful installation you can start the frontend application by executing the following command:\n\n```shell\nnpm run dev\n```\n\nWhen the application is running, you will see the following output:\n\n```shell\n\u003e frontend@0.1.0 dev\n\u003e next dev\n\n   ▲ Next.js 14.0.0\n   - Local:        http://localhost:3000\n\n ✓ Ready in 3.3s\n```\n\n## Accessing the Application\n\nOpen `http://localhost:3000` in your web browser to interact with the application.\n\n## Stopping the Application\n\nTo halt the application, you will need to stop both the backend and frontend processes.\n\n### Stopping the Frontend\n\nIn the terminal where the frontend is running, press `Ctrl + C` to terminate the process.\n\n### Stopping the Backend\n\nSimilarly, in the backend terminal, use the `Ctrl + C` shortcut to stop the server.\n\nIf you encounter any issues, you can forcefully terminate the processes by finding the process ID (`PID`) and using the `kill` command on Unix-based systems or Task Manager on Windows.\n\n\n## Using Different Ports\n\nChange the backend port in the following files:\n- `backend/src/main/resources/application.yml`\n- `frontend/app/app.config.js`\n\nTo run the frontend on a different port:\n\n```shell\nnpm run dev -- --port NEW_PORT\n```\n\n## Troubleshooting\n\nThe AWS Region is hard-coded in the application. However, if your local `AWS_REGION` environment variable is set to a different region, the application may fail. In this case, please make sure to either unset `AWS_REGION`, or set it to `us-east-1`.\n\n## License\n\nThis library is licensed under the MIT-0 License. See the [LICENSE](LICENSE) file.\n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuild-on-aws%2Fjava-fm-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuild-on-aws%2Fjava-fm-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuild-on-aws%2Fjava-fm-playground/lists"}