https://github.com/martincastroalvarez/llm-react-api
Web app to analyze and visualize character interactions in Project Gutenberg e-books using LLM.
https://github.com/martincastroalvarez/llm-react-api
Last synced: 9 months ago
JSON representation
Web app to analyze and visualize character interactions in Project Gutenberg e-books using LLM.
- Host: GitHub
- URL: https://github.com/martincastroalvarez/llm-react-api
- Owner: MartinCastroAlvarez
- Created: 2025-03-30T00:24:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-30T16:04:36.000Z (about 1 year ago)
- Last Synced: 2025-06-22T17:50:32.094Z (12 months ago)
- Language: TypeScript
- Size: 5.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React & LLM API
Web app to analyze and visualize character interactions in Project Gutenberg e-books using LLM.

## Overview
This project is a React-based single page application, styled using TailwindCSS, that allows users to explore and analyze character interactions in Project Gutenberg e-books. The application leverages a Language Learning Model (LLM) to process the text of e-books and visually represent character interactions through an interactive network graph.
The application is deployed on AWS using the AWS Cloud Development Kit (CDK), which automates the setup of AWS Lambda for backend processing and API Gateway for handling requests efficiently. This deployment strategy was chosen to take advantage of AWS's free tier, making it cost-effective and scalable.

## References
- [React Flow](https://reactflow.dev/learn)
- [Guternberg Org](https://www.gutenberg.org/ebooks/1787)
## Notes
- To avoid high expenses associated with real LLM processing, this project uses mocked results.
- Avoids complex asynchronous tasks like workers or Kafka by simulating a job submission API to minimize latency.
- Utilizes AWS Lambda and React to keep costs low, leveraging AWS's free tier for cost-effective scalability.
- No authentication or authorization is implemented in this prototype.
- CORS is not enforced properly, in order to keep the project simple.
- No testing is implemented, in order to keep the project simple.
- The API host is hardcoded in the frontend, in order to keep the project simple.
- Prompt engineering is not part of this prototype, to keep it within 1 hour of coding.
## Setup
Install the dependencies using the following command:
```bash
yarn install
```
To run the React app locally, simply run:
```bash
yarn dev
```
## Build
Build the app with the following command:
```bash
AWS_PROFILE=myprofile yarn build
```
## Deploy
Deploy the app using AWS CDK using the following command:
```bash
AWS_PROFILE=myprofile yarn deploy
```
## Test
To run the integration tests, run the following command:
```bash
yarn test
```
## Troubleshooting
To view the API logs, run the following command:
```bash
yarn run logs
```