snoozehub-backend

command module
v0.0.0-...-5bdcad7 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 32 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

We are using a proxy server for the grpc server from https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy, to convert http 1.1 requests to http 2

Services:

  • grpc-server: Grpc server for backend, this is the main service for development
  • grpc-web-proxy: proxy for the grpc-server (port: 8080)
  • mongodb: database (port: 27017)
  • mongo-express: web interface to manage mongodb (port: 8081)

How to use for dev

  1. Open The folder in vscode
  2. Using remote container extension, select reopen in container
  3. Install reccomended tools
    • Develop (to manage the database go to localhost:8081)
    • Is exposed the port 8080 from grpc-web-proxy service if you want to make manual testing from an external grpc web client

How to use for production

Note: Currenctly there is a public key filter for demo purposes

  1. You need locally only "prod folder" and open it
  2. Sign in in the container registry
  3. Place "mailgun-sending-key.key" file in "secrets" folder
  4. Initialize a letsencrypt folder in /etc/letsencrypt where are store certificate and private key for grpc-web-proxy
  5. Spin up "prod/docker-compose.yaml" with docker compose up

Proposals

  • Implement tests for:
    • Book
    • Review
    • GetMyReview
    • RemoveReview
    • RemoveMyBed
    • GetReview
  • add correct regex of telegram username
  • add indexes for database in setupdb function
  • SetProfilePic doesn't check if it is avif
  • non optional values in grpc could be nil

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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