Node.js webapp for administration of Team works at SSPBRNO
- Copy
docker-compose.sample.yml
todocker-compose.yml
- Edit ENV variables in
docker-compose.yml
- Copy
mongo-init.sample.js
tomongo-init.js
- Edit database credentials in
mongo-init.js
- Copy
emails.sample
toemails
- Start containers with
docker-compose up -d
docker run -d --network host --restart=always --env COOKIE_MAX_AGE=86400000 --env PORT=3000 --env PROTOCOL=http --env URL="teamwork.local" --env REDIS_URL="redis://localhost:6379" --env SESSION_SECRET="randomString" --env SMTP_HOST="mail.local" --env SMTP_PASS="strongPass" --env SMTP_PORT="465" --env SMTP_SECURE=true --env SMTP_USER="[email protected]" --env MONGODB_PORT=27017 --env MONGODB_HOST="localhost" --env MONGODB_NAME="teamworks" --env MONGODB_USER="teamworks" --env MONGODB_PASS="strongPass" --env MONGODB_OPTIONS="" --env CONTACT_PERSON_EMAIL="[email protected]" index.docker.io/lukynmatuska/sspbrnoprojectsweb:master
git clone [email protected]:matuska.lukas/teamwork-sspbrno.git
https://gitlab.com/matuska.lukas/teamwork-sspbrno.git
cd teamwork-sspbrno && npm i
use teamworks;
db.createUser({user: 'teamworks', pwd: 'veryStrongPassword', roles: [{role: 'readWrite', db: 'teamworks'}]});
cp config.sample.js config.js
Edit settings in yourconfig.js
or in ENV variables (seeapp.js
)
cp -rvf emails.sample emails
Not supported, but you can try it...
- Email:
[email protected]
- Password:
purkynkaIsHappy
.
├── app.js (Entry point of app)
├── config.js (Configuration data, connection to db, etc.) or ENV variables
├── controllers (Controllers - heart of app, carrying out individual activities as such)
├── emails (Emails - folder for email templates)
├── libs (Libraries - external libraries, which aren't in npm or own solution like connection to db)
├── models (Database models, ex. User, Ticket, Car, ...)
├── routes (Routers paths, call funcions by URL from controllers)
├── static (Static files)
│ ├── css
│ ├── images
│ └── js
└── views (Part of pages for render)
└── partials (Repeating parts of pages – header, menu, ...)
Node.js express waits for HTTP requests which are afterwards processed by their respective routers
which lead to controllers
that execute the main code.
You must use reverse proxy server (like nginx) if you want run this in production enviroment with safe HTTPS.