Skip to content

Latest commit

 

History

History
88 lines (72 loc) · 2.17 KB

File metadata and controls

88 lines (72 loc) · 2.17 KB

Installing for development

WARNING! DO NOT USE THIS DEPLOYMENT IN A PRODUCTION ENVIRONMENT!

This document describes installation steps required to install locally for development.

Preparing environment

  • Install nodejs (>=18)
  • Install python and python-dev (>=3.11)
  • Install and start postgresql (>=15)
  • Install libreoffice
  • Create a postgresql database and user:
    sudo -u postgres createuser -Pds multilateralfund && sudo -u postgres createdb --encoding=UTF8 multilateralfund
  • Create readonly postgres user (run in pstgres shell):
CREATE USER <READONLY_USER> WITH PASSWORD '<READONLY_PASSWORD>';
GRANT CONNECT ON DATABASE <POSTGRES_DB> TO <READONLY_USER>;
GRANT USAGE ON SCHEMA <schema_name> TO <READONLY_USER>;
GRANT SELECT ON ALL TABLES IN SCHEMA <schema_name> TO <READONLY_USER>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT SELECT ON TABLES TO <READONLY_USER>;
  • (Recommended) create and activate a python virtualenv
  • Clone this repository

Installing Backend for development

  • Configure local settings, starting from the dev example
    cp .env.example .env
  • Install dependencies
    pip install -c requirements-dev.txt
  • Run migrations
    ./manage.py migrate

Installing Frontend for development

  • Change directory to the frontend directory
    cd frontend
  • Install dependencies
    npm install

Running the application

  • Start the backend with hot-reload

    ./manage.py runserver
  • Start the frontend with hot-reload (from frontend directory)

    cd frontend
    npm run dev
  • Check frontend is running correctly at http://localhost:3000

  • Check backend is running correctly at http://localhost:8000/admin/

Updating the application

  • Update the code with the latest version
  • Update third-party packages required at runtime.
    pip install -c requirements-dev.txt
  • Update frontend dependencies
    cd frontend && npm install
  • Run migrations:
    ./manage.py migrate

Where to go from here?

Check the development guide to help you get started.