Enterprise-grade Spring Boot project integrated with Spring AI for building modern AI-powered applications.
Spring-AI-Project is a professional backend starter template built using:
- Spring Boot 3
- Spring AI
- REST APIs
- Maven
- Docker
- Java 21
This project is designed to help developers quickly start building AI-integrated enterprise applications using OpenAI, Ollama, Azure OpenAI, and other LLM providers.
- Spring Boot 3.x Architecture
- Spring AI Integration
- RESTful APIs
- Environment-based Configuration
- Layered Clean Architecture
- Production-Ready Structure
- Docker Support
- Centralized Exception Handling
- Logging Support
- Validation Support
- Lombok Integration
- API Versioning Ready
- Scalable Design Pattern
| Technology | Version |
|---|---|
| Java | 21 |
| Spring Boot | 3.x |
| Spring AI | Latest |
| Maven | Latest |
| Docker | Latest |
| Lombok | Latest |
Spring-AI-Project/
│
├── .github/
│ └── workflows/
│ └── ci.yml
│
├── docker/
│ └── Dockerfile
│
├── logs/
│
├── src/
│ ├── main/
│ │
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── springai/
│ │ │ └── project/
│ │ │
│ │ │ ├── SpringAiProjectApplication.java
│ │ │ │
│ │ │ ├── config/
│ │ │ │ ├── AiConfig.java
│ │ │ │ ├── SwaggerConfig.java
│ │ │ │ └── SecurityConfig.java
│ │ │ │
│ │ │ ├── controller/
│ │ │ │ └── ChatController.java
│ │ │ │
│ │ │ ├── service/
│ │ │ │ ├── ChatService.java
│ │ │ │ └── impl/
│ │ │ │ └── ChatServiceImpl.java
│ │ │ │
│ │ │ ├── repository/
│ │ │ │
│ │ │ ├── dto/
│ │ │ │ ├── ChatRequest.java
│ │ │ │ └── ChatResponse.java
│ │ │ │
│ │ │ ├── entity/
│ │ │ │
│ │ │ ├── exception/
│ │ │ │ ├── GlobalExceptionHandler.java
│ │ │ │ └── ResourceNotFoundException.java
│ │ │ │
│ │ │ ├── util/
│ │ │ │ └── AppConstants.java
│ │ │ │
│ │ │ └── security/
│ │ │
│ │ └── resources/
│ │ ├── application.properties
│ │ ├── application-dev.properties
│ │ ├── application-prod.properties
│ │ ├── banner.txt
│ │ └── static/
│ │
│ └── test/
│ └── java/
│ └── com/
│ └── springai/
│ └── project/
│ └── SpringAiProjectApplicationTests.java
│
├── target/
│
├── .gitignore
├── .gitattributes
├── pom.xml
├── README.md
├── mvnw
├── mvnw.cmd
└── LICENSEgit clone https://github.com/dharmendra9847/Spring-AI-Project.git
cd Spring-AI-ProjectOpen:
src/main/resources/application.propertiesAdd:
spring.ai.openai.api-key=${OPENAI_API_KEY}OR
spring.ai.openai.api-key=YOUR_API_KEYmvn clean installmvn spring-boot:runApplication Starts On:
http://localhost:8080GET /api/v1/chat?prompt=Hello{
"response": "Hello! How can I help you today?"
}docker build -t spring-ai-project .docker run -p 8080:8080 spring-ai-project- Never commit secrets
- Use
.envfiles - Use Spring Profiles
- Configure environment variables
- Use HTTPS in production
- Enable centralized logging
Run all tests:
mvn test- AI Streaming
- Vector Database Integration
- Retrieval-Augmented Generation (RAG)
- JWT Authentication
- Role-Based Access Control
- Chat History Persistence
- Kubernetes Deployment
- CI/CD Pipelines
- Docker
- AWS ECS
- Kubernetes
- Railway
- Render
- Azure App Service
# Fork repository
# Create branch
git checkout -b feature/new-feature
# Commit changes
git commit -m "feat: add new AI endpoint"
# Push changes
git push origin feature/new-featureLicensed under the MIT License.
Developed using ❤️ with Spring Boot & Spring AI.