Skip to content

loiane/spring-ai-angular

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

211 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring AI + Angular

Monorepo with a Spring AI backend and an Angular frontend.

The project demonstrates practical AI application patterns end-to-end:

  • simple chat
  • chat with memory
  • RAG with document upload and retrieval
  • an AI-assisted flight reservation workflow

Technologies

  • Java 25
  • Spring Boot 4.x
  • Spring AI 2.x
  • Maven Wrapper
  • PostgreSQL + pgvector
  • Angular 21
  • Angular Material
  • Playwright + Vitest/Karma tooling

Repository Structure

  • api-ai/: Spring Boot API and AI services
  • angular-ai/: Angular UI client

Features

Backend (api-ai)

  • Simple chat endpoint (POST /api/chat)
  • Memory chat endpoints (/api/chat-memory/**)
  • RAG endpoints (/api/rag/**)
    • upload document
    • list/get/delete documents
    • ask questions using retrieved context
  • Flight reservation endpoints (/api/flight-reservations/**)
    • list/create/get reservations
    • cancel reservation
    • update reservation status
    • search by passenger email
  • Book recommendation prompt endpoints (/api/books/**)

Frontend (angular-ai)

  • Simple Chat page
  • Memory Chat page
  • Flight Reservations page
  • Material UI layout with route-based navigation

Quick Start

1. Start the backend

From api-ai/, set at least:

OPENAI_API_KEY=your_openai_api_key

Start database and API:

./mvnw spring-boot:run

Spring Boot Docker Compose integration will start PostgreSQL/pgvector from compose.yaml.

API base URL: http://localhost:8080

2. Start the frontend

From angular-ai/:

npm install
npm start

Frontend URL: http://localhost:4200

The Angular app uses proxy.conf.js to forward API calls to the backend during development.

Useful Commands

Backend Commands (api-ai)

./mvnw test
./mvnw clean package

Frontend Commands (angular-ai)

npm run test
npm run e2e
npm run build

API Samples

The file api-ai/api.http contains request examples for local API testing.

Learning Resources

Tutorials (English)

Videos (Portuguese)

Intro and Simple Chat Client

About

Sample project showcasing different capabilities from Java Spring AI with an Angular frontend

Resources

License

Stars

Watchers

Forks

Contributors