https://github.com/mochrks/api-springboot-redis
This project is a demonstration of a CRUD (Create, Read, Update, Delete) application built using Spring Boot, Redis, and PostgreSQL. The application is designed to manage customer data efficiently, leveraging the high-speed caching capabilities of Redis and the robust data management features of PostgreSQL.
https://github.com/mochrks/api-springboot-redis
potgresql redis springboot
Last synced: 2 months ago
JSON representation
This project is a demonstration of a CRUD (Create, Read, Update, Delete) application built using Spring Boot, Redis, and PostgreSQL. The application is designed to manage customer data efficiently, leveraging the high-speed caching capabilities of Redis and the robust data management features of PostgreSQL.
- Host: GitHub
- URL: https://github.com/mochrks/api-springboot-redis
- Owner: Mochrks
- Created: 2024-07-06T19:35:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-03T12:54:03.000Z (about 1 year ago)
- Last Synced: 2025-07-12T02:56:20.063Z (5 months ago)
- Topics: potgresql, redis, springboot
- Language: Java
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Spring Boot CRUD API - Redis & PostgreSQL Integration
## Overview
This is a **CRUD API** built with **Spring Boot** that integrates **Redis** for caching and **PostgreSQL** as the primary database. The API allows creating, reading, updating, and deleting records with caching enabled to enhance performance. Redis is used to cache frequently accessed data, reducing load on the PostgreSQL database.
## Features
- CRUD Operations with **Redis caching** for enhanced performance
- Integration with **PostgreSQL** for persistent storage
- **Spring Data JPA** for database operations
- **Spring Cache** abstraction for Redis integration
- RESTful API design with **clean architecture**
- Input validation and error handling
- **Swagger UI** for API documentation and testing
## Tech Stack
- **Spring Boot 2.5.4**
- **Redis** for caching
- **PostgreSQL** as the primary database
- **Spring Data JPA** for database interaction
- **Lombok** for reducing boilerplate code
- **Swagger** for API documentation
## Project Structure
```bash
api-springboot-redis/
│
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/example/redis/ # Source code and main application
│ ├── resources/
│ │ ├── application.properties # Configuration for PostgreSQL, Redis
│ └── test/
│ └── java/ # Unit tests for services and controllers
└── pom.xml # Project dependencies
```
## Setup & Installation
--------------------
- **Clone the repository**
```bash
git clone https://github.com/mochrks/api-springboot-redis.git
cd api-springboot-redis
```
- **Install dependencies**
```bash
mvn clean install
```
- **Set up PostgreSQL and Redis**
- Ensure **PostgreSQL** and **Redis** are running locally or provide your connection strings in `application.properties`.
- For **PostgreSQL**, update the following properties in `src/main/resources/application.properties`:
```properties
spring.datasource.url=jdbc:postgresql://localhost:5432/yourdbname
spring.datasource.username=yourusername
spring.datasource.password=yourpassword
```
- For **Redis**, update the following properties:
```properties
spring.redis.host=localhost
spring.redis.port=6379
```
- **Run the application**
```bash
mvn spring-boot:run
```
## Connect with me:
[](https://github.com/mochrks)
[](https://youtube.com/@Gdvisuel)
[](https://instagram.com/mochrks)
[](https://linkedin.com/in/mochrks)
[](https://behance.net/mochrks)
[](https://dribbble.com/mochrks)