core/README.md

60 lines
967 B
Markdown
Raw Normal View History

2023-10-23 14:47:11 +00:00
# discoursio-core
2021-08-20 23:17:15 +00:00
2022-11-22 05:18:48 +00:00
- sqlalchemy
2021-08-20 23:17:15 +00:00
- redis
- ariadne
- starlette
2022-11-22 05:18:48 +00:00
- uvicorn
2021-08-20 23:17:15 +00:00
2022-11-22 03:11:26 +00:00
# Local development
2021-08-20 23:17:15 +00:00
2022-06-14 05:41:40 +00:00
Install deps first
2021-08-20 23:17:15 +00:00
2022-05-31 07:03:50 +00:00
on osx
2021-08-20 23:17:15 +00:00
```
2022-12-03 09:50:18 +00:00
brew install redis nginx postgres
2021-08-20 23:17:15 +00:00
brew services start redis
```
2022-05-31 07:03:50 +00:00
on debian/ubuntu
```
2022-08-09 10:17:31 +00:00
apt install redis nginx
2021-08-20 23:17:15 +00:00
```
2022-08-11 10:06:31 +00:00
Then run nginx, redis and API server
2023-11-27 08:12:42 +00:00
```shell
mkdir .venv
python3.12 -m venv .venv
poetry env use .venv/bin/python3.12
poetry update
2024-01-25 19:41:27 +00:00
poetry granian --no-ws --host 0.0.0.0 --port 8000 --interface asgi main:app
2022-06-14 05:41:40 +00:00
```
2023-11-22 16:38:39 +00:00
## Services
2021-08-20 23:17:15 +00:00
2023-11-22 16:38:39 +00:00
### Auth
2021-08-20 23:17:15 +00:00
2023-12-16 15:24:30 +00:00
Setup `WEBHOOK_SECRET` env var, webhook payload on `/new-author` is expected when User is created. In front-end put the header 'Authorization' with token from signIn query or registerUser mutation.
2022-05-31 12:19:05 +00:00
2023-11-22 16:38:39 +00:00
### Viewed
2022-11-27 08:19:38 +00:00
2024-01-23 01:03:15 +00:00
Set GOOGLE_ANALYTICS_TOKEN var to collect stats
2022-11-27 08:19:38 +00:00
2023-11-22 16:38:39 +00:00
### Seacrh
2023-10-15 18:27:44 +00:00
2023-11-22 16:38:39 +00:00
ElasticSearch
### Notifications
Connected using Redis PubSub channels
### Inbox
To get unread counter raw redis query to Inbox's data is used
### Following Manager
Internal service with async access to storage