Skip to content

Back-End of our project for the class Web-Engineering II at DHBW-Stuttgart.

License

Notifications You must be signed in to change notification settings

WebII-hAPPy/happy-express-backend

Repository files navigation

hAPPy-API for the Web-Engineering II project

Welcome to the backend of the hAPPy project. This is a project done for the class 'Web-Engineering II' at the DHBW Stuttgart. This project is licensed with the MIT license.

Table of Contents

  1. Requirements
  2. Getting Started
  3. Architecture

Requirements

  1. Some commands may only work in a linux environment. Development using windows is possible, though not recommended.
  2. Running postgresql database (for configuration see ormconfig.json)
  3. Node package manager Yarn

Getting Started

Installation

git clone git@gitlab.com:WebII_hAPPy/hAPPy-backend.git
git cd happy-backend

Generate Secret Key and set environment variables with source.

node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"

Copy secret into app-env file

#file: app-env
export JWT_SECRET="{secret}"
export GMAIL_USER=""
export GMAIL_PASS=""
. ./app-env

Finally install packages with yarn

yarn install
yarn test
yarn start

Entities

Entities are the core of this application. Each entity describes a database table, its columns and their properties.

The database automatically synchronizes with the entities.

Each entity requires an id in form of a automatically generated integer.

Please refer to the TypeORM documentation for more information.

WARNING: Disable synchronization after first startup as unexpected errors may occur!

Controller

Controller are the interface between the internet and the this application. The controller methods will be called if you access an API endpoint.

Services

Services are the interface between the database and this application. They get, save, update and delete data in database.

Routes

Each API endpoint is described under src/routes.ts and the under the OpenAPI specification (openapi.yaml). The corresponding Express.js function will automatically be build by a wrapper in src/index.ts

Tests

Tests are written with Mocha and Supertest.

Each individual route shall have a test.

About

Back-End of our project for the class Web-Engineering II at DHBW-Stuttgart.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages