/visitPage

Primary LanguageJavaScript

VisitPage for Hackaton Best

The working site is here: http://kapust1n.ru/

This is single page application (SPA). For create this app, we are use Redux and React.

Using Webpack, we collect one index.html file that loads the bundle.js script. It contains both js code and styles for the pages. If you want to know the details, examine the code.

The src folder contains all executable code.

The style folder contains all the styles.

Running the app

At first clone the repository:

$ git clone https://github.com/Pacman29/visitPage.git && cd visitPage

Now you can build and run the app, there are several ways to do it:

Using docker

  1. Build the docker image:
$ docker build -t visitpage .
  1. Run a container (replace <PORT> with port you want to listen):
$ docker run -p <PORT>:80 visitpage

Open http://localhost:<PORT> in the browser.

Using npm & node.js

  1. It requires Node.js with npm. Install them.

  2. Install dependencies:

$ npm install
  1. Run the server :
$ npm start

And open http://localhost:<PORT> in the browser.

Using a server

  1. It requires Node.js with npm. Install them.

  2. Install dependencies:

$ npm install
  1. Generate bundle:
$ npm run build

Generated files are located in dist/ directory. For it to work properly, you should use them and public/ as static files on your server. Do it manually, or do the following to run with nginx:

  1. Install nginx.

  2. Copy generated files:

cp -R dist/. /usr/html/
  1. Copy static files:
cp -R public/. /usr/html/
  1. Copy nginx config:
cp nginx.conf /etc/nginx/nginx.conf
  1. Restart nginx:
sudo service nginx restart

Open http://localhost in the browser

Using webpack server

Use

npm start

for run webpack server

Open http://localhost:8080 in the browser