NoteCognition is a premium, local-first Markdown editor and note-taking platform. Live website: notecognition.netlify.app
It features real-time synchronization, offline availability, and a unique "Host-Your-Own-Data" architecture that allows users to deploy and run their own private backend on their personal AWS account with a single click.
- 🚀 Local-First Architecture: Built using Dexie.js (IndexedDB) to store all note contents and folder configurations directly on your device. The app operates with zero lag and works fully offline.
- ⚡ Real-Time WebSocket Sync: Incremental change sync via WebSockets. If you edit a note, it updates character-by-character on all other signed-in devices.
- 🛡️ Host-Your-Own-Data (1-Click AWS Deploy): Don't want your notes on someone else's server? Click the Cloud Host button in the app, download the CloudFormation template, and deploy it to your personal AWS account.
- 📝 Rich Markdown Editor: Support for split-pane live previews, toolbar shortcuts, inline asset attachments (drag-and-drop/paste images), and exports to
.mdfiles. - 💎 Premium Dark Mode Design: Sleek, modern interface using tailored HSL color systems, glassmorphism, responsive navigation trees, and micro-animations.
NoteCognition is divided into two distinct components: the Frontend client and the Serverless AWS Backend.
graph TD
A[React Frontend] -->|Local Storage| B[(Dexie.js / IndexedDB)]
A -->|WebSocket - Real Time| C[AWS API Gateway WebSocket]
A -->|REST - Pull & Auth| D[AWS API Gateway REST]
C -->|Handler Lambda| E[AWS Lambda Functions]
D -->|Auth & Sync Lambda| E
E -->|Manage Data| F[(Amazon DynamoDB Single-Table)]
A -->|Image Uploads| G[Amazon S3 Assets Bucket]
A -->|User Login| H[Amazon Cognito User Pool]
- IndexedDB Store: All files and folders are managed locally through Dexie.js.
- Sync Manager: Watches local IndexedDB changes using Dexie hooks and queues them for remote server upload. It handles connection dropouts gracefully, syncing pending changes when the internet returns.
- Authentication: Handled via
amazon-cognito-identity-jsdirectly communicating with AWS Cognito.
- Amazon Cognito User Pool: Manages secure user sign-ups, logins, and confirmation code email broadcasts.
- API Gateway (REST & WebSockets): Serves the REST sync endpoints (
/sync/pullAll,/sync/push) and hosts the WebSocket endpoint ($connect,$disconnect,$defaultroutes) for real-time broadcasts. - AWS Lambda: Serverless microservices managing auth authentication checks, incremental delta merges, and active connection socket broadcasts.
- Amazon DynamoDB (Single-Table Design): Stored in a single high-performance table (
notecognition-data-dev) optimized using Partition Keys (PK) and Sort Keys (SK):- Folders & Notes: Partitioned by parent ID and indexed by user ID.
- WebSocket Connections: Tracks active connection IDs to broadcast edits to active sessions.
- Amazon S3: Hosts note attachment uploads (images/assets) with public-read permissions restricted to the upload folder prefix.
Make sure you have Node.js installed.
- Clone or download the repository.
- Install dependencies:
npm install
- Start the Vite development server:
npm run dev
- Open http://localhost:5173 in your browser.
If you are a developer and want to deploy the default backend stack in your AWS account, we have included PowerShell scripts to automate the packaging and deployment.
- Open PowerShell in the root directory.
- Run the deployment script:
.\deploy.ps1
- Enter your AWS Access Key ID, AWS Secret Access Key, and preferred AWS Region (e.g.
ap-south-1) when prompted. - The script will package the Lambdas, create your bootstrap S3 bucket, deploy the CloudFormation template, and automatically generate your local
.envconfiguration file.
To wipe out the CloudFormation stack:
.\destroy.ps1If you are accessing the hosted website and want your data completely private:
- Click Cloud Host in the top navigation toolbar.
- Click Download CloudFormation Template to save the stack file (
notecognition-template.yaml) to your computer. - Click Open AWS CloudFormation Console to open your personal AWS Console.
- Select Create Stack ➡️ With new resources (standard).
- Choose Upload a template file and select the downloaded file. Click Next.
- Once the stack finishes deploying, click the Outputs tab in your CloudFormation Console.
- Copy the values (
ApiUrl,WebSocketUrl,UserPoolId,UserPoolClientId, andRegion) and paste them into the NoteCognition settings modal. - Click Save & Connect. The app will immediately point to your private serverless database!