Git Product home page Git Product logo

internet-shop-1's Introduction

ONLINE SHOP

This project is deployed on Heroku cloud platform - try it right now! (first launch may take a few seconds)

Header Image


Project purpose

Project structure

Implementation details

Launch guide

Author


Project purpose

This web project represents a simplified online shop with basic features such as:

  • Registration, login and logout
  • User password encryption
  • User authentication and RBAC authorization
  • Product management
  • Adding products to shopping cart and order completion
  • Order history and management
  • User management

Users with USER role are authorized to:

- view all products
- add to and remove products from their shopping cart
- view shopping cart and complete order
- view all their orders

Users with ADMIN role are authorized to:

- add to or delete products from the list of products available for order
- view all users and their orders
- delete user's order or the user himself

Project structure

The project uses MVC architectural pattern. Project structure is the following:

  • Models (entity classes)
  • DAO layer, containing basic CRUD-operations for communication with the persistence layer
  • Service layer, containing business-logic of the application
  • Servlets, implementing client-server communication logic
  • JavaServer Pages

Implementation details

  • Dependency Injection design pattern is used in the project - DAO and Service dependencies are injected during runtime

  • DAO layer has two implementations:

    • inner-storage (List-based)
    • outer-storage (using JDBC connecting to MySQL RDBMS)

    To switch between the two implementations, you will need to place @Dao annotation before class declaration of the chosen implementation

  • User authentication and RBAC authorization are realized through filters

  • JSPs use JSTL, EL and Twitter Bootstrap

  • Logging is implemented via Log4j2 library

  • Maven Checkstyle Plugin, Travis CI and SonarCloud Continuous Code Quality Tool are configured


Launch guide

To run this project you will need to install:

Here are the steps for you to follow:

  • Add this project to your IDE as Maven project.
  • If necessary, configure Java SDK 11 in Project Structure settings.
  • Add new Tomcat Server configuration and select war-exploded artifact to deploy. Set application context parameter to "/".
  • Change path to your log file in src/main/resources/log4j2.properties on line 4. You may also want to change the 'filePattern' parameter on line 17.
  • If you decide to use the default JDBC-based DAO implementation:
    • Execute queries listed in src/main/resources/init_db.sql in MySQL RDBMS in order to create the schema and all the tables required.
    • Enter your own username and password in src/main/java/com/internet/shop/util/ConnectionUtil.java class on lines 8-9.
  • Run the project via Tomcat configuration.

First, you will need to register as a new user. By default, the USER role is assigned to all registered users.

After a successful login you will be able to inject an ADMIN user by pushing the corresponding button from the main page.

The ADMIN user will have a default email - "[email protected]" and password - "1".

At this point, you may wish to login as the ADMIN user and add some products that will become available for order by USERs.


Author

Kseniia Makarova

internet-shop-1's People

Contributors

kseniiamakarova avatar

Watchers

James Cloos 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.