A comprehensive Spring Boot application that provides REST APIs for mathematical operations and bill splitting functionality. Built with industry best practices and modern Spring Boot features.
- Features
- Technology Stack
- Prerequisites
- Getting Started
- API Documentation
- Project Structure
- Development Guidelines
- Testing
- Deployment
- Contributing
- Code Coverage
- License
- Mathematical Operations API
- Addition, Subtraction, Multiplication, Division
- Input validation and error handling
- Bill Splitting API
- Equal split calculation
- Split with tip calculation
- Item-wise split calculation
- Comprehensive API Documentation
- Actuator endpoints for monitoring
- Logging and Error Handling
- Unit and Integration Tests
- Docker Support
- Java 17
- Spring Boot 3.2.3
- SpringDoc OpenAPI 2.3.0
- Project Lombok
- MapStruct
- JUnit 5
- Mockito
- Maven
- Docker
- JaCoCo for Code Coverage
- Java 17 or higher
- Maven 3.9+
- Docker (optional)
- Git
-
Clone the repository:
git clone https://github.com/arjun-master/arjun_ai_project.git cd arjun_ai_project -
Build the application:
mvn clean install
-
Run the application:
mvn spring-boot:run
The application will be available at http://localhost:8080
-
Build the Docker image:
docker build -t arjun_ai_project:latest . -
Run the container:
docker run -d -p 8080:8080 --name arjun_ai_project arjun_ai_project:latest
Access the Swagger UI documentation at:
- Local:
http://localhost:8080/swagger-ui.html - API Docs:
http://localhost:8080/api-docs
src/
├── main/
│ ├── java/
│ │ └── com/
│ │ └── arjunai/
│ │ └── project/
│ │ ├── config/
│ │ ├── controllers/
│ │ ├── services/
│ │ ├── models/
│ │ ├── repositories/
│ │ ├── exceptions/
│ │ └── utils/
│ └── resources/
│ └── application.properties
└── test/
└── java/
└── com/
└── arjunai/
└── project/
└── controllers/
- Follow Google Java Style Guide
- Write comprehensive unit tests
- Document all public APIs
- Use meaningful commit messages
- Keep the code clean and maintainable
Run tests using Maven:
mvn testGenerate test coverage report:
mvn verify-
Build the production JAR:
mvn clean package -DskipTests
-
Build the production Docker image:
docker build -t arjun_ai_project:prod . -
Run in production:
docker run -d -p 8080:8080 --name arjun_ai_project_prod arjun_ai_project:prod
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
JaCoCo code coverage reports are generated during the build process. View the reports in:
target/site/jacoco/index.html
This project is licensed under the MIT License - see the LICENSE file for details.