- Fork/Clone
- Install dependencies - npm install
- Fire up Postgres on the default ports
- Make .env file (see .env.example) .env is for prod
- npm run dev for dev, npm run build (vs script package.json)
- If database not exists the program create it.
The project run under nodeJS.
Is 100% typescript, the javascript is used for TDD only and apidoc.
For views a little :
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
.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"
- Node.js
v14.15.1
- PostgreSQL
- Knex.js
- pg
- odata-v4-pg
- json2csv
- koa
- koa-bodyparser
- koa-json
- koa-logger
- koa-router
- koa-session
- koa-passport
- passport-local
- koa-favicon