-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The Backend with DTO API is a RESTful web service that allows you to manage products, users, shopping carts, and more. It is built using Spring Boot and employs JWT (JSON Web Tokens) for authentication and authorization.
Here are the main endpoints of the API:
-
/products
: Manage products (CRUD operations). -
/users
: Manage users (CRUD operations). -
/api/shopping-cart
: Manage shopping carts and items (CRUD operations). -
/auth
: Authentication and authorization endpoints.
For detailed information about each endpoint, refer to the API Documentation.
This API uses JWT (JSON Web Tokens) for authentication and authorization. To access protected endpoints, you need to obtain a JWT token by authenticating with valid credentials.
-
POST /auth/authenticate
: Authenticate and obtain a JWT token.
The API supports different user roles, including:
- USER
- ADMIN
- ANONYMOUS
Each endpoint may have specific role requirements for access. Ensure you have the appropriate role when making requests.
To get started with the Backend with DTO API, follow these steps:
-
Prerequisites:
- Java 17
- Spring Boot
- Maven (or your preferred build tool)
-
Clone the Repository:
git clone https://github.com/your-repo/backend-with-dto.git cd backend-with-dto
-
Configure Database:
- Configure your database settings in application.properties or application.yml.
spring.datasource.url=jdbc:mysql://localhost:3306/your_database
spring.datasource.username=your_username
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
4.Build and Run:
mvn spring-boot:run