Large System Development, fall 2020
Stephan Duelund Djurhuus
- Backend, Handles Database Management.
- Frontend, Handles REST API and Server Sided Rendering.
- Contract, Handles Contract Interface & Data Transfer Objects.
- Project Wiki, Assignments & Descriptions
# bash
yarn install
If the contract isn't installed add it with yarn.
# bash
yarn add Fraqs/LSD-Project.Contract
Create a .evn
file in the root of the project containing the content below.
NODE_ENV=development
RPC_HOST=http://localhost:3000
src ┐
├ contract/ # the rpc contract and contract mock.
├ routes/ # the views route and api route.
├ views/ # ejs views.
├ static/ # static files for ejs - scripts, styles and images.
├ test/ # test files.
└ index.ts # main file.
... # configuration files
This frontend application uses to main routes, one for generated EJS Views
and the another for a REST API
.
Target | Route |
---|---|
EJS Views | http://localhost:4000 |
REST API | http://localhost:4000/api |
changing the port in .evn will result in different routes.
The development environment uses a ContractMock
. This is used when the backend isn't connected to the frontend.
Development environment can be set in the
.evn
asNODE_ENV=development
.
# bash
yarn dev
The production environment uses the RPC Contract. This is used when the backend is connected to the frontend.
Production environment can be set in the
.evn
asNODE_ENV=production
.
# bash
yarn start
The test is handled by the test framework Jest.
# bash
yarn test
Software Development @ Copenhagen Business Academy, Denmark 2020