4th Practical Class:
Hello, Project Server!
General Info
- Each team member will receive email with SSH access to team project user on server.
- one team project username with one password is shared in team
- Only difference from your normal SSH user is that project is located in different folder:
- normal user:
~/code/cviceni
- team project user:
~/code/project
- normal user:
Project Template
- There is an initial project template set for you in
~/code/project
when you SSH to team project user- please use it as initial project template
- you can edit most of the code, but server is expecting some basic folder structure and some configuration
- your server may break if you:
- rename or delete
frontend
/backend
folders - change some scripts / config in
package.json
files- installing NPM dependencies is ok ;)
- remove some
.env*
files - (take more caution when editing those files)
- rename or delete
- your server may break if you:
- You can use SSH or Atom to edit the team project code, but suggested method is:
- create team repo on some git hostin (e.g. Github/Bitbucket/GitLab/...)
- push generated project template to empty repo on git hosting
- each team member is working locally on clone of the repo
- contributions to project are done using Pull Requests
- you update team project on server using
git pull
frommaster
/develop
branch
Production Builds / Update Server
- To create production build of frontend run
yarn build
infrontend
folder- open: http://frontend.
USERNAME
.vse.handson.pro/ to see production frontend (it's same URL, but withoutdev.
prefix) - production frontend is faster!
- open: http://frontend.
- To update backend server you have to run
yarn build
inbackend
folder- backend is always a production build (even with
dev.
prefix in URL)
- backend is always a production build (even with
Initial Project Installation
connect to server using team's SSH
run following commands:
connect to server using team project user and edit
~/code/project/backend/.env.local
- use
~/code/project/backend/.env
file as basic template - don't chagen
PORT
value in.env.local
(it may break the server)
- use
in
~/code/project/backend/.env.local
set:JWT_SECRET
with some random stringDB_NAME
,DB_USER
, andDB_PASSWORD
with values you received in team email
example
.env.local
:
run following commands:
open:
- http://dev.frontend.
USERNAME
.vse.handson.pro/ - http://dev.backend.
USERNAME
.vse.handson.pro/ - (replace
USERNAME
with your team username)
- http://dev.frontend.