note

module
v0.0.0-...-f767cfc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2023 License: MIT

README

Note

This microservice is written in Go and implements a gRPC service, utilizing gRPC Gateway for HTTP/REST endpoint compatibility and Swagger for API documentation. It also integrates with MongoDB for data storage and Docker for easy deployment.

Run

Docker
  1. You must have Docker installed.
  2. Now in the main folder of the project you need to create an .env file in which you need to configure to add the following environment variables.
    NOTE_ACCESS_TOKEN_SECRET=
    
    NOTE_MONGODB_HOST=
    NOTE_MONGODB_PORT=
    NOTE_MONGODB_USERNAME=
    NOTE_MONGODB_PASSWORD=
    NOTE_MONGODB_DATABASE=
    
  3. Now run the following commands to build and run the Docker container.
    docker build --tag note .
    docker run --publish 8082:8082 --publish 8092:8092 --name note --detach --restart always --env-file ./.env note
    
Docker Compose
  1. You must have Docker and Docker Compose installed.
  2. Now in the main folder of the project you need to create an .env file in which you need to configure to add the following environment variables.
    NOTE_ACCESS_TOKEN_SECRET=
    
    NOTE_MONGODB_HOST=
    NOTE_MONGODB_PORT=
    NOTE_MONGODB_USERNAME=
    NOTE_MONGODB_PASSWORD=
    NOTE_MONGODB_DATABASE=
    
  3. Now you need to run the following command.
    docker-compose up --detach --build --remove-orphans
    

Development

Prerequisites
Dependencies
make dependencies
Other
Protocol Buffer
Swagger
make swagger
Environment variables
NOTE_ACCESS_TOKEN_SECRET=

NOTE_MONGODB_HOST=
NOTE_MONGODB_PORT=
NOTE_MONGODB_USERNAME=
NOTE_MONGODB_PASSWORD=
NOTE_MONGODB_DATABASE=

Directories

Path Synopsis
api
proto
Package proto is a reverse proxy.
Package proto is a reverse proxy.
cmd
internal
storage
Package storage provides storage implementations.
Package storage provides storage implementations.
storage/mongo
Package mongo provides a MongoDB database repository implementation.
Package mongo provides a MongoDB database repository implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL