Sample project to understand how notion can be integrated into Monolith React and Django application.
-
Login and Register with Notion is implemented using django-allauth package.
-
Notion query database API is integrated to fetch all pages within given database.
Cypress is used for e2e frontend testing and Django tests pacakge is used for testing backend.
Testing is automated via GitHub Actions and code coverage report is integrated with Codecov
To run test with Cypress enter following command in core/static/core directory:
yarn cy:run-e2e
For Django tests:
coverage run manage.py test core/tests
- Create public integration in Notion to integrate with django-allauth.
- Create internal integration in Notion to invoke Database query API.
- Connect this integration with your Notion database.
- Update SOCIALACCOUNT_PROVIDERS settings with client id and secret.
- Update NOTION_READING_LIST_DB_ID with database id.
- Update NOTION_SECRET settings with internal integration token.
- Clone this repo.
- Install requirements
pip install -r requirements.dev.txt
- Migrate models
python manage.py migrate
- Run
python manage.py runserver localhost:8000