{"id":49573585,"url":"https://github.com/pitercoding/springular-ai","last_synced_at":"2026-05-03T15:39:14.125Z","repository":{"id":332143924,"uuid":"1130437737","full_name":"pitercoding/springular-ai","owner":"pitercoding","description":"[EN] Full-stack AI chat application built with Spring AI and OpenAI on the backend and Angular on the frontend. [PT-BR] Aplicação full-stack de chat com IA construída com Spring AI e OpenAI no backend e Angular no frontend.","archived":false,"fork":false,"pushed_at":"2026-01-13T09:32:05.000Z","size":377,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-03T15:39:09.116Z","etag":null,"topics":["ai-chat","angular","artificial-intelligence","chat-memory","clean-architecture","docker","full-stack","java","large-language-models","mysql","openai","rest-api","spring-ai","spring-boot","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pitercoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-08T14:02:36.000Z","updated_at":"2026-01-13T09:36:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pitercoding/springular-ai","commit_stats":null,"previous_names":["pitercoding/springular-ai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pitercoding/springular-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitercoding%2Fspringular-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitercoding%2Fspringular-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitercoding%2Fspringular-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitercoding%2Fspringular-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pitercoding","download_url":"https://codeload.github.com/pitercoding/springular-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitercoding%2Fspringular-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32575114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai-chat","angular","artificial-intelligence","chat-memory","clean-architecture","docker","full-stack","java","large-language-models","mysql","openai","rest-api","spring-ai","spring-boot","typescript"],"created_at":"2026-05-03T15:39:13.371Z","updated_at":"2026-05-03T15:39:14.110Z","avatar_url":"https://github.com/pitercoding.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"frontend/public/logo-green.png\" alt=\"Springular AI logo\" width=\"40\" style=\"vertical-align: middle; margin-right: 10px;\"\u003e\n  Springular AI\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  🌎 \u003cstrong\u003eLanguages:\u003c/strong\u003e\u003cbr\u003e\n  \u003ca href=\"README.pt.md\"\u003e🇧🇷 Portuguese\u003c/a\u003e |\n  \u003ca href=\"README.md\"\u003e🇺🇸 English\u003c/a\u003e\n\u003c/p\u003e\n\n**Springular AI** is a full-stack application that demonstrates how to build **AI-powered chat experiences** using **Spring AI (Java)** on the backend and **Angular** on the frontend.\n\nThe project includes:\n- A **Simple Chat** (stateless interaction with the LLM)\n- A **Memory Chat** (conversation history persisted in a database using Spring AI Chat Memory)\n\nIt focuses on **clean architecture**, **modern Angular patterns**, and **practical usage of Spring AI** with OpenAI models.\n\n---\n\n## 🏆 Motivation\n\nThis project was created as part of a **learning journey based on the Spring AI + Angular playlist** by Loiane Groner:  \n👉 https://github.com/loiane/spring-ai-angular\n\nBeyond practicing **full-stack development**, the main motivation was **curiosity and hands-on exploration of how Spring AI works in a real-world scenario**, specifically:\n\n- Understanding how **Spring AI consumes the OpenAI API**\n- Building a **real chat application** instead of isolated examples\n- Exploring **prompt handling, conversation flow, and chat memory**\n- Integrating **Spring Boot (backend)** with **Angular (frontend)** in a clean and modern way\n\nAs a Computer Science student, this project also helped reinforce concepts such as:\n\n- Designing REST APIs for conversational systems  \n- Managing state and conversation history on the backend  \n- Creating a responsive and reactive chat UI with Angular  \n- Applying clean architecture and separation of concerns  \n\nOverall, **Springular AI** serves both as a practical study project and a sandbox to experiment with **AI-driven applications using Spring AI and OpenAI** in a realistic full-stack environment.\n\n## 📸 Screenshots\n\nBelow are some screenshots showcasing the main features of **Springular AI**.\n\n### 🗨️ Simple Chat\nStateless chat using Spring AI and OpenAI.\n\n![Simple Chat](frontend/public/simple-chat.png)\n\n### 🧠 Memory Chat\nConversation history is persisted using Spring AI Chat Memory with MySQL.\n\n![Memory Chat](frontend/public/memory-chat.png)\n\n## 📚 Learning Points\n\nDuring development, the following concepts were explored and reinforced:\n\n- **Backend**\n  - Spring Boot 3\n  - Spring AI (ChatClient, Advisors, Chat Memory)\n  - OpenAI integration\n  - JDBC-based chat memory repository\n  - RESTful APIs\n  - Clean service and repository layers\n  - Docker Compose for local infrastructure\n\n- **Frontend**\n  - Angular standalone components\n  - Angular Signals and Effects\n  - Angular Material UI\n  - HTTP resources (`httpResource`)\n  - Error handling and retry strategies\n  - Chat UI patterns (auto-scroll, typing indicators, validation)\n\n## 🚀 How to Run the Project Locally\n\nFollow the steps below to run everything locally.\n\n### 📦 Prerequisites\n\nMake sure you have the following installed:\n\n- **Java 21+**\n- **Node.js 18+**\n- **Angular CLI**\n- **Docker \u0026 Docker Compose**\n- **An OpenAI API Key**\n\n---\n### 🔐 Environment Variables\n\nThe backend requires an OpenAI API key.\n\nSet it in your environment:\n\n```yaml\nexport OPENAI_API_KEY=your_openai_api_key_here\n```\nOr on Windows (PowerShell):\n```powershell\n$env:OPENAI_API_KEY=\"your_openai_api_key_here\"\n```\n---\n### 🐬 Database (MySQL via Docker)\nThe project uses **MySQL** for chat memory persistence.\n\nFrom the `backend` folder, start the database:\n```bash\ndocker compose up -d\n```\nThis will start a MySQL container with:\n- Database: `mydatabase`\n- User: `myuser`\n- Password: `secret`\n- Port: `3306`\n\n⚠️ The schema is not **auto-created**.\nSpring AI chat memory tables must already exist or be managed manually.\n\n---\n### 🧠 Backend (Spring Boot + Spring AI)\n\n1. Navigate to the backend folder:\n```bash\ncd backend\n```\n2. Run the application:\n```bash\n./mvnw spring-boot:run\n```\n3. The backend will start on:\n```arduino\nhttp://localhost:8080\n```\n\nAvailable API Endpoints\n- Simple Chat\n```bash\nPOST /api/chat\n```\n- Memory Chat\n```http\nGET    /api/chat-memory\nGET    /api/chat-memory/{chatId}\nPOST   /api/chat-memory/start\nPOST   /api/chat-memory/{chatId}\n```\n\nFor more information, visit: [Spring AI Documentation](https://docs.spring.io/spring-ai/reference/).\n\n---\n\n### 🖥️ Frontend (Angular)\n\n1. Navigate to the frontend folder:\n```bash\ncd frontend\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Start the Angular dev server:\n```bash\nng serve\n```\n\n4. The frontend will be available at:\n```bash\nhttp://localhost:4200\n```\n\nThe frontend is configured with a proxy to forward `/api/**` requests to the Spring Boot backend.\n\n---\n\n## 🧱 Application Architecture\n| Layer    | Technology              | Responsibility                              |\n| -------- | ----------------------- | ------------------------------------------- |\n| Frontend | Angular + TypeScript    | Chat UI, routing, state management          |\n| Backend  | Spring Boot + Spring AI | LLM integration, memory handling, REST APIs |\n| Database | MySQL                   | Persistent chat memory                      |\n| AI Model | OpenAI                  | Natural language responses                  |\n| Infra    | Docker Compose          | Local database setup                        |\n\n## 🧭 Application Flow\n```text\nUser\n ↓\nAngular Frontend\n ↓\nSpring Boot REST API\n ↓\nSpring AI ChatClient\n ↓\nOpenAI Model\n ↓\nResponse returned to UI\n```\n- For memory chat:\n```text\nUser\n ↓\nAngular Frontend\n ↓\nSpring Boot REST API\n ↓\nSpring AI ChatClient + ChatMemory\n ↓\nMySQL (conversation history)\n ↓\nOpenAI Model\n```\n\n## 📂 Project Structure\n```bash\nspringular-ai/\n├─ backend/\n│  ├─ src/main/java/com/pitercoding/backend/\n│  │  ├─ chat/                 # Stateless chat\n│  │  ├─ memory/               # Memory-based chat\n│  │  └─ BackendApplication.java\n│  ├─ compose.yaml             # MySQL container\n│  ├─ pom.xml                  # Spring Boot + Spring AI config\n│  └─ application.properties\n├─ frontend/\n│  ├─ public/                  # Logos and static assets\n│  ├─ src/app/\n│  │  ├─ chat/                 # Simple Chat \u0026 Memory Chat UI\n│  │  ├─ shared/               # Pipes, logging, error handling\n│  │  └─ app.routes.ts\n│  ├─ proxy.conf.js             # API proxy configuration\n│  └─ angular.json\n├─ README.md\n├─ README.pt.md\n└─ LICENSE\n```\n\n## 📜 License\n\nThis project is licensed under the **MIT License** — feel free to use, study, and modify it.\n\n## 🧑‍💻 Author\n\n**Piter Gomes** — Computer Science Student (6th Semester) \u0026 Full-Stack Developer\n\n📧 [Email](mailto:piterg.bio@gmail.com) | 💼 [LinkedIn](https://www.linkedin.com/in/piter-gomes-4a39281a1/) | 💻 [GitHub](https://github.com/pitercoding) | 🌐 [Portfolio](https://portfolio-pitergomes.vercel.app/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpitercoding%2Fspringular-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpitercoding%2Fspringular-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpitercoding%2Fspringular-ai/lists"}