Skip to content

projekt-fitnessapp/backend

Repository files navigation

backend

TOC

Links

Hosting: https://api.fitnessapp.gang-of-fork.de/
API-Documentation: https://projekt-fitnessapp.github.io/backend-docs/
Prod-Logs: https://api.fitnessapp.gang-of-fork.de/admin/resources/LogEntry
Test coverage report: https://projekt-fitnessapp.github.io/backend/


Development

Prerequisite

Place .env file in project root folder. It must contain the following variables:

PORT=[Your Port]
DB_URL=[Your DB Url]

Commands

Install:

npm install

Build:

npm run build

Run:

npm run start

Run with watch:

npm run devstart

Test:

npm run test

Test with coverage:

npm run coverage

Lint:

npm run lint

Repository Structure

  • src/
    • (app.ts and server.ts) Here you find the express server implementation
    • helpers/
      • Here helper functions are implemented for tests, logs and development.
    • middleware/
      • Here you find the implementation for logging and authentication middlewares.
    • routes/
      • Here you find another directory for each specific route.
        • Each consists of a Controller file (where the handlers for each http-Methods are implemented) and Router file (where the routes will be defined).
      • routes.ts
        • Summarizing each nested router into one router.
  • test/
    • For each route a respective nested directory with a test file is created.
    • Each helper file with testable functions has a file with tests nested in helpers/.
    • server.test.ts specifies tests for the server.ts file.

Why express, mocha and chai?

We use express because it is one of the most used backend web framework and a nodejs module. Mocha and Chai are easy to implement test-frameworks.

About

ENV VARS MAINTAINED IN INFRASTRUKTUR REPO ONLY

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages