No description
Find a file
2023-04-03 12:27:47 +02:00
.github/workflows Setup application deployment via gcloud CLI 2023-04-02 23:19:49 +02:00
api Add comments 2023-04-01 12:40:30 +02:00
env Use prod environment by default in the docker image 2023-04-03 12:27:47 +02:00
src Test setup and budget service unit test 2023-04-02 00:31:41 +02:00
terraform Terraform update 2023-04-02 00:31:05 +02:00
.dockerignore Introduce Dockerfile for containerizing the application 2023-03-22 13:02:32 +01:00
.eslintrc Add initial app with use case 2023-03-14 23:38:19 +01:00
.gitignore Add initial app with use case 2023-03-14 23:38:19 +01:00
cloudbuild.yaml Build and test the application in a CI pipelines 2023-04-02 23:18:34 +02:00
docker-compose.yml Use prod environment by default in the docker image 2023-04-03 12:27:47 +02:00
Dockerfile Use prod environment by default in the docker image 2023-04-03 12:27:47 +02:00
package.json Test setup and budget service unit test 2023-04-02 00:31:41 +02:00
README.md Document GitHub secrets creation for the CI/CD pipelines 2023-04-02 23:20:56 +02:00
tsconfig.json Migrate to CommonJS 2023-03-27 10:06:28 +02:00
tsconfig.prod.json Add initial app with use case 2023-03-14 23:38:19 +01:00
yarn.lock Test setup and budget service unit test 2023-04-02 00:31:41 +02:00

Contributors Forks Stargazers Issues LinkedIn


My Finance Pal

Example Typescript Node.js webserivce showcasing best practices in software development
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started

About The Project

This is a standalone best practice web application developed for an engineering bootcamp for a lecture at the Technical University of Munich.

Please bear in mind that also this is not a perfect version of an application as one would imagine it running in production in a real world scenario. However, we tried to incorporate as many best practices as possible, but as few as needed to get students, who are on a beginner level, started. The goal is to have this is a toolbox for developing a state-of-the art Node.js Typescript business application.

Don't take everything we do in this application literally. It is important to also always think for yourself and consider which of the presented techniques and frameworks you actually need for your use case!

At the end, we hope that this helps you on your journey on becoming an amazing software developer and we hope you have fun exploring the universe of backend engineering :)

Disclaimer: A lot of the standard Node.js/Express code was to some parts inspired, to some copied over from PracticaJS. Please have a look at their work and examples as it gives you a great starting point and references when it comes to best practices with Node.js development. Also have a look at the Express Typescript Generator, which we also used to create the initial setup of our app.

(back to top)

Built With

This section should list any major frameworks/libraries used to bootstrap your project. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.

  • NodeJs
  • Express.js
  • Typescript
  • MongoDB
  • Jest

(back to top)

Getting Started

In order to be able to start the service locally, follow these required steps.

Prerequisites

Needed toolings and frameworks you should install before building the project:

  • Node.js (if not already installed)

  • Update npm

    npm install npm@latest -g
    
  • Yarn

    npm install yarn -g
    
  • GitHub CLI (optional but recommended)

    brew install gh
    

Installation

  1. Clone the repo

    git clone https://github.com/ungaralex/my-finance-pal-backend.git
    
  2. Install NPM packages

    yarn install
    

Run Locally

To run/debug the service locally in dev mode, only the following is needed:

  1. Start the mongo service of the docker-compose file

     docker-compose up -d mongo
    
  2. Start the my-finance-pal service.

    yarn dev
    

The service now runs on port 3000 and listens to requests

(back to top)

CI/CD Pipelines Using GitHub Actions

Authenticating to GCP using a Service Account Key

TODO: add details

Populating Secrets

The GCP service account key need to be stored as a secret in the GitHub repo. Alongside, we store a few other GCP-related configuration values, such as project ID and region. Secrets can be accessed in the GitHub Actions workflows.

We advise using gh to create the secrets:

gh secret set GCP_PROJECT_ID --body '<gcp_project_id>'
gh secret set GCP_REGION --body '<gcp_region>'
gh secret set GCP_SA_KEY --body $(cat <gpc_service_account_key.json> | base64)