Coder Social home page Coder Social logo

note-taker's Introduction

Note Taking API

Description

This is a simple API that allows you to create, read, update, and delete notes. It is built using Golang and PostgreSQL.

All the endpoints are secured using JWT tokens. The API is documented using Swagger. You can find OpenAPI specification in open-api folder

Pre-requisites

  • Docker
  • Docker Compose
  • Make

How to run the API

make start

This command will start the API and the database in Docker. The API will be available at http://localhost:8080

If you want to run application without docker, you can run the following commands:

go run . db create
go run . db migrate
go run . start

Example JWT token - eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.FhQnRoRWaTyZ5_GNKhX-6XGjB-L9JUGOdCbxDd-8ffk

How to run Swagger UI

make swagger-ui

This command will start the Swagger UI and it will be available at http://localhost:3000

Project Structure

Adapters

Adapters package is responsible for interacting with the database. It contains the implementation of the repository interface.

Config

Config directory stores docker-compose file and migration files for the database.

Domain

Domain package contains the business logic of the application. It contains the definition of the repository interface and the use case.

Open-API

Open-API directory contains the OpenAPI specification of the API.

Ports

Ports package contains the implementation of the HTTP handlers and OpenAPI generated types, server interface and client.

Pkg

Pkg directory contains the common utilities and middlewares used in the application.

Pkg/Auth

Auth package contains the implementation of the JWT middleware.

Pkg/config

Config package contains the configuration of the application.

Pkg/errors

Errors package contains the custom error types used in the application.

Pkg/logs

Logs package contains the logger configuration.

Pkg/server

Server package contains the setup of the basic http router.

note-taker's People

Contributors

dpatsora avatar

Watchers

 avatar

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.