Skip to content

A clone of Google Keep, simple to use distributed note taking tool

Notifications You must be signed in to change notification settings

Srinjoy-Santra/go-keep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Your Own Google Keep

Problem statement https://codingchallenges.fyi/challenges/challenge-keep/ Writeup https://srinjoysantra.live/blog/go-keep

Concepts

  • Directory structure
  • Dependency injection
  • Request interceptors
  • API
    • HTTP
      • Ouath2 with Auht0
      • Session based on cookie
  • Vendoring
  • Commenting
  • Containerizing
  • Logging
  • Error
  • Tracing
  • Documenting
  • Unit Testing
  • Integration testing

The general philosophy of it was not to use various HTTP rest client libraries like gin / echo / etc and use fully embrace net/http

Resources

DB queries

https://www.postgresql.org/docs/16/index.html

CREATE TABLE Note(
    id UUID NOT NULL,
    title TEXT NOT NULL,
    content TEXT NOT NULL,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
    PRIMARY KEY (id)
);

https://aviyadav231.medium.com/automatically-updating-a-timestamp-column-in-postgresql-using-triggers-98766e3b47a0

CREATE FUNCTION update_updated_at_note()
RETURNS TRIGGER AS $$
BEGIN
    NEW.updated_at = now();
    RETURN NEW;
END;
$$ language 'plpgsql';
CREATE TRIGGER update_note_updated_at
    BEFORE UPDATE
    ON
        note
    FOR EACH ROW
EXECUTE PROCEDURE update_updated_at_note();
INSERT INTO Note VALUES('018de613-34ef-79ed-874b-2196c5d5167a', 'first note', '# Heading 1 ## Heading 2 body');
 SELECT * FROM note WHERE apiid='018de613-34ef-79ed-874b-2196c5d5167a';
UPDATE Note SET title = "Updated note", content="Why do I want to update?" WHERE apiid='018de613-34ef-79ed-874b-2196c5d5167a';

Auth

Session handling

Session libraries

Create your own session handling

Deployment

Where to deploy

About

A clone of Google Keep, simple to use distributed note taking tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages