Skip to content

Latest commit

 

History

History
95 lines (75 loc) · 3.04 KB

README.md

File metadata and controls

95 lines (75 loc) · 3.04 KB

Inrae

Want to use this project?

  1. Fork/Clone
  2. Install dependencies - npm install
  3. Fire up Postgres on the default ports
  4. Make .env file (see .env.example) .env is for prod
  5. npm run dev for dev, npm run build (vs script package.json)
  6. If database not exists the program create it.

The project run under nodeJS.

Nodejs

Is 100% typescript, the javascript is used for TDD only and apidoc.

TypeScript Javascript

For views a little :

HTML JS CSS

Directory Structure

 Root
  src
   server
    db
     dataAccess "Access datas"
     entities "Sensorthings entities class"
     interfaces "Interfaces"
    query "Query Tool"
    routes "Router routes"
     views "logins html views"
    utils "Utils for app"
     odata "Odata Enhanced parser"
    constant.ts "All datas"
    db.ts "DB connection"
    index.ts "Server start"
   template "Apidoc Home template"
   test  "TDD tests"
  doc "MD documentation"
  .env "Environment variables"
  favicon.ico

Environment variables

.env

  APP_ORIGIN=https://dev.example.com
  DATEFORMAT=DD/MM/YYYY hh:mm:ss "Date format"
  PORT=XXXX "Port of th api"
  APILIMIT=200 (number of max line result)
  APIVERSION=v1.0 "Version use"
  NODE_ENV=dev "/ prod / test (nono is dev)"
  KEY=secret "Secret word or sentence for encoding session key"

  PGHOST=localhost "postgres host"
  PGPORT=5432 "postgres port"
  PGUSER=sensorapi "postgres user"
  PGPASSWORD=mario "postgres user password"
  PGADMIN=mario "postgres admin password"
  PGDATABASE=test "postgres database name"

Tech Stack