E-Commerce Webstore Backend API is a backend REST API built with Java, runs on Spring Boot, designed to manage inventory, users, products, and orders for an e-commerce webstore.
It implements secure authentication using JWT
and email verification for new users.
-
User Management:
- User registration, authentication, and profile management.
- Email verification for new users.
- Secure access to user profiles, orders, and products.
-
Inventory Management:
- Track available products and their stock levels.
- Track available products and their stock levels.
-
Product Management:
- CRUD operations for products with detailed information.
- CRUD operations for products with detailed information.
-
Order Management:
- Place, update, and track orders for authenticated users.
- Place, update, and track orders for authenticated users.
-
Security:
- JWT-based Authentication for secure sessions.
- Email verification ensures user authenticity.
- JWT-based Authentication for secure sessions.
- Java with Spring Boot: For backend application development.
- Spring Security: For user authentication and authorization.
- Microsoft SQL Server: For data persistence.
- JWT: For stateless authentication.
- JavaMail: For email verification.
- Java 11 or higher.
- Maven installed.
- Microsoft SQL Server instance.
-
Clone the repository:
git clone https://github.com/your-username/ecommerce-webstore-backend.git cd ecommerce-webstore-backend
-
Configure the database connection:
- Open
application.properties
orapplication.yml
in thesrc/main/resources/
folder. - Update the following fields with your database credentials:
spring.datasource.url=jdbc:sqlserver://<DB_HOST>:<DB_PORT>;databaseName=<DB_NAME> spring.datasource.username=<DB_USERNAME> spring.datasource.password=<DB_PASSWORD>
- Open
-
Build and run the application:
mvn clean install mvn spring-boot:run
-
The application will run on
http://localhost:8080/
by default.
POST /auth/register
- Register a new user.POST /auth/login
- Log in a user.
GET /auth/me
- Retrieve authenticated user profile.
GET /products
- Fetch all products.
GET /order
- View order for authenticated users.
- This API uses JWT for secure and stateless authentication.
- To access protected endpoints, include a valid JWT token in the
Authorization
header:
Authorization: Bearer <your-token>
- Upon registration, users will receive a verification email containing a unique link.
- The account must be verified before accessing authenticated endpoints.
Contributions are welcome! If you'd like to contribute, here’s how:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature
- Commit your changes and push to the branch:
git commit -m "Add your feature description" git push origin feature/your-feature
- Open a pull request.
For feedback, questions, or collaboration opportunities, feel free to reach out:
- Email: [email protected]
- GitHub: mburuxx
---
Thank you for checking out the E-Commerce Webstore Backend API! We hope it meets your needs.