Skip to content

Instantly share code, notes, and snippets.

@kcubero27
Last active December 1, 2021 09:17
Show Gist options
  • Save kcubero27/546a1099e00fae1f4faace0446702f6f to your computer and use it in GitHub Desktop.
Save kcubero27/546a1099e00fae1f4faace0446702f6f to your computer and use it in GitHub Desktop.
Front End README

PROJECT NAME

Requirements

For development, you will only need Node.js installed on your environement. And please use the appropriate Editorconfig plugin for your Editor (not mandatory).

node > 12.0
npm >= 1.00

Node.js

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It now includes NPM. You should be able to run the following command after the installation procedure below.

$ node --version
v0.10.24

$ npm --version
1.3.21

We recommend installing NVM instead of Node.js as it allows to have different Node.js versions in your environment.

NVM installation

NVM allows you to quickly install and use different versions of node via the command line.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

Running either of the above commands downloads a script and runs it. The script clones the nvm repository to /.nvm, and attempts to add the source lines from the snippet below to the correct profile file (/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc).

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Node installation on OS X

You will need to use a Terminal. On OS X, you can find the default terminal in /Applications/Utilities/Terminal.app.

Please install Homebrew if it's not already done with the following command.

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

If everything when fine, you should run

brew install node

Node installation on Linux

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

Node installation on Windows

Just go on official Node.js website & grab the installer. Also, be sure to have git available in your PATH, npm might need it.

Installation

  1. Clone this repo: $ git clone https://github.com/ORG/PROJECT.git
  2. Access inside the project: $ cd PROJECT
  3. Select the right Node.js version: use NVM $ nvm use or check the version specified package.json under engines
  4. Install project dependencies: $ npm install

Configure app

Copy .env.dist to .env then edit it with staging values. You can also download directly the .env from the staging environment by running $ aws s3 cp .env s3://project/environment/.env.

Development

Navigate to the project folder and run the following command in the terminal:

$ npm run dev

This will open a new tab in your browser on http://localhost:3000

Testing

Execute unit tests via:

$ npm run test

Execute integration tests via:

$ npm run test

Execute e2e tests via:

$ npm run test

Build

It will create the output under dist folder in the root path of the project.

$ npm run build

Release

$ npm run prepare-release

Deploy

Jenkins pipeline 1

IDE Configuration

We recommend you ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment