This project is an e-commerce web application built using Java and Jersey. The application supports e-commerce functionalities such as product listing, user authentication, shopping cart, order processing, email verification and more. Additionally, it includes admin functionalities for managing products, orders etc.
- Features
- Technologies
- Installation
- Configuration
- Running the Application
- Usage
- API Endpoints
- Contributing
- License
- User authentication and authorization
- Email verification
- Product management (listing, adding, updating, deleting)
- Shopping cart functionality
- Order processing and management
- RESTful API endpoints
- Error handling and validation
- Admin functionalities for managing products and orders
- Java
- Jersey (JAX-RS)
- Javascript
- Bootstrap
- Maven
- Hibernate (JPA)
- MySQL
- JWT (JSON Web Token) for authentication
- Mailtrap for email verification
- Embedded Tomcat
-
Clone the repository
git clone https://github.com/Romen-git/etech-ecommerce-web-application-java-jersey-javascript.git cd etech-ecommerce-web-application-java-jersey-javascript -
Setup MySQL database
- Run
database/etechdb.sqlto create the database. - Run
database/etechdb_admin.sql,database/etechdb_app_settings.sql,database/etechdb_product_image.sql,database/etechdb_productcategory.sql,database/etechdb_product.sqlto update tables data.
- Run
-
Update configuration files
- Edit
src/main/resources/hibernate.cfg.xmlto set your database configuration. - Create
src/main/resources/db.propertiesandsrc/main/resources/application.propertiesas described in the Configuration section.
- Edit
-
Build the project
mvn clean install
-
Create a Mailtrap Account
- Go to Mailtrap and sign up for a free account.
-
Set Up a New Inbox
- Once logged in, create a new inbox.
- Note the SMTP credentials (host, port, username, password) for the new inbox.
-
Configure the Application
-
Create a
src/main/resources/db.propertiesfile with the following content:db.user=root db.password=password
-
Create a
src/main/resources/application.propertiesfile with the following content:mail.host=sandbox.smtp.mailtrap.io mail.port=port mail.username=username mail.password=password app.mail=mail
-
Start the Embedded Tomcat Server
mvn exec:java -Dexec.mainClass="com.ro.etech.Main" -
The application will be accessible at:
http://localhost:8080/etech
-
Register a new user
GET /signin
POST /signin
-
Verify email address
- After registering, an email will be sent to the user's email address with a verification link.
- Check the inbox in Mailtrap to find the verification email.
- Click the verification link to verify the email address.
-
Login with an existing user
GET /login
POST /login
-
Access the product listing
GET /admin/api/product
-
Admin functionalities
-
Manage products
- Add, update, delete products
-
Manage orders
- View, update order status
-
-
Authentication
POST /signin- Register a new user and send email verificationGET /verify- Verify email address using the link sent in the emailPOST /login- Login and obtain JWT token
-
Products
GET /admin/api/product- List all productsPOST /admin/api/product- Add a new product (Admin only)PUT /admin/api/product- Update a product (Admin only)DELETE /admin/api/product/{id}- Delete a product (Admin only)
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository
- Create a new feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/your-feature) - Open a pull request
This project is licensed under the BCD License. See the LICENSE file for details.