A fully functional E-Commerce backend API built with Spring Boot, featuring user authentication, product management, cart functionality, and order processing.
-
User Management
- Registration, login, and authentication
- Role-based authorization (User/Admin)
- JWT token authentication
- Refresh tokens for persistent sessions
-
Product Management
- CRUD operations for products
- Product categorization
- Search and filtering
-
Shopping Cart
- Add/remove items
- Quantity adjustment
- Cart persistence
-
Order Processing
- Checkout functionality
- Order history
- Order status tracking
-
Security
- Password hashing with BCrypt
- JWT authentication
- CSRF protection
- Input validation
-
Backend
- Java 17
- Spring Boot 3.x
- Spring Security
- JWT (JSON Web Tokens)
- MapStruct for DTO mapping
- Jakarta Validation
- Spring Data JPA
-
Database
- MySQL (Production)
- H2 (Development)
-
Tools
- Maven
- Postman (for API testing)
- Swagger (API documentation)
- Railway (Deployment)
- Java 17 JDK
- Maven 3.8+
- MySQL 8.0+ (for production)
- Git
- Clone the repository:
git clone https://github.com/urugondavishnu/E-Commerce-RESTFUL_API.git
- Navigate to the project directory:
cd E-Commerce-RESTFUL_API - Create a
.envfile in the root directory with the following variables:SPRING_JWT_SECRET=your-256-bit-secret-key-here SPRING_DATASOURCE_URL=jdbc:h2:mem:ecommerce - Build and run the application:
mvn spring-boot:run
The application will be available at http://localhost:8080
- Set up a MySQL database (Railway recommended).
- Configure the following environment variables:
SPRING_PROFILES_ACTIVE=prod SPRING_JWT_SECRET SPRING_DATASOURCE_URL - Build the application:
mvn clean package
- Deploy the generated
target/*.jarfile to your production environment
The API implements:
- JWT-based authentication
- Role-based authorization
- Password hashing with BCrypt
- Input validation
- Secure token handling with refresh tokens
Contributions are welcome! Please fork the repository and create a pull request with your changes.
- Spring Framework
- JJWT library
- MapStruct
- Railway for deployment
For questions or feedback, please contact urugondavishnu.