Skip to main content

Backend Installation

Installation process

Local Backend Installation Process

Step 1:

  • Before running this project on your local development server, ensure Node.js is installed in your local environment. If you haven't installed Node.js yet, visit the official Node.js website to download and install it. Run the following command in your terminal to check if Node.js is installed: node --version

Step 2:

  • We need Firebase admin credentials to access Firebase services. For this -
  1. Create a new project in the Firebase Console
  2. Navigate to Project Settings
  3. Go to Service Accounts tab
  4. Select Firebase Admin SDK
  5. Choose Node.js
  6. Click "Generate new private key"

Installation

  • Open the Firebase admin credentials JSON file using a text editor, then copy its entire content, including the curly braces.
  • Now go to the "Car2go-pro Backend" folder and you will find a file named firebase.json, under the directory of src -> app -> utils -> firebase.json.
  • Open this file and paste the copied content into the file and save it.

Step 3:

  • We require Redis for caching and real-time task management. To install Redis, follow the official installation guide based on your operating system:
  1. Redis Installation Guide
  2. After successfully installing Redis, open your terminal and run the following command to check if the Redis server is running:
  3. redis-cli ping
  4. it will return "PONG" if the server is running.

Step 4:

  • Install the project package management tool, yarn, by running the following command in your terminal:
  1. npm install --global yarn
  2. After successfully installing the Yarn package, verify the installation by checking its version using the following command:
    yarn --version
    If the installation is successful, it will display a version number, such as: 1.22.19

Step 5:

  • Congratulations! You have completed the initial setup. Now, install the required project dependencies by running the following command in your terminal:
  1. yarn install
  2. yarn build
  3. yarn start:prod

success

For the initial setup, you need to create an admin account and provide the necessary information through the frontend.

  1. Run your both backend and frontend server.
  2. Open your browser and navigate to the frontend URL (e.g., http://localhost:3000).
  3. Enter the required details and click the "Submit" button.
  4. Once you receive a success message, restart the backend server.

Your server is now ready for use.