Giter Site home page Giter Site logo

h-shop's Introduction

H-Shop

Getting Started

Welcome to H-Shop! This is a simple e-commerce website that I built to practice my full-stack development skills. The website is built with NextJS, MongoDB, and Redux.

Project Live Demo

  • Docker Deployment: Upcoming
  • Vercel Deployment: Upcoming

If you like the project, please give it a star. It will help me to keep going and improve the project. Thank you!

Background

Why I built this project

As a backend developer, my frontend skills are not as good as my backend skills. After a interview for full-stack position, I realized that I need to improve my frontend skills. So I decided to build a e-commerce website to practice my frontend skills.

Objective

  • Built a complete, well-structured, and scalable e-commerce website.
  • Improved my frontend skills, especially in React, Redux, and NextJS.
  • Use a series cutting-edge technologies: NextJS, TailwindCSS, Headless UI, Redux-Toolkit-RTK query, JWT, Docker, and MongoDB, etc.
  • Focus on frontend (user interface and user experience), backend is simple enough to support the frontend.

Technologies

Technologies that I used in this project:

  • TypeScript: main language.
  • NextJS: main framework.
  • TailwindCSS: for CSS styling.
  • Headless UI: for UI components.
  • Redux Toolkit: for state management.
  • RTK Query: A powerful data fetching and caching tool.
  • JWT: for aauthentication.
  • MongoDB: for database.
  • Docker: for deployment.

Demo

Upcoming

Project Structure

๐Ÿ—๏ธ H-Shop Project Structure:

Key structure explanation:

  • ๐Ÿ“ app: Main code of the application

    • ๐Ÿ“ main: Main application components
      • ๐Ÿ“ client-layout: Common layout pages for the user side
      • ๐Ÿ“ empty-layout: Common blank layout pages
      • ๐Ÿ“ admin: Admin pages
      • ๐Ÿ“„ layout.ts: Main layout configuration
      • ๐Ÿ“ profile: User profile page
    • ๐Ÿ“„ StoreProvider.js: Global state management provider
    • ๐Ÿ“ api: API request-related routes
      • ๐Ÿ“ auth: User authentication API
      • ๐Ÿ“ banner: Advertisement banner API
      • ๐Ÿ“ category: Product category API
      • ...
  • ๐Ÿ“ components: Reusable React components

  • ๐Ÿ“ helpers: Helper functions and tools

    • ๐Ÿ“ api: API request-related helper functions
    • ๐Ÿ“„ auth.ts: Helper functions related to user authentication
    • ...
  • ๐Ÿ“ hooks: Custom React hooks

  • ๐Ÿ“ models: Data model definitions

  • ๐Ÿ“ public: Static resources, such as images, fonts, etc.

  • ๐Ÿ“ store: Configuration related to Redux state management

    • ๐Ÿ“ services: RTK Query
    • ๐Ÿ“ slices: Redux Toolkit
  • ๐Ÿ“ styles: Style files

  • ๐Ÿ“ utils: General utilities

  • ...

This structure is designed to make project easy to navigate and maintain. It is also scalable and easy to expand.

Installation and Usage

Local Development

  1. Clone the project
```bash
    git clone https://github.com/vanhung4499/h-shop.git
  1. Installl dependencies
    npm install
    # OR
    yarn install
  1. Modify the environment variables
    cp .env.example .env.local
  1. Start MongoDB server

You can run mongodb server locally or use docker for create an instance. I have already included a docker-compose file for this purpose.

    docker-compose up -d mongodb

Docker

I have already included a docker-compose file for this purpose. You can start the project with the following command:

    docker-compose up -d

Deployment

This project is hosted on Vercel. You can deploy the project on Vercel by following these steps:

Upcoming...

License

MIT

Copyright (c) 2024 Hung Nguyen

h-shop's People

Contributors

vanhung4499 avatar

Watchers

 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.