Sign inSign up

sebu5683/grpc-go-angular

By sebu5683

•Updated over 1 year ago

Angular + Go with gRPC: Full-stack gRPC-Web app with JWT auth, PostgreSQL, and Docker support.

Image
API management
Web servers
Databases & storage
0

408

sebu5683/grpc-go-angular repository overview

ā šŸ› ļø Angular + Go with gRPC

⁠Overview

This repository demonstrates how to integrate an Angular frontend with a Go backend using the gRPC protocol. By leveraging Protocol Buffers (protobufs), we ensure efficient and structured communication between services.

⁠Features

āœ… Full-stack gRPC implementation (Angular + Go)
āœ… Supports gRPC-Web for browser-based communication
āœ… Secure authentication with JWT
āœ… PostgreSQL database integration via GORM
āœ… Dockerized for easy deployment

⁠Technologies Used

ā šŸ”¹ Angular
  • @ngx-grpc/core – Connects Angular to the gRPC server
  • @ngx-grpc/improbable-eng-grpc-web-client – Enables gRPC-Web support
  • google-protobuf – Handles protobuf serialization
  • ngx-toastr – Displays user-friendly notifications
ā šŸ”¹ Go
  • google.golang.org/grpc – Implements gRPC server
  • github.com/improbable-eng/grpc-web – Enables gRPC-Web support
  • gorm.io/gorm & gorm.io/driver/postgres – Database ORM and PostgreSQL driver
  • github.com/golang-jwt/jwt/v4 – Handles authentication

⁠Getting Started

⁠🐳 Pull & Run the Docker Image
docker pull sebu5683/grpc-go-angular:latest
docker run -d -p 80:80 --name grpc-server sebu5683/grpc-go-angular
ā šŸ“Œ Environment Variables
ā šŸ”¹ Database Configuration (PostgreSQL)
  • POSTGRES_USER → PostgreSQL username used for authentication.
  • POSTGRES_PASSWORD → Password for the PostgreSQL user.
  • POSTGRES_DB → Name of the database to be created in PostgreSQL.
ā šŸ”¹ API Configuration (Backend)
  • PORT → The port on which the Go gRPC server runs.
  • DB_HOST → The hostname or IP address of the database server (e.g., localhost or a container name in Docker).
  • DB_PORT → The port used by PostgreSQL (default: 5432).
  • DB_USERNAME → The username that the backend service uses to connect to the database.
  • DB_PASSWORD → The password for the database user in the backend.
  • DB_NAME → The name of the database that the backend service connects to.
ā šŸ”¹ Security & Authentication
  • JWT_SECRET → Secret key used for signing JSON Web Tokens (JWT) for authentication.
ā šŸ”¹ Frontend Configuration
  • API_BASE_URL → The base URL that the Angular frontend uses to make API requests to the backend.

ā šŸ“š Resources

šŸš€ Start building efficient, scalable microservices today!

Tag summary

Content type

Image

Digest

sha256:feeab14b3…

Size

53.8 MB

Last updated

over 1 year ago

docker pull sebu5683/grpc-go-angular