Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Sep 2, 2024
1 parent 2ee520e commit 177fd68
Show file tree
Hide file tree
Showing 26 changed files with 592 additions and 88 deletions.
4 changes: 4 additions & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_workflows/*
_actions/*
_*
icons.sh
2 changes: 1 addition & 1 deletion docs/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ nav:
- Administrative Guide: guide-adm
- Development Guide: guide-dev
- Glossary: glossary/
# - Examples: stacks
# - License: license.md
- Tags: tags
- Links: links
14 changes: 14 additions & 0 deletions docs/components/hope/stack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Technology stack and platform
## Modern and robust technology stack

Our open-source software is crafted with a modern technology stack, designed for high performance, flexibility, and ease of contribution. We've thoughtfully selected technology stack that emphasizes scalability, security, and strong community support.

Our backend is powered by Python Django, providing a reliable and scalable foundation where both RESTful and Graph APIs are implemented for fast and easy data exchange and integrations with other parts of the HOPE ecosystem.

The frontend is built using React and HTML5 to create a responsive, dynamic user interface that delivers a seamless experience. The Database is PostgreSQL which provides efficient and reliable data storage.

The code is packaged using Docker so it can be shipped and reusable. We use Kubernetes and Helm charts for deployments to any environment.

We use GitHub for managing code and version control, along with the GitHub Actions for build pipelines for efficient and automated workflows.

Transparency and collaboration are at the core of our approach. Our entire tech stack is open-source and documented, making it easy for anyone to understand and deploy HOPE. Our mission is to build and foster an inclusive community where developers of all skill levels can contribute. Our technology stack embodies our commitment to building a product that is both innovative and accessible to the open-source community
6 changes: 4 additions & 2 deletions docs/components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ title: Hope (core)

# Ecosystem components

The whole ecosystem is composed by many different components each one available as one or more docker artefacts
HOPE is designed with a modular architecture, giving users the flexibility to customize and extend the platform according to their unique needs. It’s built to be scalable, adaptable, and interoperable, making it simple to integrate with other systems and platforms, ensuring smooth workflows and easy expansion as your needs grow.

The source code for HOPE is fully open-source and available for anyone to explore, contribute to, or customize. Our codebase is hosted on GitHub, making it easy to access, review, and collaborate on.

- HOPE (core)

- [HOPE](hope/index.md)
- [Aurora](components/aurora.md)
- [Kobo](components/kobo.md)
- [Payment Gateway](pg/index.md)
Expand Down
3 changes: 2 additions & 1 deletion docs/guide-adm/.pages
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
nav:
- ...
- Dependencies: dependencies.md
- Docker: docker.md
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions docs/guide-adm/hope/.pages

This file was deleted.

File renamed without changes.
14 changes: 13 additions & 1 deletion docs/guide-dev/.pages
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
nav:
- ...
- index.md
- setup.md
- pr.md
- lint.md
#
#arrange:
# - index.md
# - setup.md

collapse: true

toc:
baselevel: 1
67 changes: 67 additions & 0 deletions docs/guide-dev/contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Development Guide
---
# Development Guide

## Setup development environment


### Prerequisites

- This project uses PDM as package manager (see https://github.com/pdm-project/pdm).
- A Postgres DB v15+
- A Redis server
- An Elastic Search server


## Technology Stack

- Python
- Postgres
- Redis
- ElasticSearch


## To start developing:

### Pull Requests

Every pull requests should contain tests to coverage the functionality.

- Coverage of 95% on written lines is required in order to merge.
- Two reviews are needed before merging PRs


### Get started

1. Install [pdm](https://github.com/pdm-project/pdm#installation) amd create virtualenv
1. Crate virtual env
1. `pdm venv create`
1. Register the created venv for the project with
1. `pdm use`
1. Activate your venv
1. `pdm venv activate`
1. Check your environment
1. eg. $`python --version` -> see that it uses Python 3.12.*
1. eg. $`which python` -> see that it matches you python executable in the venv you have created: $```echo `pwd`/.venv/bin/python```
1. Install the package
1. `pdm install`
1. Setup PYTHONPATH
1. `export PYTHONPATH="$PYTHONPATH:./src"`
1. Check and configure your environment:
1. `./manage.py env --check` and configure the missing variables.
You can generate a list for your development environment with the command `./manage.py env --develop --config --pattern='export {key}={value}'`
1. Once the environment has been set up run the initial migrations
1. `./manage.py migrate`
1. Make sure to set up environment variables:
1. Test using runserver $`./manage.py runserver` and logging in the admin `http://locslhost:8000/admin`


### Code quality

To enhance readability of code and increase code standars we use the following
- pep8 - https://peps.python.org/pep-0008/
- flake8 - https://flake8.pycqa.org/en/latest/
- isort - https://pycqa.github.io/isort/
- black - https://black.readthedocs.io/en/stable/
- mypy - https://mypy-lang.org/
4 changes: 2 additions & 2 deletions docs/guide-dev/dod.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


1. Pull Request Reviewed by 2 Core Developers
2. Unit Test coverage 95%
2.
1. Unit Test coverage 95%
1. Co
75 changes: 5 additions & 70 deletions docs/guide-dev/index.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,7 @@
---
title: Development Guide
---
# Development Guide
We’re excited that you’re interested in contributing to HOPE!

## Setup development environment
Whether you’re a seasoned developer or new to open-source, your contributions
are welcome and appreciated. This guide will walk you through the process of
contributing and help you get started.


### Prerequisites

- This project uses PDM as package manager (see https://github.com/pdm-project/pdm).
- A Postgres DB v15+
- A Redis server
- An Elastic Search server


## Technology Stack

- Python
- Django
- Django REST Framework
- GraphQL
- Postgres
- Celery
- Redis
- ElasticSearch
- Kubernates


## To start developing:

### Pull Requests

Every pull requests should contain tests to coverage the functionality.

- Coverage of 95% on written lines is required in order to merge.
- Two reviews are needed before merging PRs


### Get started

1. Install [pdm](https://github.com/pdm-project/pdm#installation) amd create virtualenv
1. Crate virtual env
1. `pdm venv create`
1. Register the created venv for the project with
1. `pdm use`
1. Activate your venv
1. `pdm venv activate`
1. Check your environment
1. eg. $`python --version` -> see that it uses Python 3.12.*
1. eg. $`which python` -> see that it matches you python executable in the venv you have created: $```echo `pwd`/.venv/bin/python```
1. Install the package
1. `pdm install`
1. Setup PYTHONPATH
1. `export PYTHONPATH="$PYTHONPATH:./src"`
1. Check and configure your environment:
1. `./manage.py env --check` and configure the missing variables.
You can generate a list for your development environment with the command `./manage.py env --develop --config --pattern='export {key}={value}'`
1. Once the environment has been set up run the initial migrations
1. `./manage.py migrate`
1. Make sure to set up environment variables:
1. Test using runserver $`./manage.py runserver` and logging in the admin `http://locslhost:8000/admin`


### Code quality

To enhance readability of code and increase code standars we use the following
- pep8 - https://peps.python.org/pep-0008/
- flake8 - https://flake8.pycqa.org/en/latest/
- isort - https://pycqa.github.io/isort/
- black - https://black.readthedocs.io/en/stable/
- mypy - https://mypy-lang.org/
To start contributing please start [configuring your development environment](setup.md)
9 changes: 9 additions & 0 deletions docs/guide-dev/lint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Code quality

To enhance readability of code and increase code standards we use the following

- pep8 - <https://peps.python.org/pep-0008/>
- flake8 - <https://flake8.pycqa.org/en/latest/>
- isort - <https://pycqa.github.io/isort/>
- black - <https://black.readthedocs.io/en/stable/>
- mypy - <https://mypy-lang.org/>
11 changes: 11 additions & 0 deletions docs/guide-dev/pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# Pull Requests

Every pull request should contain tests to coverage the functionality,
only PR following below rules will be considered for merging:


- Coverage of 95% on written lines is required in order to merge.
- Two reviews are needed before merging PRs
- Pass all our [code quality checks](lint.md)
- Pull Request related to ticket must
36 changes: 36 additions & 0 deletions docs/guide-dev/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Setup
---

## Prerequisites

This project uses PDM as package manager (see https://github.com/pdm-project/pdm),
and relies on the following components:

- A Postgres DB v15+
- A Redis server
- An ElasticSearch server


## Get started

1. Install [pdm](https://github.com/pdm-project/pdm#installation) amd create virtualenv
1. Crate virtual env
1. `pdm venv create`
1. Register the created venv for the project with
1. `pdm use`
1. Activate your venv
1. `pdm venv activate`
1. Check your environment
1. eg. $`python --version` -> see that it uses Python 3.12.*
1. eg. $`which python` -> see that it matches you python executable in the venv you have created: $```echo `pwd`/.venv/bin/python```
1. Install the package
1. `pdm install`
1. Setup PYTHONPATH
1. `export PYTHONPATH="$PYTHONPATH:./src"`
1. Check and configure your environment:
1. `./manage.py env --check` and configure the missing variables.
You can generate a list for your development environment with the command `./manage.py env --develop --config --pattern='export {key}={value}'`
1. Once the environment has been set up run the initial migrations
1. `./manage.py upgrade`
1. Test using runserver $`./manage.py runserver` and logging in the admin `http://locslhost:8000/admin`
Binary file added docs/guide-user/_screenshots/pm/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/guide-user/_screenshots/pm/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/guide-user/_screenshots/pm/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/guide-user/_screenshots/pm/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/guide-user/_screenshots/pm/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 66 additions & 2 deletions docs/guide-user/program.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,70 @@
title: Program Module
---

# Program
# Program

![Image](_screenshots/program.png)
The Programme Management module is used for defining objectives and basic programme information to be matched with assistance records for reporting purposes. This module involves defining the framework within which all aspects of a humanitarian cash transfer can be created and managed. Creating a programme involves defining a programme name, code, duration, sector, scope, description, geographical area of implementation and frequency of payment. The Programme set up process also includes a step to assign Partners to the Programme. This step is optional and should only be used by country offices willing to “segregate” the view of partners or UNICEF sections to PII of a given programme (commonly referred to as Ringfencing). In this area Partner access can be restricted further by administrative areas. In case no ringfencing is required Partners would be assigned access to the whole business area.

#### Why is Programme Management Important?

Creating a programme in HOPE is the first step towards delivering assistance to beneficiaries in the form of interventions.

What Do I Need to Do Before Creating a Programme in Hope?

- Make sure the programme name is unique.
- Make sure the start and end date are correct.
- Know the allocated budget amount for the programme.
- Make sure your are familiar with the concept of programme data collection type

## How to setup a new Programme

#### Start

Select the ‘Programme Management’ tab in the legend, then select ‘Create Programme’

![Image](_screenshots/pm/1.png)

#### Provides infos

Fill in the required fields for the new Programme.

![Image](_screenshots/pm/2.png)


!!! note

The data collection type parameter defines the structure of beneficiary data used in the Programme.

1. Full Collection: Full individual data is collected. This type indicates that data has been collected for all of the household members. (Individuals with details collected = size of household).
1. Partial Individuals: Partial individual data collected. This type indicates that data has been collected for the Head of Household, collector, and at least one other individual. However, data collection has not covered every member of the household. (Individuals with details collected are less than the size of household).
1. Size only: Size only collected This type is assigned when only the size of the household (count of individuals) has been collected without collecting specific details about the household members.
1. Size/age/gender disaggregated: No individual data available. This data collection type is assigned when no data has been collected for any individual other than the head of the household.
1. Frontline Worker: This type is used for population where only individual information is collected to pay incentives for workers, and it can be named by the section implementing the programme.


#### Configure Partners

Upon clicking “Next”, the programme partners page will appear where you can select a programme partner from a drop-down list and grant access to the entire business area or limit access by administrative areas. Users are also able to assign more than one partner to a programme.

![Image](_screenshots/pm/3.png)

#### Complete setup

After clicking the save button, a page with the summary of the programme details will be displayed.

Three actions can occur in the Programme Details page:

1. To activate the programme, click on the activate button.
1. To change programme settings, click on the Edit button.
1. To remove the programme, click on the remove button. (Note that you can only remove a programme in draft status)

![Image](_screenshots/pm/4.png)

#### Activate the Program

After the programme is activated, the following actions can be performed on the programme:

1. Edit Programme: to update programme’s details.
1. Finish Programme: to deactivate the programme after it has been completed.

![Image](_screenshots/pm/5.png)
2 changes: 2 additions & 0 deletions docs/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

{{ gitsnippet('git@github.com:unicef/hope.git', 'LICENSE', '## Installation') }}
14 changes: 10 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,18 @@ theme:

plugins:
- alias
# - gen-files:
# scripts:
- gen-files:
scripts:
# - docs/_scripts/build_glossary.py
# - docs/_scripts/get_settings.py
- docs/_scripts/get_settings.py
- autorefs
- awesome-pages
- awesome-pages:
filename: .pages
collapse_single_pages: true
strict: false
order: asc
sort_type: natural
order_by: title
- ezglossary:
templates: docs/_theme/glossary
inline_refs: none
Expand Down
Loading

0 comments on commit 177fd68

Please sign in to comment.