This is the backend for the tech-radar.
- written in ES6
- trying to use less external modules as possible
- is a Rest API-Server
- Authenticate via Json Web Token
- create, update, delete a Radar
- create, update, delete a Version or Dataset for a Radar
- create, update, delete a Dot or Entry in a Dataset
- is the Api Data Source for the Frontend
Node 12 is needed. Use n
as node version manager from here.
git clone https://github.com/seekwhencer/tech-radar-server.git
cd tech-radar-server
npm install
npm run dev
npm start
Start the server on port 8300
, defined in package.json
with:
"start": "cross-env NODE_ENV=production NODE_PORT=8300 node --experimental-modules --experimental-json-modules index.js",`
npm run prod
Start the server on the given port with the environment variable NODE_PORT
"prod": "cross-env NODE_ENV=production node --experimental-modules --experimental-json-modules index.js",`
Came from Github Neofonie/neo-tech-radar
Github or Github Pages
And will be served from the api server. What port the Frontend must use,
can be defined in public/index.html
with:
const radarOptions = {
serverMode: true,
protocol: 'http',
host: 'localhost',
port: 8300,
apiVersion: 'v1'
};
Only the public/index.html
from this repo will be used as home.
The index.html
from the frontend will be ignored.
Simply run for the production mode
cd /somewhere/on/my/disk/tech-radar-server
docker-compose up -d
Change the login credentials in the docker-compose.yml
:
environment:
- NODE_PORT=8300
- NODE_USER=admin
- NODE_PASS=change!moi
And change the public/index.html
:
const radarOptions = {
serverMode: true,
protocol: 'http',
host: 'localhost',
port: 8300,
apiVersion: 'v1'
};
cd /somewhere/on/my/disk/tech-radar-server
docker-compose down
git fetch --all
git reset --hard origin/master
docker-compose up -d --build
- Authenticate
username, password
Any GET and POST Request needs a{ "message": "authenticated", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjaGVjayI6dHJ1ZSwidXNlciI6ImFkbWluIiwiaWF0IjoxNTcxMjI1MzI2LCJleHAiOjE1NzEyNDI2MDZ9.jOpNBe_UkzGTI3pDe7NE6nL2UNtlrm2kJ5UyvE1W4BU" }
header
like:"access-token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjaGVjayI6dHJ1ZSwidXNlciI6ImFkbWluIiwiaWF0IjoxNTcxMjI1MzI2LCJleHAiOjE1NzEyNDI2MDZ9.jOpNBe_UkzGTI3pDe7NE6nL2UNtlrm2kJ5UyvE1W4BU"
- The Radar Index
- A Radar by ID
- Create a Radar
label, theme, seet_to, seed_from, quadrant0_label, quadrant1_label, quadrant2_label, quadrant3_label, ring0_label, ring1_label, ring2_label, ring3_label, dot_offset_x, dot_offset_y
- Update a Radar
label, theme, seet_to, seed_from, quadrant0_label, quadrant1_label, quadrant2_label, quadrant3_label, ring0_label, ring1_label, ring2_label, ring3_label, dot_offset_x, dot_offset_y
- Delete a Radar
- All Datasets of a Radar
- A Dataset by ID from a Radar
- Create a Dataset
name
- Update a Dataset
name, radar
- Delete a Dataset
- All Dots of a Dataset
- A Dot by ID
- Create a Dot
label, radar, version, quadrant, ring, active, moved, boost
- Update a Dot
label, radar, version, quadrant, ring, active, moved, boost
- Update a Dot
- Export all Data as Zip-File