Code Monkey home page Code Monkey logo

ecommerce-react-redux-app's Introduction

English Β· Portuguese

Table of Contents

About the project

This project was my biggest one so far and without a doubt the one that I most learned from. I started this project with its MVP in mind, so I picked bootstrap for styles and redux for state management. It was really awesome to realize that I didn't have any huge gaps in my knowledge, the biggest one being back-end security, but it was relatively smooth sailing. After finishing both ends (front and back) of the app I decided to change the visual and take bootstrap out of the project, so I used Storybook while designing the new components and Styled Components for styling.

Live Demo

Deployed on heroku

Logins

Screenshots

Home

Product

Category

Cart

Profile/Orders

Functionality

  • Product fetching/sorting
  • Fully functional shopping cart
  • Product reviews and ratings
  • Product pagination
  • Product search feature
  • User profile with orders
  • Mark orders as delivered option
  • Checkout process (shipping, payment method, etc)
  • PayPal and Mercado Pago integration
  • Responsive design
  • Tests
  • Admin Panel
  • Server Side Rendering

Technologies

Front-end

Folder Structure

I used a Rails-style pattern [ref], so each file type resides in an appropriately named directory: actions, reducers, components, etc. I also used the Atomic Design methodology for separating components and make it easier to understand what does what at a glance.

β”Œβ”€β”€β”€actions
β”‚   └─ Collection of Redux action
β”œβ”€β”€β”€reducers
β”‚   └─ Collection of Redux reducers
β”œβ”€β”€β”€types
β”‚   └─ Constants used in Redux
β”œβ”€β”€β”€components
β”‚   β”œβ”€β”€β”€atoms
β”‚   β”‚   └─ The smallest part of a component
β”‚   β”œβ”€β”€β”€molecules
β”‚   β”‚   └─ Small combinantions of atoms
β”‚   └───organisms
β”‚       └─ Larger combinations of atoms and molecules
β”œβ”€β”€β”€pages
β”‚   └─ Combination of organisms and deals with getting the data
└───styles
    └─ Global/Commonly used styles

Back-end

Folder Structure

In the back-end I chose to stick with the classic MVC (Model-View-Controller, without a View) with a few changes to make it more API friendly. Another thing also worth mentioning is that I'm using ES6/ESM imports.

β”Œβ”€β”€β”€config
β”‚   └─ Configurations
β”œβ”€β”€β”€controllers
β”‚   └─ Business logic
β”œβ”€β”€β”€data
β”‚   └─ Data used by the seeder
β”œβ”€β”€β”€middleware
β”‚   └─ Middlewares (Auth and error handler)
β”œβ”€β”€β”€models
β”‚   └─ Database schemas
β”œβ”€β”€β”€routes
β”‚   └─ API Routes
β”œβ”€β”€β”€uploads
β”‚   └─ Images uploaded
└───utils
    └─ Utilitary functions

Issues / PR

Feel free to file a new issue with a respective title and description on the repository. If you already found a solution to your problem, I would love to review your pull request!

⭐ If you like what you see dont forget to star this project, I would really appreciated it!

How to run

Don't forget to configure backend .env, use the following template:

PORT=
MONGO_URI=
JWT_TOKEN=
PAYPAL_CLIENT_ID=
MERCADO_PAGO_ACCESS_TOKEN=
# Clone the repo
$ git clone https://github.com/Rawallon/Ecommerce-react-redux-app && cd Ecommerce-react-redux-app

# Install front-end dependencies
$ cd frontend && npm i && cd ..

# Install back-end dependencies
$ cd backend && npm i && cd ..

# Install concurrently
$ npm i

# Feed data into your DB
$ npm run data:import

# Runs both ends
$ npm start

# Alternatively you can start individually
# npm run client
# npm run server

ecommerce-react-redux-app's People

Contributors

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