Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gayanukabulegoda/spring-pos-api
An efficient, modular POS system built on the robust Spring Framework, designed to manage customers, items, and orders seamlessly.
https://github.com/gayanukabulegoda/spring-pos-api
custom-project hibernate-jpa hibernate-validator jackson-databind jpa-hibernate jparepository logback modelmapper postman-collection restful-api simple-pos-system spring spring-api spring-data spring-framework spring-mvc spring-mysql spring-pos-api spring-project tomcat-server
Last synced: 12 days ago
JSON representation
An efficient, modular POS system built on the robust Spring Framework, designed to manage customers, items, and orders seamlessly.
- Host: GitHub
- URL: https://github.com/gayanukabulegoda/spring-pos-api
- Owner: gayanukabulegoda
- License: mit
- Created: 2024-10-03T18:29:46.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-10-16T01:47:14.000Z (21 days ago)
- Last Synced: 2024-10-17T15:34:47.599Z (20 days ago)
- Topics: custom-project, hibernate-jpa, hibernate-validator, jackson-databind, jpa-hibernate, jparepository, logback, modelmapper, postman-collection, restful-api, simple-pos-system, spring, spring-api, spring-data, spring-framework, spring-mvc, spring-mysql, spring-pos-api, spring-project, tomcat-server
- Language: Java
- Homepage:
- Size: 89.8 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 17**
- **Spring Framework**
- **Hibernate ORM**
- **Spring Data JPA**
- **ModelMapper**
- **Logback**
- **MySQL**## Project Structure
- **Entities**: Customer, Item, Order, OrderDetail
- **DTOs**: CustomerDTO, ItemDTO, OrderDTO
- **Repositories**: CustomerRepository, ItemRepository, OrderRepository, OrderDetailRepository
- **Services**: CustomerService, ItemService, OrderService
- **Controllers**: CustomerController, ItemController, OrderController
- **Utilities**: Mapping, AppUtil
- **Exceptions**: Custom exceptions for handling specific error cases
- **Configuration**: WebAppConfig, WebAppRootConfig## 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.
## Postman Documentation
For detailed API documentation and testing, please refer to the [Postman Documentation](https://documenter.getpostman.com/view/36681432/2sAXxTcWWN).
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Getting Started
### Prerequisites
- Java 17
- MySQL
- Maven### Installation
1. Clone the repository:
```sh
git clone https://github.com/gayanukabulegoda/Spring-POS-API.git
```
2. Navigate to the project directory:
```sh
cd Spring-POS-API
```
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 Gayanuka Bulegoda