Skip to content

Commit

Permalink
bayanat v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sjacgit committed Jul 2, 2024
1 parent 296c7f4 commit aa194cc
Show file tree
Hide file tree
Showing 559 changed files with 539,847 additions and 42,077 deletions.
21 changes: 20 additions & 1 deletion .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,23 @@ SECURITY_TWO_FACTOR_AUTHENTICATOR_VALIDITY=90
# Can be switched off in dev envs
SECURE_COOKIES=True

TESSERACT_CMD="/opt/homebrew/bin/tesseract"
# Logging
LOG_LEVEL=ERROR
LOG_DIR=logs
LOG_FILE=bayanat.log
LOG_BACKUP_COUNT=10

# Backups
# Backups of Bayanat's database can be taken on a
# specific interval set below. Backups can be stored
# locally or uploaded to an S3 bucket
BACKUPS=0
# set interval of backups every x days
BACKUP_INTERVAL=1
# local directory to store backups, default backups/
BACKUPS_LOCAL_PATH=''
# S3 settings, if active backups will be uploaded to S3 bucket
BACKUPS_S3_BUCKET=''
BACKUPS_AWS_ACCESS_KEY_ID=''
BACKUPS_AWS_SECRET_ACCESS_KEY=''
BACKUPS_AWS_REGION=''
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ enferno/media/*
*.xlsx
.aws
config.json
build
docs/source
!docs/source/index.rst
!docs/source/conf.py
!docs/source/intro.rst
backups/*
15 changes: 14 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,17 @@ After creating the test db, you can run the existing tests with
pytest
```

Tests define `pydantic` models to ensure the backend responses and frontend requests conform to expected database schema.
Tests define `pydantic` models to ensure the backend responses and frontend requests conform to expected database schema.

# Auto-Docs

Bayanat backend code is documented in ReStructured Text format (loosely following Google's guidelines).
To generate automatic documentation in html format, you can follow the following steps:
1. Make sure `sphinx` is installed on your system
2. Navigate to bayanat directory on terminal
3. Run `sphinx-apidoc -f -o docs/source enferno && sphinx-apidoc -f -o docs/source tests`
4. Run `sphinx-build -M html docs/source/ docs/build/`, you will see multiple warning messages on your terminal. Ignore them.
Following these steps, the html files generated will be available under `docs/build/html`
2 changes: 2 additions & 0 deletions backups/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
1 change: 0 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-r requirements.txt
pytest==7.4.4
pydantic==1.10.13
flask_pydantic==0.11.0
SQLAlchemy-Utils==0.41.1
pre-commit==3.5.0
Expand Down
4 changes: 3 additions & 1 deletion docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ services:
- '${PWD}/${ENV_FILE:-.env.test}:/app/.env:ro'
- 'bayanat_test_media:/app/enferno/media:rw'
- 'bayanat_test_imports:/app/enferno/imports:rw'
- 'bayanat_test_logs:/app/logs:rw'
command: [ "pytest" ]

volumes:
redis_test_data:
postgres_test_data:
bayanat_test_media:
bayanat_test_imports:
bayanat_test_imports:
bayanat_test_logs:
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading

0 comments on commit aa194cc

Please sign in to comment.