Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ashannaveen/spring-mvc-pos_system

The Spring-POS-API is a comprehensive RESTful API designed to manage a Point of Sale (POS) system. This API facilitates seamless CRUD operations and transactional management for key entities such as customers, items, orders, and order details. Developed using the Spring framework, it ensures robust data handling and efficient processing.
https://github.com/ashannaveen/spring-mvc-pos_system

app hibernate hibernate-validator java-21 jpa logback maven modelmapper mysql restful-api spring spring-mvc web web-app

Last synced: 6 days ago
JSON representation

The Spring-POS-API is a comprehensive RESTful API designed to manage a Point of Sale (POS) system. This API facilitates seamless CRUD operations and transactional management for key entities such as customers, items, orders, and order details. Developed using the Spring framework, it ensures robust data handling and efficient processing.

Awesome Lists containing this project

README

        

# Spring POS API

A Point of Sale (POS) RESTful API developed using Spring. It includes CRUD operations and transaction management for Customer, Item, Order, and OrderDetail entities. The project is seamlessly integrated with Hibernate for ORM and JPA for repository management.

## Features

- CRUD operations for Customer, Item, Order, and OrderDetail entities.
- Transaction management.
- Validation using Hibernate Validator.
- Logging using Logback.
- Custom exceptions and error messages.
- DTO and Entity mapping using ModelMapper.
- Utility for Base64 image conversion.
- Configuration files for application setup.

## Tech Stack

- **Java 21**
- **Spring Framework**
- **Hibernate ORM**
- **Spring Data JPA**
- **ModelMapper**
- **Logback**
- **MySQL**

## Validation

Validation is implemented using Hibernate Validator annotations in the DTO classes to ensure data integrity and correctness.

## Logging

Logging is configured using Logback. Logs are written to both the console and a file.

## Custom Exceptions

Custom exceptions are created to handle specific error scenarios, providing meaningful error messages to the client.

## Utilities

- **Mapping**: Utility class for converting between DTOs and entities using ModelMapper.
- **AppUtil**: Utility class for converting MultipartFile to Base64 string for image storage.

## Configuration

Configuration files are used to set up the application context, data source, JPA, and transaction management.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Getting Started

### Prerequisites

- Java 21
- MySQL
- Maven

### Installation

1. Clone the repository:
```sh
git clone https://github.com/AshanNaveen/Spring-MVC-Pos_System.git
```
2. Navigate to the project directory:
```sh
cd Spring-MVC-Pos_System
```
3. Update the MySQL database configuration in `WebAppRootConfig.java`:
```java
@Bean
public DataSource dataSource() {
DriverManagerDataSource dmds = new DriverManagerDataSource();
dmds.setDriverClassName("com.mysql.cj.jdbc.Driver");
dmds.setUrl("jdbc:mysql://localhost:3306/spring_pos_api?createDatabaseIfNotExist=true");
dmds.setUsername("root");
dmds.setPassword("your_password");
return dmds;
}
```
4. Build the project using Maven:
```sh
mvn clean install
```
5. Deploy the WAR file to your preferred servlet container (e.g., Tomcat).

### Usage

- Access the API endpoints using your preferred API client (e.g., Postman).
- Refer to the Postman documentation for detailed API usage.

## Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

##















© 2024 Ashan Naveen