Giter Club home page Giter Club logo

dotnet-microservices-boilerplate's Introduction

.NET Microservices Boilerplate

build-test release

Roadmap

Currently maintaining on Trello, might move to Github later on.

View Trello Board

What's done till now?

  • Added Building Blocks for Services - Serilog, Swagger, Fluent Validation, MediatR, AutoMapper, and more.
  • ThunderClient Support for API Testing - Love this! ๐Ÿš€ ๐Ÿš€
  • YARP API Gateway - Reverse Proxy
  • Identity Server 6 - Separate Microservice for serving and validating JWTs based on API Scope and GrantType as Password.
  • DapR Integration - Currently using only the state-store component of Dapr for Caching purposes. Should research more on this. ๐Ÿš€ ๐Ÿš€
  • EFCore with PostgreSQL Integration for Identity Server.
  • MongoDB Integration for Catalog API Service.
  • GitHub Workflow for Building the Projects in Pipeline.
  • Exception Handling Middleware
  • Semantic Release - Love this! With this, it's easy now to auto-version your applications based on your commits in a semantic way. It even creates GitHub releases for you! ๐Ÿš€ ๐Ÿš€
  • Tye support for running multiple microservices (and Dapr Side-cars) and managing logs.

How to Run

Generate Development certificate by running the following:

dotnet dev-certs https --trust
dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\dev_cert.pfx -p password!
dotnet dev-certs https --trust

Docker-Compose

Once the certificates are installed, you will have to build and push the required docker images to your local instance of docker, and run docker-compose up.

Note that, the docker-compose, tye and any deployment related file would live within the ./deployments folder.

But first, let's build the docker images. There are 2 ways for this:

  • Navigate to each of the service, api-gateway & identity server and run the following command to build and push the docker image to your local docker-desktop setup.
dotnet publish --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer -p:ContainerImageTags=latest --self-contained
  • Else, to make your lives simpler, I have also included the commands in the Visual Code Tasks. Simply hit CTRL+SHIFT+P and type in Tasks. Here select the required publish:xxxxxx task. This would also push the docker image.

Once all the images are built and pushed, you can run the following commands from the root of the solution.

  • If you want to bring up only the infrastructure, run this command docker compose -f "./deployments/docker-compose/infrastructure.yml" up
  • To bring up both the services + infrastructure, docker compose -f "./deployments/docker-compose/infrastructure.yml" -f "./deployments/docker-compose/docker-compose.yml" up

If everything goes well, all the required containers would spin up and you will have access to https://localhost:5100 AKA, the API Gateway. You can use the Thunder-Tests in Visual Code to test the gateway!

P.S, you find the API Tests at ./thunder-tests folder. Ensure that you are using Visual Code with the ThunderClient extension installed.

Tye

To run locally, you can also use the tye tool. I use this for rapid development. Simply run the tye run command at the ./deployments/tye/ directory. You can view all the application logs at the tye dashboard which is available at http://127.0.0.1:8000

Contributing

PS, Currently not accepting any contributions. Once the project is stable, will start accepting PRs.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

Community

License

Code released under the MIT license.

Support โญ

Has this Project helped you learn something New? or Helped you at work? Here are a few ways by which you can support.

  • Leave a star! โญ
  • Recommend this awesome project to your colleagues. ๐Ÿฅ‡
  • Do consider endorsing me on LinkedIn for ASP.NET Core - Connect via LinkedIn ๐Ÿฆธ
  • Or, If you want to support this project in the long run, consider buying me a coffee! โ˜•

black-button

dotnet-microservices-boilerplate's People

Contributors

dependabot[bot] avatar iammukeshm avatar semantic-release-bot 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.