Giter Club home page Giter Club logo

foodbank-southlondon's Introduction

FoodBank - South London

Contents

Overview

This codebase contains the frontend and backend of a simple website. It is designed to simplify the process for tracking the status of food parcels for clients in FoodBank, South London. The website enables users to check status, print various documents & labels and update status information for clients that food parcels are being prepared for / delivered to. The website application is stateless and all data is stored in protected Google Sheets. More information, for those who have access, can be found in the shared Google Drive.

Setup

The application can be installed and ran locally for development or deployed and ran in a Docker container for production. This application uses makefiles. If you've done this kind of thing before, type make from inside the root directory or backend or frontend directories to see available options and help messages.

Development

When running locally, you have two options:

  1. Run the frontend and/or backend separately - most useful when doing highly iterative development on a particular part.
  2. Build the frontend static files and just run the backend - most useful when doing development that affects the integration of the frontend and backend, or for testing.

Prerequisites

  • Install Make - Mac (builtin in Xcode) | Ubuntu (builtin)
  • Install NodeJS & npmjs - Mac | Ubuntu
  • Install Python 3.8 - Mac | Ubuntu (python3.8 python3.8-dev python3.8-venv)
  • Install Git - Mac (builtin in Xcode) | Ubuntu (builtin)
  • Install WeasyPrint's Dependencies - All Platforms
  • Clone this repository

Installation

To install both the frontend and backend dependencies, run the following command inside the repository root directory:

make install

Note: to install dependencies for only the frontend or backend, you can run the same command from inside the frontend or backend directories.

Run Locally

To run both the frontend and backend applications, run the following command from inside the repository root directory:

make run

Note: to run just the frontend or backend applications, you can run the same command from inside the frontend or backend directories.

Production

To install the application in a production environment, you need a different set of prerequisites and there is no installation step as it is covered as part of the run step.

Prerequisites

Run Locally

To build the docker image and run a container locally with the latest version tag, run the following command from inside the repository root directory:

make docker

Run in Production

The production application is hosted by Heroku. You must meet the following pre-requisite as well as being able to login to Heroku:

To make the application available for deployment in Heroku, run the following command from inside the repository root directory:

make dist

Once pushed, you can manage the deployment from the Heroku Dashboard.

Environment Variables

The following two variables can be set as you would normally set environment variables OR you can store them in a file called development.env or production.env inside the backend directory and they will be excluded from source control.

  • FBSL_CLIENT_SECRET - the Google Cloud Platform OAuth 2.0 Client Secret that has domain-wide delegation and permission to query the GSuite Admin SDK
  • FBSL_SA_KEY - the Google Cloud Platform service account key that has permission to the google sheets data storage

Note: FLASK_ENV is set automatically by make run / make deploy - it is vitally important that this variable is set before the application runs (i.e. cannot be inside a .env file).

Contributing

To contribute, please pull from master, work on a feature branch and then raise a pull request to merge into master. The pull request requires an approval before it can be merged.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.