This project creates a blogging API service using Nest framework. In this project will be using Kong is used as the API gateway. Each service will have its own Mongo database and Redis database .
This project breaks down the monolithic go blog backend project provided at goserve repository. It uses the goserve REST API framework to build the auth_service, and blog_service.
- NestJS microservice architecture
- kong API gateway (Future Scope)
- nats for microservices communication (Future Scope)
- custom kong go plugin for apikey validation (Future Scope)
- docker and docker-compose
- mongo
- redis (Future Scope)
- authorization => role based authorization to be added
- Added refresh tokens for better user experience
- auth_service: auth APIs code
- blog_service: blog APIs code
Authentication
- users collection exists in the auth_service database
- auth_service has logic to validate the JWT access token
- auth_service validates the token using a middleware
- blog_service asks auth_service to validate the token via Axios messaging
Authorization
- users and roles collection exists in the auth_service database (Future Scope)
- auth_service checks the roles based on the asked role code (Future Scope)
- auth_service validates the role using a middleware (Future Scope)
- blog_service asks auth_service to validate a user's role via Axios messaging (Future Scope)
Nest framework TypeScript starter repository.
$ npm install# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prodNest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- ME - Shrey Gupta
- LeetCode - https://leetcode.com/u/guptashrey163/
- Gmail - GMAIL