Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs #16

Merged
merged 1 commit into from
Oct 11, 2024
Merged

docs #16

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
!**/.pages
!.includes
_theme/.templates

__pycache__
4 changes: 2 additions & 2 deletions docs/components/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ nav:

- Aurora: aurora
- Kobo: kobo
- Deduplication: hde
- Country Report: reporting
- Payment Gateway: pg
- Country Report: reporting
- Deduplication: hde
- RapidPro: rapidpro
# - workspace.md
2 changes: 1 addition & 1 deletion docs/components/aurora/.pages
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nav:
- index.md
- setup.md
- setup
2 changes: 1 addition & 1 deletion docs/components/aurora/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ The strengths of Aurora are:

## Repository

<https://github.com/unicef/hope-aurora>
> Repo: <https://github.com/unicef/hope-aurora>
7 changes: 7 additions & 0 deletions docs/components/aurora/setup/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Setup HOPE integration

- Add aurora_token in the user
- Add aurora_server in the Constance Config
- Fetch data from Aurora
- Associate Organizations to Business Areas
- Associate Projects to Programmes
19 changes: 19 additions & 0 deletions docs/components/aurora/setup/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Build and use your docker

After you have cloned the repo, be sure to have a Reddis and PostgreSQL server running on your machine

export ADMIN_EMAIL=admin@example.com
export ADMIN_PASSWORD=password
export DATABASE_URL=postgres://postgres:@127.0.0.1:5432/aurora
export CACHE_URL=redis://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient

cd docker

make build run


## Use provided compose.yml

docker compose up

navigate to http://localhost:8000/admin/ and login using `admin@example.com/password`
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,39 @@ Prerequisites:

## Create virtualenvironment

2. Checkout code
1. Checkout code

```
git clone https://github.com/unicef/hope-aurora
git config branch.autosetuprebase always

```

1. In the shell:
2. In the shell:

```
pdm venv create
pdm use
pdm venv activate
```

1. Check your virtualenv is properly created
3. Check your virtualenv is properly created

```pdm info```


1. Install the package
4. Install the package

```
pdm install
pdm run pre-commit install
```


1. Add `export PYTHONPATH="$PYTHONPATH:./src"`
5. Add `export PYTHONPATH="$PYTHONPATH:./src"`


1. Check your environment:
6. Check your environment:

`./manage.py env --check` and configure the missing variables.

Expand All @@ -57,7 +57,7 @@ Prerequisites:

./manage.py env --develop --config --pattern='export {key}={value}'

1. Run upgrade command to properly initialize the application:
7. Run upgrade command to properly initialize the application:

`./manage.py upgrade --admin-email ${ADMIN_EMAIL} --admin-password ${ADMIN_PASSWORD}`

Expand All @@ -83,37 +83,3 @@ echo "unset PS1" >> .envrc
The first time after you have created or modified the _.envrc_ file you will have to authorize it using:

direnv allow

# Run

To start working with Aurora you can:


### Build and use your docker

After you have cloned the repo, be sure to have a Reddis and PostgreSQL server running on your machine

export ADMIN_EMAIL=admin@example.com
export ADMIN_PASSWORD=password
export DATABASE_URL=postgres://postgres:@127.0.0.1:5432/aurora
export CACHE_URL=redis://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient

cd docker

make build run


### Use provided compose.yml

docker compose up

navigate to http://localhost:8000/admin/ and login using `admin@example.com/password`


### Setup HOPE integration

- Add aurora_token in the user
- Add aurora_server in the Constance Config
- Fetch data from Aurora
- Associate Organizations to Business Areas
- Associate Projects to Programmes
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion docs/components/pg/.pages
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nav:
- index.md
- setup.md
- Setup: setup
- Western Union: wu
2 changes: 1 addition & 1 deletion docs/components/pg/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Each FSP can have a different way to interact with the payment gateway with thou

## Repository

Repo: <https://github.com/unicef/hope-payment-gateway>
> Repo: <https://github.com/unicef/hope-payment-gateway>


## HOPE / PG Integration API
Expand Down
1 change: 0 additions & 1 deletion docs/components/pg/setup.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/components/pg/setup/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nav:
- index.md
- virtualenv.md
- docker.md
1 change: 1 addition & 0 deletions docs/components/pg/setup/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Docker
Empty file.
37 changes: 37 additions & 0 deletions docs/components/pg/setup/virtualenv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Virtualenv


### System Requirements

- python 3.12
- [direnv](https://direnv.net/) - not mandatory but strongly recommended
- [pdm](https://pdm.fming.dev/2.9/)


**WARNING**
> Hope Payment Gateway implements **security first** policy. It means that configuration default values are "almost" production compliant.
>
> Es. `DEBUG=False` or `SECURE_SSL_REDIRECT=True`.
>
> Be sure to run `./manage.py env --check` and `./manage.py env -g all` to check and display your configuration



### 1. Clone repo and install requirements
git clone https://github.com/unicef/hope-payment-gateway
pdm venv create 3.12
pdm install
pdm venv activate in-project
pre-commit install

### 2. configure your environment

Uses `./manage.py env` to check required (and optional) variables to put

./manage.py env --check


### 3. Run upgrade to run migrations and initial setup

./manage.py upgrade

1 change: 1 addition & 0 deletions docs/components/reporting/.pages
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
nav:
- index.md
- setup
- glossary.md
- tmp.md
2 changes: 1 addition & 1 deletion docs/components/reporting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This components allows user to produce reports and keep them updated customizing

## Repository

<https://github.com/unicef/hope-country-report>
> Repo: <https://github.com/unicef/hope-country-report>


## Features
Expand Down
Empty file.
Empty file.
Empty file.
Loading