Skip to content

almerk/js-fullstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JS fullstack app

It started as my first spa application on vue. I added express server for api calls emulation, moved client and server app to different containers and mongodb container to store some entities.

Client part is built using webpack and vue-cli and published to nginx server as static content. Server part uses nodejs + express server and mongoclient (without mongoose).

Scenarios

Server app requires running mongo container, and client app requires server app.

All these apps use configured .env file, which is not stored in this repo. To run this app you must create .env file like this

MONGO_PORT=27017
MONGO_DB=<db name>
SERVER_PORT=8087
SERVER_OUT_PORT=<Public accessible port for api endpoint>
MONGO_INITDB_ROOT_USERNAME=<db user>
MONGO_INITDB_ROOT_PASSWORD=<db password>
MONGO_HOSTNAME=calendariodb
SERVER_HOST=127.0.0.1

To build images run:

docker-compose build

and to start this app

docker-compose up

Meanwhile webclient should be accessible at http://localhost:80/

Entities

Server app provides fake api to these listed entities:

Relations domain

Entity Urls Fields Comments
#relations /relations?subjectId?=:&objectId?=: subjectId, objectId,

canRead,
canUpdate,
canDelete,
canCreateOf,
characteristics'owner','perfomer',''acceptor', etc.

Subjects domain

Entity Urls Fields Comments
#subjects /subjects/:id? id,
$type ('user' | 'group')
both groups and users together
#users /users/:id?, /users/:login? id,

login,
name,
surname,
patronymic,
groupId
#groups /groups/:id? id,

name, parentId[nullable]

Calendario objects domain

Entity Urls Fields Comments
#calendarTypes /calendarTypes/:id? id,

name
#calendarsextensible /calendars/:id? id,

typeId,
name,
...
typeId determines calendar type., This entity can be extended.
#calendarEventsextensible /calendarEvents/:id? id,
calendarId,
name,
dates
description, ...
this entity can be extended. The calendar type determines the type of event.

Calendario event date domain

Entity Urls Fields Comments
#datesextensible No url provided. These VO are included in calendarEvent entity eventId,
$type,
isExcept,
...
#dates$type=simpleDate - dateTime,
hasTime
#dates$type=continuousDate - start, end,
hasTime
#dates$type=reccurenceDate - hasTime,
rrule
#dates$type=continuousReccurenceDate - start, end,
hasTime,
rrule
occurence /dates/from/:start/till/:end eventId,
dateTime.value,
dateTime.hasTime
dateTime.belonging[nullable], status[nullable]
Event occurencies are calculated from dates

These entities are randomly generated when server app starts.

Cheatsheet

  • npm install -g vue-cli
  • vue init webpack-simple vue-spa
  • npm install --save-dev css-loader@1.0.1 (fixing high vulnerability in js.yaml)
  • npm install --save-dev webpack-dev-server@2.11.4
  • docker run -p:27017:27017 -d --env-file ../.env mongo:4.1.8-xenial