Skip to content

A server application for dashboard that stores and organizes data for Virtual Reality applications.

Notifications You must be signed in to change notification settings

rehacekleos/vr_dashboard_be

Repository files navigation

VR dashboard server application

This server is used to record and retrieve Vr data from various Virtual Reality applications and support for VR Dashboard app.
The server supports multi-organization.

The server application is written in Node.js using typescript and express.js.
MongoDb version 6.0 is used as the database.

Application Structure

  • /.platform Specific settings for AWS elastic Beanstalk
  • /docs Generated JsDoc documentation
  • /src Project source folder
    • /app Application logic
    • /bootstrap Defining different types of server
    • /configs Setting env variables and all global variables
    • /models Defined global models
    • /server Express.js server settings
    • /shared Global files such as enums, repositories, controllers, middlewares, etc.
      • /exceptions Custom Exceptions
      • /repositories Connection with database
      • /utils Global Utils
    • /swagger Definition of swagger
    • index.ts Application executable file

First run on local machine

Prerequisites

  • MongoDB database with minimal 6 version
  • Installed Node.js (minimal v18) and npm
    • How to install Node.js: How to install Node.js.
    • npm is installed together with Node.js
    • Check if Node.js and npm is installed?
      • Run node -v
      • Run npm -v

Run application

To run the application on the local machine for the first time, you need to do the following:

  1. Run npm install
  2. Create an .env file in the project root folder.
  3. Define the following env in the .env file
    • DB_URL
    • MONGO_DB_DATABASE
  4. Generate JS documentation by npm run generate:docs
  5. Run the application using npm run dev

After that, the application should be available at http://localhost:8000.
If you try opening the following address in a browser, you should see the Swagger documentation.

You can find out if the application is connected to the DB by using the address: http://localhost:8000/health-check where you should see message: vr_dashboard_be is running on version: $app_version.

Available Scripts

In the project directory, you can run:

npm run dev

Runs the app in the development mode.
Open http://localhost:8000/health-check to view it in the browser if server is running well.

npm run build

Builds the app for production to the /build folder.

npm run generate:docs

Builds the docs to the /docs folder.

npm run zip:deploy

Builds the app for production and zip it into deploy-code.zip.

npm run zip:deploy-aws

This command is for unix system. Or you need to have installed cp command!!
Builds the app for production with setting for AWS ElasticBeanstalk and zip it into deploy-code.zip.

Swagger

Api swagger is available on route: /api/docs

JsDoc

Js docs are available on route: /docs

Environmental variables

Environment variables are defined in the /src/configs folder

  • APP_MODE: Define in which mode application is running.
    • REQUIRED
    • VALUES: LOCALHOST, PRODUCTION
  • SERVER_TYPE: defines the server type
    • DEFAULT: DEFAULT
  • PORT: Port on which the application listens.
    • DEFAULT: 8080
  • WORKERS: Number of running worker threads.
    • DEFAULT: 1
  • DB_URL: Connection string to mongoDb database.
    • REQUIRED
    • FORMAT: mongodb+srv://user:password@host
  • MONGO_DB_TYPE: MongoDb database type.
    • DEFAULT: MONGODB
  • MONGO_DB_DATABASE: Name of the mongoDb database.
    • REQUIRED

About

A server application for dashboard that stores and organizes data for Virtual Reality applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages