It contains a server that runs with a Database and an http handler that allows you to create an login users with a username and passwords. The user can create, update and delete notes that they write. They can also share notes with other users. It has a hadnler called searchNotes
which allows a user to search in his notes a speecific query and return all the notes that contain the query.
Just copy this repo anywhere and type docker compose up
. Your server will start running on the port :8080
and meilisearch on 7700
.
This project makes use of the following things:-
- PostGres:- The SQL database with most open source extensions which helps extensively in the long run.
- Golang:- The language of choice for the project. Easy to implement, performant, space efficient and most of all with very less chances of shooting yourself in the foot.
- Meilisearch:- Think of it as a lightweight
ElasticSearch
orSolr
. The reason I didn't go with text indexing libraries of golang itself was because I wanted filterable attributes namely theuser_id
so taht a user can only search his own notes. - Golang Migrate:- This was used to create schema directories and run migrations on the database. The reason I like this tool is because it lets me run migrations from code itself too in case I don't have access to
docker-file
. - SQLC:- Perhaps my favourite here.
SQLC
lets me write SQL queries in a folder and in turn generate safe code which I can just plug and play with my handlers.
Well all the endpoints are working. Even the fuzzy search one.
I am thinking of generating a swagger
for the APIS using swaggo
. Apart from this I am looking faker.js
alternatives in golang to create on the fly api testings.
Feel free to contact me on heleonidasspartan@gmail.com.