REST API for an online store built with Spring Boot.
- Java 17
- Spring Boot 3.4.3
- Spring Security + JWT
- Spring Data JPA
- MySQL / PostgreSQL
- Lombok & MapStruct
- Maven
- JWT Authentication
- User & customer management
- Product catalog with categories
- Shopping cart
- Order management
- Rate limiting
- Data validation
- Centralized error handling
Base: /api/v1
Auth:
- POST /auth/login
- POST /auth/register
- POST /auth/refresh-token
Resources:
- /users
- /customers
- /products
- /categories
- /orders
- /cart
- Clone repository
git clone https://github.com/melodiaz23/tienda-natuvida-backend.git
cd tienda-natuvida-backend- Configure database in
application-dev.properties
spring.datasource.url=jdbc:mysql://localhost:3306/natuvida_db
spring.datasource.username=your_username
spring.datasource.password=your_password
jwt.secret=your_secret_key- Run
mvn spring-boot:runAPI available at http://localhost:8080
src/main/java/com/natuvida/store/
├── api.response/ -> Standardized API responses
├── config/ -> App configuration (Security, JPA, etc)
├── controller/ -> REST endpoints
├── dto/ -> Data Transfer Objects
├── entity/ -> JPA entities
├── enums/ -> Enumerations
├── exception/ -> Error handling & custom exceptions
├── mapper/ -> MapStruct mappers
├── repository/ -> JPA repositories
├── security/ -> JWT & Security config
├── service/ -> Business logic
└── util/ -> Utilities
Project Evolution Note: This backend was developed as part of my learning journey with Spring Boot and Java. For the final implementation, I migrated the backend logic directly into the Next.js project using API Routes and Server Actions, which simplified deployment and maintenance while keeping full-stack capabilities in a single codebase.