Git Product home page Git Product logo

notas's Introduction

Notas

Simple markdown based note-taking app for introverts.

Explain side project, collaborative effort for learning, Python, Full-stack, Azure...

Here's a very high level overview of the system architecture.

     ┌─────────────────┐        ┌───────────────────┐
     │   App Service   │     ┌─>│ Cosmos DB (Mongo) │  
     │ ┌─────────────┐ │     │  └─────────┬─────────┘
     │ │    Notas    │ │     │            │
     │ │  Starlette  │ │     │  ┌─────────V─────────┐
  ┌──┴─┴───┐     ┌───┴─┴─┐   │  │  Azure Functions  │
  │ Svelte │<───>│  API  │<──┘  └─────────┬─────────┘
  │  SPA   │     │       │<──┐            │ 
  └──┬─┬───┘     └───┬─┬─┘   │  ┌─────────V─────────┐
     │ └─────────────┘ │     └──┤     Redis Index   │
     └─────────────────┘        └───────────────────┘
  • App Service runs the backend API and frontend SPA
  • Cosmos DB is where all notes are stored
  • Azure Functions are triggered on create/update to tokenize and index a note to Redis
  • Redis stores the inverted index of note, providing ability to search through the note contents

Quick Start

Prerequisites

Install, Build, Start and Test

Make sure you are at the project root directory and prerequisites above are satisfied.

Frontend App

The frontend app can be built and served through the backend server or it can run independently. The second method is ideal for development as it supports hot rebuilding and reloading of the app.

Build only and serve with backend server
npm install --prefix frontend
npm run build --prefix frontend

The build process will generate 3 files (bundle.css, bundle.js, and bundle.js.map) to frontend/public/static directory. From there, the build will copy frontend/public/static/* to backend/app/templates for serving with the backend app.

Build and run standalone with hot reloading (development mode)
npm install --prefix frontend
npm run dev --prefix frontend

The frontend server will start at http://localhost:5050. All calls from the frontend app to /api will be proxied to the backend server at http://localhost:5000/api.

Backend App

# Create the virtualenv
python -m venv .venv

# Activate virtualenv
source .venv/bin/activate

# Install pip-tools, and dependencies
(.venv) pip install pip-tools
(.venv) pip-compile backend/requirements.in      # generates backend/requirements.txt if it didn't exists
(.venv) pip-compile backend/requirements-dev.in  # generates backend/requirements-dev.txt
(.venv) pip-sync backend/requirements.txt backend/requirements-dev.txt

# Start the server
(.venv) python -m backend.application

The backend server will start at http://localhost:5000

Running Tests

(.venv) python -m pytest backend/tests

notas's People

Contributors

ikumen avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.