Voluntier is a mobile app developed by Northcoders Students as the final project of the Software Development Bootcamp. The app connects volunteers with charity organisations that need help.

This is the backend API component of the project.

Developers who worked on the project:

Tomasz, Lia, Tom, Joseph, Matt, Joy

Take a look at the frontend repo


Tech Stack

Typescript, Node-postgres, Express.js, PostgreSQL.


Installation & Running the App

Requirements

For installation, you will need to have the following applications installed:

Clone the repository

  • Make a new directory and clone the repository by running the command:

    git clone https://github.com/Joseph-Lee98/be-voluntier.git

Setup .env files and install dependencies

Available environment variables

  • PGDATABASE

    Database name.

    For example: PGDATABASE=voluntier_db

  • LOGL

    Log level. Can take values debug, info, error.

    For example: LOGL=debug

    Note: If you would like to remove log messages, set the level to error.

  • SECRET_KEY

    JSON Web Token (JWT) secret key

    For example: SECRET_KEY=keyboard-cat

Instructions

  1. Add a .env.development file to your root directory.

    For example:

    PGDATABASE=voluntier_db
    
    LOGL=debug
    
    SECRET_KEY=keyboard-cat
    
  2. Add a .env.test file to your root directory.

    For example:

    PGDATABASE=voluntier_db_test
    
    LOGL=error
    
    SECRET_KEY=keyboard-cat
    
  3. Add a .env.production file to your root directory if you are planning on hosting the API.

    For example:

    PGDATABASE=voluntier_db
    
    DATABASE_URL=postgres://username:password@db-hostname:5432/voluntier_db
    
    LOGL=error
    
    SECRET_KEY=keyboard-cat
    
  4. npm install

Setup database

  1. Set up the psql databases:

    npm run setup-dbs

  2. Compile the project:

    npm run build

  3. Seed the database:

    npm run seed

Running

  1. Compile the project:

    npm run build

  2. Run the project:

    npm start

Testing

Note: When testing for the first time, execute npm run prepare to initialise husky.

Run all the test suites

npm test