Giter Site home page Giter Site logo

csc495's Introduction

Prerequisites

  1. Install Node.js and NPM (https://nodejs.org/en/download/)

  2. Install webpack (https://webpack.js.org/guides/installation/)

#!/bin/bash
$ npm install --global webpack
  1. Install Mongo (https://docs.mongodb.com/manual/administration/install-community/)

  2. Start Mongo instance

  3. Install Elastic Search (https://www.elastic.co/guide/en/elastic-stack-get-started/7.5/get-started-elastic-stack.html#install-elasticsearch)

  4. Start Elastic Search instance

  5. (Optional) Install Docker (https://docs.docker.com/v17.12/install/)

    • If you want to build and deploy in a container

How to set up

  1. Install dependencies
#!/bin/bash
$ npm install
  1. In the root of the project, create .env file, save it in the root of the project and set your environment variables.
#!/bin/bash
# fill in the blanks
$ API_URL=<FILL IN THE BLANK>
$ echo -e 'API_URL='$API_URL'\n' > .env
  1. In the root of the project, create .env.server file, save it in the root of the project and set your environment variables.
#!/bin/bash
# fill in the blanks
$ DB_HOST=<FILL IN THE BLANK>
$ DB_USER=<FILL IN THE BLANK>
$ DB_NAME=<FILL IN THE BLANK>
$ ES_HOST=<FILL IN THE BLANK>
$ echo -e 'DB_HOST='${DB_HOST}'\nDB_USER='${DB_USER}'\nDB_NAME='${DB_NAME}'\nES_HOST='${ES_HOST}'\n' > .env.server
  1. For testing purposes, create .env.test and .env.server.test and fill in the test environment setup like above.

Deploying Service

  1. Start service
#!/bin/bash
$ npm start

Environment Variables

.env (dotenv) file (UI)

Environment Variable Example
API_URL http://127.0.0.1:3001

.env.server file (Server)

Environment Variable Example
DB_HOST 127.0.0.1:3000
DB_USER usename:password
DB_NAME csc302
ES_HOST http://127.0.0.1:9200

UI Env file example (.env)

# .env
API_URL=127.0.0.1:3001

Server Env file example (.env.server)

# .env.server
DB_HOST=127.0.0.1:3000
DB_USER=admin:password
DB_NAME=csc302
ES_HOST=http://127.0.0.1:9200

Using Docker

Running Services with Docker

Allows you to connect to your local database instance with correct envrionment configuration

  1. From root of the project, run
#!/bin/bash
$ ./docker-run.sh {Optional: Name of image} {Optional: Database host} {Optional: ElasticSearch Host}

Running docker-compose

#!/bin/bash
$ ./docker-compose.sh

Running single elastic search instance

#!/bin/bash
$ ./docker-elastic-local.sh

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.