Giter VIP home page Giter VIP logo

takenote's Introduction

Coverage Status

A web-based notes app for developers. (Demo only)

Screenshot

Features

  • Plain text notes - take notes in an IDE-like environment that makes no assumptions
  • Markdown preview - view rendered HTML
  • Linked notes - use {{uuid}} syntax to link to notes within other notes
  • Syntax highlighting - light and dark mode available (based on the beautiful New Moon theme)
  • Keyboard shortcuts - use the keyboard for all common tasks - creating notes and categories, toggling settings, and other options
  • Drag and drop - drag a note or multiple notes to categories, favorites, or trash
  • Multi-cursor editing - supports multiple cursors and other Codemirror options
  • Search notes - easily search all notes, or notes within a category
  • Prettify notes - use Prettier on the fly for your Markdown
  • No WYSIWYG - made for developers, by developers
  • No database - notes are only stored in the browser's local storage and are available for download and export to you alone
  • No tracking or analytics - 'nuff said
  • GitHub integration - self-hosted option is available for auto-syncing to a GitHub repository (not available in the demo)

About

TakeNote is a note-taking app for the web. You can use the demo app at takenote.dev. It is a static site without a database and does not sync your notes to the cloud. The notes are persisted temporarily in local storage, but you can download all notes in markdown format as a zip.

Hidden within the code is an alternate version that contain a Node/Express server and integration with GitHub. This version involves creating an OAuth application for GitHub and signing up to it with private repository permissions. Instead of backing up to local storage, your notes will back up to a private repository in your account called takenote-data. Due to the following reasons I'm choosing not to deploy or maintain this portion of the application:

  • I do not want to maintain a free app with users alongside my career and other commitments
  • I do not want to request private repository permissions from users
  • I do not want to maintain an active server
  • I do not want to worry about GitHub rate limiting from the server
  • There is no way to batch create many files from the GitHub API, leading to a suboptimal GitHub storage solution

However, I'm leaving the code available so you can feel free to host your own TakeNote instance or study the code for learning purposes. I do not provide support or guidance for these purposes.

TakeNote was created with TypeScript, React, Redux, Node, Express, Codemirror, Webpack, Jest, Cypress, Feather Icons, ESLint, and Mousetrap, among other awesome open-source software.

Reviews

"I think the lack of extra crap is a feature." β€” Craig Lam

Demo Development

Clone and install.

git clone [email protected]:taniarascia/takenote
cd takenote
npm i

Run a development server.

npm run client

Full Application Development (self-hosted)

Pre-Installation

Before working on TakeNote locally, you must create a GitHub OAuth app for development.

Go to your GitHub profile settings, and click on Developer Settings.

Click the New OAuth App button.

  • Application name: TakeNote Development
  • Homepage URL: http://localhost:3000
  • Authorization callback URL: http://localhost:3000/api/auth/callback

Create a .env file in the root of the project, and add the app's client ID and secret. Remove DEMO variable to enable GitHub integration.

CLIENT_ID=xxx
CLIENT_SECRET=xxxx
DEMO=true

Change the URLs to port 5000 in production mode or Docker.

Installation

git clone [email protected]:taniarascia/takenote
cd takenote
npm i

Development mode

In the development environment, an Express server is running on port 5000 to handle all API calls, and a hot Webpack dev server is running on port 3000 for the React frontend. To run both of these servers concurrently, run the dev command.

npm run dev

Go to localhost:3000 to view the app.

API requests will be proxied to port 5000 automatically.

Production mode

In the production environment, the React app is built, and Express redirects all incoming requests to the dist directory on port 5000.

npm run build && npm run start

Go to localhost:5000 to view the app.

Run in Docker

Follow these instructions to build an image and run a container.

# Build Docker image
docker build --build-arg CLIENT_ID=xxx -t takenote:mytag .

# Run Docker container in port 5000
docker run \
-e CLIENT_ID=xxx \
-e CLIENT_SECRET=xxxx \
-e NODE_ENV=development \
-p 5000:5000 \
takenote:mytag

Go to localhost:5000 to view the app.

Note: You will see some errors during the installation phase, but these are simply warnings that unnecessary packages do not exist, since the Node Alpine base image is minimal.

Seed data

To seed the app with some test data, paste the contents of seed.js into your browser console.

Testing

Run unit and component/integration tests.

npm run test

If using Jest Runner in VSCode, add "jestrunner.configPath": "config/jest.config.js" to your settings

Run Cypress end-to-end tests.

# In one window, run the application
npm run client

# In another window, run the end-to-end tests
npm run test:e2e:open

Contributing

TakeNote is an open source project, and contributions of any kind are welcome and appreciated. Open issues, bugs, and feature requests are all listed on the issues tab and labeled accordingly. Feel free to open bug tickets and make feature requests. Easy bugs and features will be tagged with the good first issue label.

View CONTRIBUTING.md to learn about the style guide, folder structure, scripts, and how to contribute.

Contributors

Thanks goes to these wonderful people:


Tania Rascia

πŸ’» πŸ€” πŸ›

hankolsen

πŸ’» πŸ› ⚠️

Joseph Perez

πŸ’»

Paul

πŸ’» ⚠️

Martin Rosenberg

πŸ’» πŸ› 🚧

Melissa

πŸ’»

Jason Towle

πŸ’»

Mark Erikson

πŸ€”

Alphonse Bouy

πŸ›

dave2kb

🎨 πŸ€”

Devin McIntyre

πŸ’»

Jeffrey Fisher

πŸ›

Alex Dong

πŸ’»

Publicker

πŸ’»

Jakub NaskrΔ™ski

πŸ’» πŸ› ⚠️

Benny O

πŸ’»

Justin Payne

πŸ’»

marshmallow

🚧

Jose Felix

πŸ’»

Nikolay Kirsh

πŸ’»

Mudassar Ali

πŸ’»

Nathan Bland

πŸ› πŸ’»

Craig Lam

πŸ’» πŸ› ⚠️

Ashinze Ekene

πŸ› πŸ’»

Harry Sullivan

πŸ’»

Mauricio MartΓ­nez

πŸ’»

Black-Hole

πŸ’»

Frank Blendinger

πŸ’»

Eduardo Reveles

πŸ’»

Leo Royzengurt

πŸ’» πŸ›

kcvgan

πŸ’» πŸ›

Cody Towstik

πŸ’» ⚠️ πŸ›

Vincent DΓΆrig

⚠️ πŸ’»

Michael Huynh

πŸ’» πŸ›

Joshua Bloom

πŸ’»

Mxchaeltrxn

πŸ’» ⚠️

Konrad Staniszewski

πŸ“–

Yohix

🚧

Jackson Elfers

πŸ’»

Vamshi

πŸ’»

Simos

πŸ’» ⚠️

Yankee

πŸ’» πŸ€” ⚠️

G-Milevski

πŸ’»

Kody Clemens

πŸ’» ⚠️ πŸ›

Vladimir Yamshikov

πŸ’» πŸ›

Ronan D'Souza

πŸ’»

Roland Fredenhagen

πŸ’»

Pranjali Pramod Patil

⚠️

Chris Bargmann

πŸ€” πŸ’»

Jadhiel VΓ©lez

πŸ’» πŸ›

Lucas Machado

πŸ’» πŸ› ⚠️

xsteadybcgo

πŸ›

Marius Robert RWANDARUSHYA

⚠️

Isaac Komezusenge

⚠️

Maxime Ishimwe

⚠️

Marcos Spanholi

⚠️

Roshan Rajeev

πŸ’»

fistonhn

⚠️

Raffaele Ferri

🚧

Dusabe Johnson

⚠️

tomasvn

πŸ’»

Lucas Ribeiro

πŸ’» ⚠️

Bartosz Zagrodzki

πŸ’»

Mahendran Mookkiah

πŸ’»

hkhattabii

πŸ’»

Federico Pomponii

πŸ’»

Acknowledgements

Author

License

This project is open source and available under the MIT License.

takenote's People

Contributors

allcontributors[bot] avatar ashinzekene avatar codytowstik avatar dantaro avatar dong-alex avatar g-milevski avatar hankolsen avatar harrysullivan235345 avatar jackson-elfers avatar jadhielv avatar jakapatb avatar jakenvac avatar jaknas avatar jeffslofish avatar joseph-perez avatar joserfelix avatar justdoindev avatar kcvgan avatar kodyclemens avatar konradstanski avatar machadolucasvp avatar martinrosenberg avatar miqh avatar mookkiah avatar mudssrali avatar pavlakissimos avatar pranjalipatil14 avatar siliconeidolon avatar taniarascia avatar vincentdoerig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

takenote's Issues

Set max height and scroll on sidebars

I seriously cannot figure out how to get the x and y position of an element so I can absolutely position the note options containers for each list item with JavaScript.

Wrong note deleted

It is possible to delete "wrong" note.

Steps to repeat:

  1. Selected a note to make it active
  2. Click the note options of another note
  3. Click "Delete note"

Result: The active note gets deleted
Expected result: The note of which the note options where opened should be deleted

Add GitHub authentication

Add GitHub authentication.

  • Ability to log in with GitHub
  • Connect TakeNote with a single gist
  • Display all individual notes as .md files within TakeNote Gist.

Give feedback when "Save" is pressed

Right now when pressing the "Save" button the user doesn't really know if the saving was indeed done.
Some feedback would be nice, maybe a discrete message that fades after some time.

Add Screenshot to Readme

Hello and thanks for your project,

I think it would be a nice touch to have a screenshot of how the note taking app looks and maybe some features explained in the Readme.

Drag and drop not working

I see that drag and drop was added previously, but I cannot get it to work in Chrome, Firefox, or Safari on macOS.

I would expect to be able to drag a note to favorites, trash, or a category, but I can do none of these. I am able to drag a note around, but when I drop it on any of these items it moves back to its original place and doesn't move to the appropriate folder.

Add settings

Settings modal:

  • Update theme along with dark mode (zenburn is there for example)
  • Vim mode toggle (for vsergeev)
  • Display keybindings options (do not allow editing keybindings at this time)
  • Various code mirror options toggle

Dark mode deactivates on page reload

After activating dark mode, I discovered that on every page reload, it is deactivated.

There should be settings to save the current theme on the browser's storage system.

Thank you : )

[Settings] Add setting for sync frequency

Right now, the app syncs to localStorage every 30 seconds.

In KeyboardShortcuts.tsx, an interval is set.

  useInterval(() => {
    _syncState(notes, categories)
  }, 30000)

This should not be in Keyboard Shortcuts, but more likely App.tsx or SettingsModal.tsx. The settings modal should have an option to toggle sync on and off, and set sync interval.

A sensible default should be set - sync on and set to 30 seconds or something. Bonus points if the sync doesn't go through if the last updated note is within 5 seconds or something - to prevent sync while typing.

New note title bug

Pointed out by @AM-Myrick - new notes will not display a title if the first character is a newline. The whole getNoteTitle function needs to be rewritten to fix this bug and display properly if the first character is header markdown.

Create an example note

Each new TakeNote account should begin with an example note, that explains everything you can do.

  • Creating notes
  • Creating categories
  • Keybindings (ctrl + n for new note, for example)
  • Sync

Assorted suggestions

Hi! Had a chance to glance through the code briefly, and wanted to offer up some suggestions:

  • First, I'd strongly suggest that you try using our Redux Starter Kit package once you feel like you understand the basics of Redux. It should simplify a lot of the logic and code that you already have here. For example, the entire actions/index.ts file can be removed completely, as can most of constants/index.ts, because RSK's createSlice function automatically generates action creators and action types for you.
  • Next, while Redux itself doesn't care about folder structures, our recommendation at this point is to use a "feature folder" approach, or even the "ducks" pattern for putting all logic for a given Redux feature into a single file. See the Redux FAQ entry on folder structures for comparisons, and the RSK usage guide on createSlice for some discussion of using RSK to write "ducks" files.
  • Finally, I see that you're using sagas here. Sagas are a great power tool, but the majority of Redux apps don't need them. In your case, it looks like all you're doing is fairly simple data fetching. This can easily be done with Redux "thunks" and async functions. For example, this saga:
function* fetchNotes() {
  try {
    const notes = yield requestNotes()

    yield put(loadNotesSuccess(notes))
  } catch (error) {
    yield put(loadNotesError(error.message))
  }
}

export function* allSagas() {
  yield all([
    takeLatest(Actions.LOAD_NOTES, fetchNotes),
  ])
}

becomes this thunk:

const fetchNotes = () => async dispatch => {
    try {
        const notes = await dispatch(requestNotes());
        dispatch(loadNotesSuccess(notes);
    } catch(error) {
        dispatch(loadNotesError(error.messsage);
    }
}

So, sagas are definitely not necessary here, and thunks should be simpler for this use case.

If you use RSK's configureStore function, it adds the thunk middleware to the store by default.

See the Redux FAQ entry on choosing an async middleware for more info, and the RSK "Advanced" tutorial" shows how to do data fetching with thunks and use it with TS.

One other suggestion: while connect is our main API for interacting with the store from components, we also now have a React-Redux hooks API as well, which may be simpler to work with in terms of lines of code and TS usage. You might want to try those out.

Hopefully these suggestions are useful. Please let me know if you've got any questions I can help with!

Add test infrastructure

Add react-testing-library tests and Jest unit tests.

Will add test cases here as I think of them.

Files no longer persisting

My files aren't persisting in local storage between refreshes. But the very first note I made, is still there. So there's a regression somewhere.

Trash features

  • Add ability to permanently delete note (remove from notes array)
  • Add ability to restore deleted note (remove trash property)
  • Do not allow making a new note from trash (disable addNote if Folder is TRASH)

Provide an issue template for reference from the contributor

Scope: contribution from the community.

Description: It would be much helpful for the contributors to have a common and guiding template for creating issue. I know this is kind of egg and chicken problem that this issue is being created to create a proper issue. Anyway, I know it is quite trivial to create a Template for issue from setting interface. Just need someone to do it.

Associated Resources: Although it is trivial to find the relevant document, here is a quick link for it to save searching for it, https://help.github.com/en/articles/creating-issue-templates-for-your-repository

Add syntax highlighting support for other languages

Right now, all notes default to markdown files with markdown highlighting. Perhaps you should be able to select other languages and get the highlighting for that type of file.

My issue with this is I use markdown with frontmatter as the note data right now, and if I changed the file type to something else, it would lose the frontmatter metadata.

Add favorites option to sidebar

Add favorites option to main app sidebar, on the same level as Notes and Trash.

  • Add a β€œfavorite” parameter to NoteItem state and interface.
  • Show filtered view for favorites

[Notes] On initial load, create new note if notes array is empty

A user landing on the page can be confused right now, believing they can type immediately. However, the app does not begin with any active note, nor does it have an example note.

In the case that no notes exist on initial load, create a new empty note. Do not create a new empty note if they delete all notes - only initial load.

Enabling Dark mode using keyboard shortcut doesn't apply styling to whole page

Actual Behavior:

Using ctrl+option+t keyboard shortcut to enable dark mode is not applying it properly:
image

It appears to work fine when there are no notes selected.
After adding a note -> the 'All Notes' sidebar is in bright color, rest is properly dark.
Overall, the behaviour when having notes, and having no notes selected is different.

Expected Behaviour:

Dark mode is applied correctly, same as using the switch in settings modal:
image

Specs:

Seen on MacOS 10.14.6, using Chrome 79 and Firefox 70

Additional notes:

Also: using dark mode with keyboard shortcuts is not visible on settings modal -- so maybe this issue is known and that's why it's not been added yet to settings modal keyboard shortcuts section.

Hopefully this issue will help with debugging and tracking this.

Keybindings fire too easily

If I press "d" then a download is triggered.
If I press "t" then dark mode is toggled, etc.

Shouldn't it only trigger these while holding down ctrl, or some other key?

[Testing] Test cases

Just leaving notes here on the functionality that should be tested.

Notes

  • create a note
  • update a note
  • send a note to trash
  • add a note to favorites
  • add a note to category
  • permanently delete a note
  • restore a deleted note
  • empty trash
  • search notes
  • list proper notes per folder or category in order

Categories

  • create a category
  • delete a category

Settings/Sync

  • sync a note

[Vim] Cursor in Vim editor is not working properly

Issue and Steps to Reproduce

  1. Settings
  2. Enable Vim Mode
  3. Create a new note
  4. Put insert mode into the editor (press i)
  5. Write some text
  6. With arrow keys of your keyboards go left and right

Attachment

vim-cursor-bug

Expected

The cursor move with your arrow keys movements

Actual

The cursor is fixed at the last position of it.

Lint imports

@taniarascia's preference is to sort and group imports as follows:

  1. Libraries
  2. Local imports (absolute, not relative)
  3. CSS/side-effect imports

With each group alphabetized by from, named imports sorted within their lines, and spaces between the groups.

Right now, there are multiple rule/plugin/preset options for linting imports, none of them quite does the trick right now, they all conflict with each other, and none of them individually is really a desired compromise. However, the hopefully-upcoming merging of import-js/eslint-plugin-import#1360 should make import/order a perfect candidate.

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.