Documentation #8

Merged
H4CK3R-01 merged 3 commits from documentation into main 2022-03-17 22:50:40 +00:00
9 changed files with 2300 additions and 298 deletions

1
.gitignore vendored
View File

@ -1,6 +1,5 @@
.idea/* .idea/*
.env .env
.env.example
env env
Lib Lib
Include Include

View File

@ -5,9 +5,5 @@ MYSQL_DATABASE=
MYSQL_USER= MYSQL_USER=
MYSQL_PASSWORD= MYSQL_PASSWORD=
# Telegram bot api key
BOT_API_KEY=""
NEWS_API_KEY=""
# Flask secret key # Flask secret key
SECRET_KEY= SECRET_KEY=

41
api/README.md Normal file
View File

@ -0,0 +1,41 @@
# API
Aktienbot API
## Development
1. Create virtual environment `python -m venv venv env/Scripts/activate`
2. Install requirements `pip install -r api/requirements.txt`
3. Set environment variables (see list below)
1. Use `.env`-file in `api` directory like `.env.example`
2. Or set variables using `export` or `set` commands. (Windows `set`, Linux `export`)
4. Run api `python api/app.py`
## Environment variables
```
# Flask secret key
SECRET_KEY=
# MYSQL Connection
MYSQL_USER=
MYSQL_PASSWORD=
MYSQL_HOST=
MYSQL_PORT=
MYSQL_DATABASE=
```
## Docker
```
docker run -d \
--name aktienbot_api \
--hostname aktienbot_api \
--publish 80:80 \
--env "SECRET_KEY=" \
--env "MYSQL_USER=" \
--env "MYSQL_PASSWORD=" \
--env "MYSQL_HOST=" \
--env "MYSQL_PORT=" \
--env "MYSQL_DATABASE=" \
--restart unless-stopped \
registry.flokaiser.com/aktienbot/api:latest
```
or load environment variables from file by using `--env-file <filename>`

20
documentation/README.md Normal file
View File

@ -0,0 +1,20 @@
# Dokumentation
## API
- `api/openapi.json`
- OpenAPI-Dokumentation
- von APIFlask generiert
- kann in Postman importiert werden
- `api/postman.json`
- Postman Collection
## Database
- `database/structure_database.pdf`
- Relationales Modell der Datenbank
- `database/structure_database.uxf`
- Relationales Modell der Datenbank
- Source Datei des Modells
## Requirements
- `requirements/2022-03-15 Anforderungen an Projekt.pdf`
- Anforderungen an dieses Projekt

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
This is the database folder

View File

@ -0,0 +1,8 @@
# Telegram bot api key
BOT_API_KEY=
# News api key
NEWS_API_KEY=
# Flask secret key
SECRET_KEY=

View File

@ -1,6 +1,33 @@
## Local setup for telegram bot # Telegram bot
0. optional: build virtual env by ``python -m venv venv``
``env/Scripts/activate`` Aktienbot telegram bot
2. create .env and set API keys etc. (use .env.example as a layout)
3. install required libs via ``pip install -r ./telegram_bot/requirements.txt`` ## Development
4. run bot.py via ``python ./telegram_bot/bot.py`` 1. Create virtual environment `python -m venv venv env/Scripts/activate`
2. Install requirements `pip install -r telegram_bot/requirements.txt`
3. Set environment variables (see list below)
1. Use `.env`-file in `api` directory like `.env.example`
2. Or set variables using `export` or `set` commands. (Windows `set`, Linux `export`)
4. Run api `python telegram_bot/bot.py`
## Environment variables
```
# Telegram bot api key
BOT_API_KEY=
# News api key
NEWS_API_KEY=
```
## Docker
```
docker run -d \
--name aktienbot_bot \
--hostname aktienbot_bot \
--publish 80:80 \
--env "BOT_API_KEY=" \
--env "NEWS_API_KEY=" \
--restart unless-stopped \
registry.flokaiser.com/aktienbot/bot:latest
```
or load environment variables from file by using `--env-file <filename>`