Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

01 ‐ Project Setup

Leonard Huth edited this page Jul 19, 2023 · 7 revisions

Install Nodejs

Node Version Manager (NVM) is a convenient tool that enables you to manage multiple versions of Node.js on your system. In this guide, we'll walk you through installing Node.js version ⚠⚠ 16.14.0 ⚠⚠ using NVM on various systems.

Linux (Ubuntu)

  • Open your terminal.
  • To download and install NVM, run the following command: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
  • After the installation completes, close and reopen your terminal.
  • Source your shell configuration file: source ~/.bashrc
  • Verify the installation by running: nvm --version
  • To install Node.js 16.14.0, run the following command: nvm install 16.14.0
  • Verify that the installation was successful by checking the version: node --version

Windows

  • Visit the NVM for Windows GitHub repository
  • Download the latest 'nvm-setup.zip' file from the 'Assets' section.
  • Extract the ZIP file and run the 'nvm-setup.exe' executable to start the installation process.
  • Follow the installation wizard, and after completing the installation, restart your computer.
  • Open a Command Prompt or PowerShell window and verify the installation by running: nvm version
  • To install Node.js 16.14.0, run the following command: nvm install 16.14.0
  • Verify that the installation was successful by checking the version: node --version

MacOS

  • Open your terminal and run curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
  • After the installation completes, close and reopen your terminal.
  • Verify the installation by running: nvm --version
  • To install Node.js 16.14.0, run the following command: nvm install 16.14.0
  • Verify that the installation was successful by checking the version: node --version

Install Yarn

Yarn is a popular package manager for JavaScript projects that provides an alternative to npm. In this guide, we'll walk you through installing Yarn on Windows, macOS, and Ubuntu.

npm install --global yarn

Alternatives

Linux (Ubuntu)

  • Open your terminal.
  • Configure the Yarn repository and import the repository's GPG key by running: curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  • Update the package list and install Yarn: sudo apt-get update and sudo apt-get install yarn
  • Verify the installation by running: yarn --version

Windows

  • Visit the Yarn official website
  • Download the latest 'Yarn-1.xx.x.msi' file (replace 'xx' with the version number).
  • Run the downloaded 'Yarn-1.xx.x.msi' installer and follow the installation wizard.
  • After completing the installation, restart your computer.
  • Open a Command Prompt or PowerShell window and verify the installation by running: yarn --version

MacOS

  • Open your terminal.
  • If you don't have Homebrew installed, run the following command to install it: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Install Yarn using Homebrew: brew install yarn
  • Verify the installation by running: yarn --version

Install MongoDB

Please follow the official guide

Clone and start projects

  • Clone the Git repository by running the following command in your terminal/command prompt:
    git clone [email protected]:LeHuth/mmt-frontend.git and git clone [email protected]:LeHuth/mmt-backend.git
  • Navigate into the cloned repository by running the following command in your terminal/command prompt:
    cd <repository_name>
  • Install the project's dependencies using Yarn by running the following command in your terminal/command prompt:
    yarn install

Start the Frontend

  • Open your terminal/command prompt and navigate to the root directory of the cloned repository.
  • add a .env file to the root of the directory with the following entries:
  • Run yarn dev

Start the Backend

  • Open your terminal/command prompt and navigate to the root directory of the cloned repository.
  • add a .env file to the root of the directory with the following entries:
    • MONGO_URI=your-mongo-key
    • PORT=8080
    • JWT_SECRET=secret-jwt-key
    • GC_KEY_FILE=
    • STRIPE_SECRET_KEY=
    • STRIPE_PUBLIC_KEY=
    • MAILTRAP_API_KEY=
    • BASE_URL=
    • STRIPE_WEBHOOK_SECRET=
  • Run yarn dev

⚠⚠ .env file is required to run the project! ⚠⚠

Available commands

Frontend

  • yarn dev (default development mode)
  • yarn build
  • yarn run
  • yarn start
  • yarn generate

Backend

  • yarn start
  • yarn test
  • yarn dev (default development mode)
  • yarn swagger-autogen