/Brief

Offline-first note taking app.

Primary LanguageElmGNU Affero General Public License v3.0AGPL-3.0

Brief - Capture Your Thoughts Effortlessly ๐Ÿ“

Brief is an intuitive, offline-first personal note-taking Progressive Web App (PWA) designed to help you capture and organize your thoughts, tasks, and ideas. It seamlessly syncs your notes across all your devices whenever you have an internet connection, ensuring you never miss a beat. Inspired by Google Keep.

Table of Contents ๐Ÿ“š

  - Prerequisites

  - Setting Up the Project

Introduction ๐ŸŒŸ

Welcome to Brief - a modern, offline-first note-taking app tailored for your personal and professional life. Our progressive web app (PWA) is all about helping you jot down and organize your ideas, tasks, and notes seamlessly. Whether you're offline or online, Brief ensures your notes are just a tap away, ready to be synced whenever you're connected to the internet. This open-source project embraces the AGPL-3.0 license, inviting a vibrant community of users and developers to use, enhance, and customize it for free.

Features โœจ

  • Offline Capabilities: Take and manage notes anytime, anywhere.

  • Note Operations: Add, edit, delete, and rearrange notes effortlessly.

  • Label Management: Customize and manage labels for better organization.

  • Sync: A smart command API pattern ensures your data remains up-to-date across all your devices.

  • Progressive Web App: Enhancing the app to work as a Progressive Web App.

  • Database Syncing: Future capabilities include syncing IndexedDB with the server for a seamless offline experience.

  • Real-time Editing: Soon, you'll be able to collaborate with others in real-time with Operational Transactions.

Technologies Used ๐Ÿ› ๏ธ

  • Frontend: Crafted using Elm, featuring Material Design icons.

  • Backend: Powered by ElysiaJS, with a Prisma.js ORM and PostgreSQL database.

  • Sync Strategy: Utilizing an "Offline Queue" and "Last Write Wins" approach to resolve conflicts.

  • Session Management: Utilizes signed cookie-based sessions to enhance security and maintain a reliable user experience.

How It Works ๐Ÿ”„

Brief implements a Command API pattern to intelligently manage your actionsโ€”like creating, updating, or deleting notes and labelsโ€”by queuing them up until an internet connection is available. All local changes are securely stored and then synchronized with the server, which serves as the Single Source of Truth (SSOT). This ensures that your data is consistent across all devices and sessions once synced.

Getting Started ๐Ÿš€

Prerequisites

To set up your local environment for Brief, you will need:

Setting Up the Project

  1. Clone the repository:

git clone https://github.com/Lucasmercado101/Brief

  1. Start a Docker PostgreSQL instance:

docker run --name notes-db -d -e POSTGRES_DB=mydb -e POSTGRES_PASSWORD=testpass123 -e POSTGRES_USER=postgres -p "6500:5432" postgres

  1. Access the Database with PSQL:

psql -U postgres -d mydb

  1. Frontend Setup:

npm install

npm run dev

  Serve the HTML or use elm reactor and access the app at http://localhost:8000/frontend/public/index.html.

  1. Backend Setup:

bun install

bun prisma generate

bun dev

  1. Environment Variables:

Set up your .env file with the following entries:


DATABASE_URL="postgresql://postgres:testpass123@localhost:6500/mydb"

COOKIE_SECRETS="secret"

License ๐Ÿ“

This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.