Chat-Buy-React

Client for beginners to learn, built with React / Redux / Node

GPL-3.0 License

Stars
1K
Committers
3

Use React / Node to achieve the application. Project is small but complete, suitable for novice learning.

Technology stack and main framework

πŸ“¦ React family:react + redux + react-router 4.0 + immutable.js πŸ“Œ ES6 + ES7 πŸ“‘ fetch:axios + socket.io 🎈 UI Framework:antd mobile ✏️ Back-end:express + mongoDB

Run Project

# clone 
git clone https://github.com/KieSun/Chat-Buy-React.git
cd chat-buy-react

# Mac install MongoDb
brew install mongodb

# run MongoDb
mongod --config /usr/local/etc/mongod.conf

# connect mongo
mongo

# install npm package
npm install
npm i nodemon -g

# run server (Mac)
npm run server

# run server (Windows)
npm run dev

# run localhost
npm run start

Screenshot

I will internationalized text.

File structure

── server                         
β”‚Β Β  β”œβ”€β”€ chat.js                   
β”‚Β Β  β”œβ”€β”€ foods.json                
β”‚Β Β  β”œβ”€β”€ goods.js                  
β”‚Β Β  β”œβ”€β”€ jwtMiddleware.js          
β”‚Β Β  β”œβ”€β”€ key.js                    
β”‚Β Β  β”œβ”€β”€ model.js                  
β”‚Β Β  β”œβ”€β”€ order.js                  
β”‚Β Β  β”œβ”€β”€ server.js                 
β”‚Β Β  β”œβ”€β”€ socket.js                 
β”‚Β Β  └── user.js                   
β”œβ”€β”€ src
β”‚Β Β  β”œβ”€β”€ actions                   
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ chat.js
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ goods.js
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ order.js
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ type.js
β”‚Β Β  β”‚Β Β  └── user.js
β”‚Β Β  β”œβ”€β”€ asyncComponent.jsx        
β”‚Β Β  β”œβ”€β”€ common
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ axiosMiddleware.js    
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ history.js            
β”‚Β Β  β”‚Β Β  └── unit.js               
β”‚Β Β  β”œβ”€β”€ components
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ allOrders             
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── list.jsx
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ common
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── 404.jsx
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ goods
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ buy.jsx           
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── goodsList.jsx     
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ login
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── loginForm.jsx     
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ message
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ chatList.jsx      
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ chatListItem.jsx  
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── messageList.jsx   
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ myOrder
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ myOrder.jsx       
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── myOrderItem.jsx   
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ navBar
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── backNavBar.jsx    
β”‚Β Β  β”‚Β Β  └── register
β”‚Β Β  β”‚Β Β      └── registerForm.jsx  
β”‚Β Β  β”œβ”€β”€ container                 
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ allOrders.jsx
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ chat.jsx
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ dashboard.jsx
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ goods.jsx
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ login.jsx
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ message.jsx
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ my.jsx
β”‚Β Β  β”‚Β Β  └── register.jsx
β”‚Β Β  β”œβ”€β”€ images                    
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ goods-sel.png
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ goods.png
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ message-sel.png
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ message.png
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ order-sel.png
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ order.png
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ user-sel.png
β”‚Β Β  β”‚Β Β  └── user.png
β”‚Β Β  β”œβ”€β”€ index.js                  
β”‚Β Β  β”œβ”€β”€ reducers                  
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ chat.js
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ goods.js
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ index.js
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ orders.js
β”‚Β Β  β”‚Β Β  └── user.js
β”‚Β Β  β”œβ”€β”€ registerServiceWorker.js
β”‚Β Β  β”œβ”€β”€ router                    
β”‚Β Β  β”‚Β Β  └── router.jsx
β”‚Β Β  β”œβ”€β”€ store
β”‚Β Β  β”‚Β Β  └── configureStore.js
β”‚Β Β  └── styles
β”‚Β Β      └── index.scss

Features

  • [√] Route Separate
  • [√] Redux
  • [√] Back-end interface
  • [√] Using Immutable.js
  • [√] Login, register and authentication
  • [√] Goods UI
  • [√] All order UI
  • [√] Mine UI
  • [√] Chat Features
  • [] Use TypeScript
  • [] GraphQL
  • [] Reative-native

Feedback, issues, etc. are more than welcome!