Giter Site home page Giter Site logo

kenpeter / resumefront Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 714 KB

How to build a simple React and Redux website with Express backend, from start to end

Home Page: https://resumefront.shopshop.space/

JavaScript 89.27% CSS 0.78% HTML 9.95%
react namecheap redux mongodb nginx express-backend

resumefront's Introduction

Intro

Hire me at https://au.linkedin.com/in/thegaryliang

A brief guide on how to build a simple React and Redux website with Express backend, from start to end.

Demo: https://resumefront.shopshop.space/

Buy a domain name

Yes, you need a domain name. I know you can run from you machine. Some domain name is cheap, like $1 that cheap. Go to namecheap.com and buy one. Paypal is supported. Here is a video demo: https://www.youtube.com/watch?v=Zbcn4skYXqM

Buy a server

Head to vpsdime.com, and buy a Ubuntu server.

  • Ubuntu 16.04, 64 bit
  • 4 CPUs
  • 12G Memory
  • 60G SSD (You can use 30G in $7/month, but when you keep installing stuff. It gets full easily.)
  • $14/month

Paypal is supported. Once you got your server, write down your ip address. Because you need to login into namecheap.com and point your new domain (by creating a A record) to that ip.

Build the server

  • Login into the server with ssh
  • Install Nginx, NVM, MongoDB, Letsencrypt, etc.....
  • Basically, the flow is Nginx -> fontend (React/Redux) -> backend (Express server) -> Json web token -> MongoDB. There are lots of things to install, if necessary I will put more instructions here.

About the front end

About redux

alt img

  • So the Page, Menu, Home are you React components.
  • Image you still user jQuery, then on those Page, Menu, etc you click on a button, then something will popup/change.
  • So the "Action" on the diagram is like "Click", while the "Reducer" on the diagram is like "Listener".
  • "State" on the diagram contains smaller states, e.g. like TV, light, air-condition, door, windows. They can be open or close. "State" represents the entire attributes of your App.
  • Redux has a root reducer. This root reducer contains many smaller reducers. Reducer A can control TV on/off, Reducer B can control door open or close, etc....
  • Because TV is on, door is close, etc... That means your entire view is changed now.

About the back end

  • Git clone https://github.com/kenpeter/resumeback
  • yarn start will launch the backend and listening to port 8014.
  • It uses Express, Json web token and Moogose to connect to MongoDB.
  • There are 3 routes here.
    • /setup, this url needs to be hit first. After hit, it imports some data to your mongodb. This means you need to configure your MongoDB instance and change the connection detail in config.js
    • /, home route, nothing here.
    • /api/defaultUser, this will join 3 collections and pull out an entire json object for you.

A diagram for the entire simple site

alt img

Ref

resumefront's People

Contributors

kenpeter avatar

Watchers

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