Me-page for the course "ramverk2" at Blekinge Tekniska Högskola
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci
content
data/db
docker
public
routes
src
test
views
.eslintignore
.eslintrc.json
.gitignore
.nycrc
.scrutinizer.yml
.stylelintignore
.stylelintrc.json
Makefile
README.md
app.js
docker-compose.yml
package-lock.json
package.json

README.md

Me-page for the course "ramverk2" at BTH

  • Circle CI CircleCI

  • Code Climate Maintainability

  • Scrutinizer Build Status Scrutinizer Code Quality Code Coverage

Me-page for the course "ramverk2" at Blekinge Tekniska Högskola.

The page is built using JavaScript and has a Express.js server for the back-end. Pages are renderd by the server using Handlebars templating engine. Some content is written in markdown files and parsed into the page.

The chat page uses WebSockets for real-time communication and the "Biblioteket" page uses a MongoDB to store the data used for showcasing CRUD. For the CRUD functionality I have developed a npm module "mongo-crud-simple" that handles the communication agains the database.

Testing is done through Mocha and linting and codestyle analysis is done with ESLint and Stylelint. During development Continuous Integrationi with CircleCI and Scrutinizer has been used test each commit and build.

Tech stack

  • Express.js server
  • Handlebars templating engine
  • Markdown support
  • Testing with Mocha
  • WebSocket
  • MongoDB
  • Docker

Setup

  1. Clone the repo
$ git clone https://github.com/almrooth/ramverk2.git
  1. Install dependencies
$ npm install
  1. Run server
$ npm start
  1. Open in browser http://localhost:1337

Testing

Tests available for app:

  • eslint npm run eslint
  • stylelint npm run stylelint

To Run all tests

npm test

Docker

The app can be run in Docker. (docker & docker-compose required)

To start the containers:

$ npm run start-docker

Stop the containers:

$ npm run stop-docker

Testing in docker Testing of the app can be done in 3 different docker containers each using a different version of node.

Latest version of node:

$ npm run test-docker-latest

Node version 8:

$ npm run test-docker-8

Node version 7

$ npm run test-docker-7

Ports and environment variables

Express server

By default the server will start on port 1337. If you wish to use another port set env variable DBWEBB_PORT.

MongoDB

By default the server will connect to DSN mongodb://127.0.0.1:27017/ramverk2. If u wish to use another database DSN set env variable DBWEBB_DSN.