https://github.com/atuandev/bookstore-backend
REST API for bookstore
https://github.com/atuandev/bookstore-backend
docker heidisql intellij-idea lombok mapstruct mysql spring spring-boot spring-data-jpa spring-security spring-security-oauth2 swagger
Last synced: 3 months ago
JSON representation
REST API for bookstore
- Host: GitHub
- URL: https://github.com/atuandev/bookstore-backend
- Owner: atuandev
- Created: 2024-10-14T09:19:36.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-10-29T12:34:23.000Z (8 months ago)
- Last Synced: 2024-10-29T15:00:32.299Z (8 months ago)
- Topics: docker, heidisql, intellij-idea, lombok, mapstruct, mysql, spring, spring-boot, spring-data-jpa, spring-security, spring-security-oauth2, swagger
- Language: Java
- Homepage:
- Size: 4.98 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring API for BookStore
## Requirement
- JDK 21## Techs
- Spring Boot
- Spring Security
- Spring Data JPA
- Redis
- Lombok
- Mapstruct
- Swagger UI
- MySQL## Tools
- IntelliJ IDEA 2024
- Docker
- HeidiSQL## Getting Started
### Prod mode
1. Clone project: `git clone [email protected]:atuandev/bookstore-backend.git`
2. Build Image `docker build -t api-image-bookstore:1.0.0 .`
3. Run Container `docker-compose up -d`
### Dev mode
1. Clone project: `git clone [email protected]:atuandev/bookstore-backend.git`
2. Install MySQL from Docker `docker pull mysql:8.4.0`
3. Run Container **MySQL** `docker run --name mysql-8.4.0 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql:8.4.0`
4. Install Redis from Docker `docker pull redis:7.4.1`
5. Run Container **Redis** `docker run --name redis-7.4.1 -p 6379:6379 -d redis:7.4.1`

6. Use **Intellij** to run a project
> If error when build, run `mvn clean package`### Database
- Use HeidiSQL to connect the database with **username**: `root`, **password**: `root`
- Import data in `/src/data/bookstore.sql`
### SwaggerUI
1. Test API with **Postman** or **SwaggerUI** at `http://localhost:8080/bookstore/swagger-ui/index.html`
2. Login Admin account:
- username: `admin`
- password: `admin123`