Coder Social home page Coder Social logo

batnoter / batnoter Goto Github PK

View Code? Open in Web Editor NEW
2.3K 25.0 131.0 6.43 MB

An open source, markdown-based, self-hosted note taking webapp.

Home Page: https://batnoter.com

License: MIT License

Dockerfile 0.29% HTML 2.20% TypeScript 96.14% SCSS 0.75% JavaScript 0.62%
notes git github markdown productivity react webapp contributions-welcome reactjs container-ready

batnoter's Introduction

Create and store notes to your git repository!
https://batnoter.com

BatNoter

GitHub Workflow Status codecov Codacy Badge

BatNoter is a web application that allows users to store notes in their git repository. This is a frontend project built using mainly react (typescript), redux-toolkit & mui components. BatNoter API is the backend implementation of REST APIs which are used by this react app.

BatNoter Demo

Features

  • Login with GitHub.
  • Create, edit, delete, organize & explore notes easily with a nice & clean user interface.
  • Markdown format supported allowing users to add hyperlink, table, headings, code blocks, blockquote... etc inside notes.
  • Editor allows preview of markdown.
  • Quickly copy code from the code section using copy to clipboard button.
  • Store notes directly at the root or use folders to organize them (nesting supported).
  • Explore all the notes from a specific directory with single click.
  • All the notes are stored inside user's github repository.
  • Notes are cached to avoid additional API calls.
  • URLs can be bookmarked.
  • Dark/Light mode supported.

Local Development Setup

Prerequisites

  • Node.js version 18 or above

Start the server

npm install
npm start

This will start the react app in the development mode. Open http://localhost:3000 to view it in the browser.

Run tests

npm test

This will execute all the tests and also prints the code coverage percentage.

Contribution Guidelines

Every Contribution Makes a Difference

Read the Contribution Guidelines before you contribute.

Contributors

Thanks goes to these wonderful people ๐ŸŽ‰

batnoter's People

Contributors

fduschka avatar kshtj24 avatar mskr avatar raghav-wd avatar senor-ducky avatar shikhar13012001 avatar src-hyc avatar umaxyon avatar vivekweb2013 avatar wilsonle 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

batnoter's Issues

Add a feature to auto setup the repository on new user login

For new user logins, The ui should present an option for automatically setting up the notes repository. Also allow him to select existing notes repository manually if he wishes to.

The auto setup option should create a new repository in user's github account and store it as default notes repo for user.

This should enhance the user experience since otherwise new users would select irrelevant existing repository for storing notes or they would have to go to github account and create a new one and then come back to application and select it.

Markdown editor, should take up full width and height

Current UI

image

Proposed UI

image

Why?

Since, the sole purpose of application is to take notes (usually few pages long), the 'Proposed UI' provides a better view to user when editing and previewing those changes.

Notes

I've excludes other UI components in 'Proposed UI' like 'Path', 'Note Name' and 'Cancel/Save' button, they should obviously be there.

something went wrong. contact support

I am trying to use the site, and I used the auto repository creator. I go to make a very simple note, and I get "something went wrong. contact support."

Note title: HelloWorld
Note Content:

How are you! This is cool.

Image

Create a deployment workflow to deploy the application to k8s cluster

Create a deployment workflow to deploy app to k8s cluster on push events to main branch.
The deployment workflow should use the helm charts for deployment.

Create a github environment Production and run the deployment job in context of this environment.
The kubernetes secrets should be stored as environment secrets under Production environment.
The deployment workflow should be dependent on build job otherwise new docker images will not be available to the deploy job.

Design a path autocomplete input component using mui components

Since the repo file tree is fetched every time the main page is loaded, It is possible to design the autocomplete input which will help users select a path quickly while creating a new note.

The component should -

  • filter the tree at current path and prompt user about next dirs available
  • user should able to delete the dirs in path using backspace
  • user should be able to type a manual path
  • path should be validated on save, in case of error a relevant msg appear below the component

Implement copy button on code section of markdown preview

react-markdown does not show any copy button on the code section.
But it does provide the option to override code component.

Implement a custom code component which shows a copy button at the top right of code section which should copy the containing code on click

Support other language like Chinese would be better

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

the folder and file name which contains chinese cant show in the web note.

create-react-app proxy does not work with document type requests

I've configured the react application to proxy backend api requests using following configuration in package.json file

"proxy": "http://localhost:8080",

but it seems that only ajax calls are proxied. Since the application has oAuth sign in flow some of the non ajax calls also need to proxied.

The solution is to manually configure the proxy with http-proxy-middleware as suggested by https://create-react-app.dev/docs/proxying-api-requests-in-development/#configuring-the-proxy-manually

[Feature] Gitea and other private repos

Add in the ability to setup gitnoter with 3rd party git services, such as Gitea. Batnoter should be able to work without an internet connection when setup to use a 3rd party git service.

Note editor should show preview of the markdown

The editor should allow users to preview the markdown. Similar to how github/stackoverflow has a preview tab which renders the markdown.

Check if there is any lightweight library for react that can be used to build this functionality.

[feature request] Dark mode

Hello!

It would be great if we could have an option for dark mode, preferably a permanent option/setting rather than a toggle (but that part is my own preference).

Thanks!

Helm upgrade does not recreate pod with latest image even if imagePullPolicy is set to Always

It seems that helm upgrade will roll out changes to kubernetes objects only if there are changes to roll out. i.e when the object is changed in the helm chart files. It will not recreate the pods just because the image is update. To be able to recreate the pod you will need to update the chart and specify some tag to the image in the chart which refers to the latest image and the tag should be new every time.

While this can be done there is one maintenance headache with this approach. We will need to update our charts every time the new image is created.

There is an alternative though. We can provide a dynamic label to the pod deployment metadata (something like timestamp) which will be new every time and will cause helm to recreate the pod because the pod object is different than previous.

Reference: https://stackoverflow.com/a/71016950/814548

UI fails to load on safari due to regex error

The error is

SyntaxError: Invalid regular expression: invalid group specifier name

It seems that safari does not support lookbehinds like (?<= ) or (?<! ) since the support for lookbehinds is recently finalised for javascript under ECMA-262(ECMAScript 11) specification. See this.

https://caniuse.com/js-regexp-lookbehind

But on the other hand support for lookaheads like (?= ) or (?! ) was there already. So safari also supports lookaheads.

To resolve the issue just find an alternative to lookbehinds that your regex is using. Don't worry about lookaheads.

PDF?

Can gitnoter work with PDF files? One thing I use a lot with Evernote are PDFs.
I would love to get away from their monthly fees just to house my PDF files. Also really nice that I can search within PDF files for references when searching notes.

Remove empty parent directories from tree view on deleting a note

Lets say the note tree is as below

root
|-- dir1
|    |-- dir2
|    |    |-- dir3
|    |         |-- note1
|    |-- dir4
|         |-- note2
|-- dir5
    |-- note3

When the user deletes note1 then dir3 and dir2 should also be removed. Since they will be empty otherwise and has no use. Even git also removes the empty directories. So it is better to delete the empty parents on deleting a note.

The algorithm for deleting tree node should handle this scenario.

UI tests failing after adding react-markdown

Tests failing with below error

    Details:

    /home/runner/work/gitnoter/gitnoter/frontend/node_modules/react-markdown/index.js:6
    export {uriTransformer} from './lib/uri-transformer.js'
    ^^^^^^

    SyntaxError: Unexpected token 'export'

This is happening because react-markdown is using ESM which is not supported by jest.
remarkjs/react-markdown#635

The easy solution would be to create the mocks for react markdown

Non github user

Can you add support to use our own custom git server. I use gitea (will be migrating to gitlab) and would love to be able to use my own server for the notes and auth.

Option to expand the textbox to full screen

Is your feature request related to a problem? Please describe.
I'm finding it difficult note down data in small text box

Describe the solution you'd like
like to expand the markdown box to full page and give the option for expanding
image

document how to self-host using docker(-compose)

It would be great if there was a document describing how to self-host gitnoter using docker. All I could find are the heroku docs, but I would like to avoid using yet another 3rd party service. One can probably piece things together from the heroku docs, yet it would be nice to have a document how to self-host w/o heroku.

UI design proposal for showing note revisions

Since we store notes inside git repository. So we can build a functionality to show revisions of the note by fetching historical commits data and allow user to revert to a specific revision. This would be a great addition to GitNoter

This issue is just about proposing the ui, i.e. we use this issue to share ideas/mockups/wireframes that shows revisions of a specific note and allow selecting the revision which will show the note version specific to that revision.

GitHub Flavoured UI

The Application will look more impactful if the UI elements follow GitHub's Styling.

Scrollbar is automatically disappearing on macos when not scrolling

It seems that this is an os specific behaviour. The appearance of scrollbar can be controlled setting system preference on macos (System Preferences > General > Show scroll bars) to Always

But with this it will only affect the single user's machine. Also this will reserve the scrollbar space making ui look much ugly.

The workaround is to use WebKit's -webkit-scrollbar pseudo-elements to create the custom scroll bar that is always visible and looks similar to default scrollbar on macos. The downside is that windows user's will now see a macos like scrollbar.

Reference below
https://stackoverflow.com/questions/7855590/preventing-scroll-bars-from-being-hidden-for-macos-trackpad-users-in-webkit-blin

Inconsistent results with javascript regex test

The following piece of code sometimes returns true and sometimes returns false if invoked again

const VALID_FILENAME_REGEX = /^([a-zA-Z0-9-]|[^\S\r\n])+(\.md)$/gm;
...

func validate(){
    return VALID_FILENAME_REGEX.test("sample.md")
}

The issue seems to be the global(g) flag which matches the next occurrence on every execution causing the inconsistent result.
The solution is to remove the global flag. If removing global flag is not feasible then simply use the constructor to build the new regex every time

  const VALID_FILENAME_REGEX = `^([a-zA-Z0-9-]|[^S\r\n])+(.md)$`
...

func validate(){
    return new RegExp(VALID_FILENAME_REGEX, 'gi').test("sample.md")
}

Or the other simple technique that I prefer is to do the reverse match. i.e. use String.match(Regex)

const VALID_FILENAME_REGEX = /^([a-zA-Z0-9-]|[^\S\r\n])+(\.md)$/gm;
...

func validate(){
    return "sample.md".match(VALID_FILENAME_REGEX)
}

References:
https://stackoverflow.com/questions/1520800/why-does-a-regexp-with-global-flag-give-wrong-results
https://stackoverflow.com/questions/2630418/javascript-regex-returning-true-then-false-then-true-etc

Design a 404 page not found view inside react frontend

If the user visits a link for which there is no route defined, then we should show a 404 page not found view.

As a part of this task

  • Create a new 404 component
  • Add a 404 route at the end of all routes which matches all the paths. This route should render the 404 view.

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.