Giter VIP home page Giter VIP logo

test-task-mevn-app's Introduction

MEVN-app

Dependencies

  • node.js
  • npm

Install & Run

Auto install

⚠️ If you are deploying app on VPS: update VUE_APP_BASE_URL and SERVER_PORT in install.sh

...
# For example:
SERVER_PORT=5000
VUE_APP_BASE_URL="http://165.227.141.103:5000"
...

.env

Do not forget to create .env files with connection parameteres
(see example in .env section of manual install)

Script install.sh will install and deploy the application using default parameters

# Production version (recommended):
./install.sh --prod

# Development version:
./install.sh

Manual install

Install all necessary packages (run in the root of repository)

npm --prefix ./client install
npm --prefix ./server install

Frontend

Frontend part is stored in client directory.

.env

Before building/deploying frontend you should create .env file that contains:

VUE_APP_BASE_URL="backend's URL"

# For example:
VUE_APP_BASE_URL="http://165.227.141.103:5000"

Compiles and minifies for production

npm run build

# This command will put all necessary files in dist folder.

Compiles and hot-reloads for development

npm run serve [--port portNumber]

# By default frontend part is started on 8080 port.

Backend

Backend part is stored in server directory.

.env

Before starting application you should create .env file containing following variables:

# Port for backend:
PORT = 5000
PROD_DIST_FOLDER = "Path to the dist folder"

# Connection parameters by string structure:
# PREFIX://USER:PASSWORD@HOSTS`

DB_USER = "USER"
DB_PSWD = "PASSWORD"
DB_PREFIX = "PREFIX" # e.g. "mongodb"
DB_HOSTS = "HOSTS"

⚠️ If you changed default port of app: do not forget to update value in client's .env file

Compiles for production

npm run start

# This command will use node to run application

Compiles and hot-reloads for development

npm run devser

# This command will use nodemon to run application

Usage

After deploying the app, go to http://localhost:{port} or URL you specified

API documentation

API consist of the following methods:

// Client API
getClients()
addClient(client)
getClient(id)
updateClient(client)
deleteClient(id)

// Provider API
getProviders()
addProvider(provider)
getProvider(id)
updateProvider(provider)
deleteProvider(id)

// Page API
getPage(page, limit)
getSortedPage(page, limit, key, asc)

Go to SwaggerHub for detailed information about them.

test-task-mevn-app's People

Contributors

nyuuuukie avatar

Watchers

 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.