Skip to content

BookStore Web Application 🦜 Dependency Injection Sample in C#

Notifications You must be signed in to change notification settings

kitepea/ShelfWise-MVC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shelf-Wise

An e-commerce platform designed for book sales. It provides various functionalities for different user types, including administrator, customers, employees, and company representatives.

Table of Contents

  1. Tech Stack
  2. Features
  3. Roles
  4. Accounts for Tryout
  5. Setup Instructions
  6. Usage and Testing
  7. Deployment
  8. Images

Tech Stack

Frontend

  • Bootstrap
  • jQuery
  • Toastr: Real-time notifications and alert messages.
  • TinyMCE: Rich text editor for content input.
  • DataTables: Adds search and pagination to HTML tables.

Backend

  • ASP.NET Core MVC (.NET 8)
  • N-Tier Architecture
  • Data Management Patterns: Repository & UnitOfWork

Database

  • MSSQL: Local database for development.
  • Azure SQL Database: Production database in Azure.

Authentication & Authorization

  • ASP.NET Core Identity: Role-based access and user authentication.
  • Facebook Login: Enables social login.

Payment & Email

  • Stripe: Secure payment and refund processing.
  • Postmark: Transactional email sending.

Hosting

  • Azure: Production hosting environment.

Additional Libraries & Tools

  • Identity Scaffolding: Razor Class Library for user authentication.
  • State Management: TempData and ViewData for sharing data between views.
  • View Components: Dynamic content rendering with ASP.NET Core View Components.

Features

Shelf-Wise offers various features for users and admins:

  • User Management: Create, manage, and assign roles to users. Manage companies information ( for company accounts ).
  • Product Management: Add, edit book details, and manage books categories.
  • Authentication: Login/Register via email/password or Facebook.
  • Stripe Integration: Secure payments and refund processing.

Roles

Shelf-Wise defines four distinct user roles with specific permissions:

  1. Role_Customer: Standard customer with purchase access.
  2. Role_Admin: Access to order and content management (categories, products, companies, users).
  3. Role_Company: Similar to customers but with NET 30 payment terms for companies.
  4. Role_Employee: Supports order management alongside admins.

Accounts for Tryout

Here are test accounts for trying out the platform:

Role Email Password
Company company@gmail.com P@ssw0rd
Employee employee@gmail.com P@ssw0rd
Customer customer@gmail.com P@ssw0rd

Setup Instructions

Follow these steps to set up Shelf-Wise on your local machine:

1. Clone the Repository

git clone https://github.com/kitepea/ShelfWise-MVC.git
cd ShelfWise-MVC

2. Configure App Settings

Fill in the required fields in appsettings.json:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*",
  "ConnectionStrings": {
    "DefaultConnection": "Connection_String"
  },
  "Stripe": {
    "SecretKey": "Stripe_SecretKey",
    "PublishableKey": "Stripe_PublishableKey"
  },
  "Facebook": {
    "AppId": "Facebook_AppId",
    "AppSecret": "Facebook_AppSecret"
  },
  "PostMark": {
    "ServerApiToken": "PostMark_Token"
  }
}

3. Install Dependencies

Run the following command to install necessary NuGet packages:

dotnet restore

4. Build the Solution

Build the application using the .NET CLI:

dotnet build

5. Update Database

To apply migrations and create the database schema:

dotnet ef database update

6. Run the Application

Launch the application locally:

dotnet run

Deployment

The Shelf-Wise application has been successfully deployed. You can access it using the following link (sometimes I shut down the app service due to depleted SQL database resources :)):

https://shelfwise-e0g3fdfxhsb8brae.southeastasia-01.azurewebsites.net/

Images

Image 1 Image 2 Image 3
Image 4 Image 5 Image 6
Image 7 alt text Image 8
Image 9 Image 10 Image 11
Image 12 Image 13 Image 14