muneeb706 / notion-sample-integration

Sample proejct to understand Notion integration into Monolith React and Django application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notion Sample Integration

Sample project to understand how notion can be integrated into Monolith React and Django application.

Testing

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

Pre-requisites

  1. Create public integration in Notion to integrate with django-allauth.
  2. Create internal integration in Notion to invoke Database query API.
    • Connect this integration with your Notion database.

Configuration

  1. Update SOCIALACCOUNT_PROVIDERS settings with client id and secret.
  2. Update NOTION_READING_LIST_DB_ID with database id.
  3. Update NOTION_SECRET settings with internal integration token.

How to run this locally

  1. Clone this repo.
  2. Install requirements
    pip install -r requirements.dev.txt
    
  3. Migrate models
    python manage.py migrate
    
  4. Run
    python manage.py runserver localhost:8000
    

About

Sample proejct to understand Notion integration into Monolith React and Django application.

License:Apache License 2.0


Languages

Language:Python 42.2%Language:HTML 31.7%Language:TypeScript 24.3%Language:JavaScript 1.5%Language:CSS 0.4%