Skip to content

mburuxx/ecommerce-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce Webstore Backend API

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.

Features

  • 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.
  • Product Management:

    • CRUD operations for products with detailed information.
  • Order Management:

    • Place, update, and track orders for authenticated users.
  • Security:

    • JWT-based Authentication for secure sessions.
    • Email verification ensures user authenticity.

Technologies Used

  • 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.

Installation

Prerequisites:

  • Java 11 or higher.
  • Maven installed.
  • Microsoft SQL Server instance.

Steps:

  1. Clone the repository:

    git clone https://github.com/your-username/ecommerce-webstore-backend.git
    cd ecommerce-webstore-backend
  2. Configure the database connection:

    • Open application.properties or application.yml in the src/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>
  3. Build and run the application:

    mvn clean install
    mvn spring-boot:run
  4. The application will run on http://localhost:8080/ by default.

API Endpoints

Authentication:

  • POST /auth/register - Register a new user.
  • POST /auth/login - Log in a user.

User:

  • GET /auth/me - Retrieve authenticated user profile.

Products:

  • GET /products - Fetch all products.

Orders:

  • GET /order - View order for authenticated users.

Authentication and Security

  • 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>
    

Email Verification

  • Upon registration, users will receive a verification email containing a unique link.
  • The account must be verified before accessing authenticated endpoints.

Contributing

Contributions are welcome! If you'd like to contribute, here’s how:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix:
    git checkout -b feature/your-feature
  3. Commit your changes and push to the branch:
    git commit -m "Add your feature description"
    git push origin feature/your-feature
  4. Open a pull request.

Contact

For feedback, questions, or collaboration opportunities, feel free to reach out:

---

Thank you for checking out the E-Commerce Webstore Backend API! We hope it meets your needs.

About

A Java backend api built with Springboot

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published