Giter Site home page Giter Site logo

ecommerceapi's Introduction

E-Commerce API

This is a homework project given in the Patika.dev - Akbank Java Spring Boot Bootcamp.

Description

This is a REST API for an e-commerce application developed using Spring Boot Template (github.com/tzesh/SpringBootTemplate). It is built with Spring Boot and PostgreSQL.

  • Includes a Swagger UI for testing the API endpoints (http://localhost:8080/api/v1/swagger-ui/index.html)
  • Uses JWT for authentication and authorization
  • Uses refresh tokens for refreshing the access token
  • Uses Spring Security for securing the API endpoints
  • Uses MapStruct for mapping DTOs to entities and vice versa
  • Uses Lombok for generating boilerplate code
  • Uses Spring Data JPA for accessing the database
  • Uses ControllerAdvice for handling exceptions

Project Definition

Design and implement a REST API for an e-commerce application. The application should have the following features:

  • The project is a service that provides REST API endpoints for an e-commerce application.
  • Application should be able to handle users, products and comments.
  • Users cannot register with same email address, telephone number or username.
  • User type can be customer or company.
  • Exception handling should be done with ControllerAdvice.
  • All entities should have audit fields (createdDate, createdBy, lastModifiedDate, lastModifiedBy).

How to run

  1. Clone this repository
  2. Create a PostgreSQL database
  3. Change the database configuration in application.properties
  4. Run the application with mvn spring-boot:run
  5. Open http://localhost:8080/api/v1/swagger-ui/index.html in your browser
  6. Register a new user
  7. Login with the registered user
  8. Copy the JWT token from the response
  9. Click the Authorize button in the Swagger UI
  10. Paste the JWT token in the Value field without the Bearer prefix
  11. Click the Authorize button
  12. Now you can test the API endpoints
  13. To test the refresh token endpoint, click the Authorize button again and paste the refresh token in the Value field without the Bearer prefix

Screenshots

Maven Run Swagger UI

ecommerceapi's People

Contributors

tzesh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.