This is a backend API for an e-commerce platform built using Spring Boot, PostgreSQL, and JWT Authentication. The application supports user authentication, product management, shopping cart functionality, and a basic admin interface. Integration with payment gateways (e.g., Stripe) is planned but not yet implemented.
- User registration and login with JWT tokens.
- Role-based access control for admin and regular users.
- Admin can add, update, or delete products.
- Products have details like name, description, price, and stock quantity.
- Users can add and remove products from their shopping cart.
- View cart contents with product details and total cost.
- Users can search for products by name or description.
- Products can be browsed in a paginated format.
- Cart items can be reviewed before checkout.
- Placeholder endpoint for initiating payments (integration with Stripe pending).
- Backend: Spring Boot
- Database: PostgreSQL
- Authentication: JWT (JSON Web Tokens)
- API Testing: Postman / curl / any REST client
- Java 17+
- PostgreSQL
- Maven
-
Clone the repository:
git clone https://github.com/AzamatAbraev/EcommerceAPI cd EcommerceAPI -
Configure PostgreSQL: Create a database named
ecommerce_dband update yourapplication.propertiesorapplication.ymlwith your credentials:spring.datasource.url=jdbc:postgresql://localhost:5432/ecommerce_db spring.datasource.username=your_username spring.datasource.password=your_password spring.jpa.hibernate.ddl-auto=update
-
Run the application:
./mvnw spring-boot:run
- Integrate Stripe or other payment gateway.
- Add frontend (Jinja, EJS, or React).
- Add email notifications.
Feel free to fork this project and contribute!