All Projects β†’ otasoft β†’ microservice-template

otasoft / microservice-template

Licence: MIT license
πŸ“– Nest.js based microservice repository template

Programming Languages

typescript
32286 projects
shell
77523 projects
javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to microservice-template

nest-convoy
[WIP] An opinionated framework for building distributed domain driven systems using microservices architecture
Stars: ✭ 20 (-84.73%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing, typeorm, nestjs
Revo
Event Sourcing, CQRS and DDD framework for C#/.NET Core.
Stars: ✭ 162 (+23.66%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Event Sourcing Jambo
An Hexagonal Architecture with DDD + Aggregates + Event Sourcing using .NET Core, Kafka e MongoDB (Blog Engine)
Stars: ✭ 159 (+21.37%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
EcommerceDDD
Experimental full-stack application using Domain-Driven Design, CQRS, and Event Sourcing.
Stars: ✭ 178 (+35.88%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Symfony Demo App
A Symfony demo application with basic user management
Stars: ✭ 122 (-6.87%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Eventflow.example
DDD+CQRS+Event-sourcing examples using EventFlow following CQRS-ES architecture. It is configured with RabbitMQ, MongoDB(Snapshot store), PostgreSQL(Read store), EventStore(GES). It's targeted to .Net Core 2.2 and include docker compose file.
Stars: ✭ 131 (+0%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Kreta
Modern project management solution
Stars: ✭ 177 (+35.11%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Nestjs Cqrs Starter
NestJS CQRS Microservices Starter Project
Stars: ✭ 80 (-38.93%)
Mutual labels:  cqrs, event-sourcing, nestjs
Msgphp
Reusable domain layers. Shipped with industry standard infrastructure.
Stars: ✭ 182 (+38.93%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Flux
A simple CQRS Framework for go
Stars: ✭ 206 (+57.25%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Dotnet New Caju
Learn Clean Architecture with .NET Core 3.0 πŸ”₯
Stars: ✭ 228 (+74.05%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
User Bundle
A new Symfony user bundle
Stars: ✭ 116 (-11.45%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Bifrost
This is the stable release of Dolittle till its out of alpha->beta stages
Stars: ✭ 111 (-15.27%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Goes
Go Event Sourcing made easy
Stars: ✭ 144 (+9.92%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Productcontext Eventsourcing
A practical/experimental Event Sourcing application on Product Bounded Context in an e-commerce
Stars: ✭ 88 (-32.82%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
nest-microservices
Small user management system using nest microservices
Stars: ✭ 35 (-73.28%)
Mutual labels:  cqrs, event-sourcing, nestjs
Asombroso Ddd
Una lista cuidadosamente curada de recursos sobre Domain Driven Design, Eventos, Event Sourcing, Command Query Responsibility Segregation (CQRS).
Stars: ✭ 41 (-68.7%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Event Sourcing Castanha
An Event Sourcing service template with DDD, TDD and SOLID. It has High Cohesion and Loose Coupling, it's a good start for your next Microservice application.
Stars: ✭ 68 (-48.09%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
Messagebus
A MessageBus (CommandBus, EventBus and QueryBus) implementation in PHP7
Stars: ✭ 178 (+35.88%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing
fee-office
A DDD, CQRS, ES demo application
Stars: ✭ 35 (-73.28%)
Mutual labels:  cqrs, domain-driven-design, event-sourcing

Otasoft Logo

Otasoft Microservice Template - Template for creating Nest.js microservices

Report Bug Β· Request Feature

CI

About The Project

Otasoft Microservice template - Nest.js based microservice repository template. This project consists of:

  • PostgreSQL Typeorm
  • CQRS
  • Domain Driven Design
  • Event Sourcing
  • Healthchecks
  • .env support
  • RabbitMQ Event Bus Connection
  • Dockerfile and docker-compose
  • doc directory
  • Github workflows and issue templates

Otasoft projects are and always will be open source (MIT Licence). Anyone can use and support the project. The project is currently in the development phase.

Table of Contents

Getting Started

To start developing the project please check if you have these tools installed on your machine:

Installation

  1. Clone the repo
git clone https://github.com/otasoft/microservice-template
  1. Move into microservice-template
cd microservice-template
  1. Install project dependencies
yarn
  1. Copy .env.example file as .env and fill it with your environment variables
cp .env.example .env
  1. Run docker-compose to start development environment
docker-compose up
  1. Run project
yarn start:dev

Testing as a normal web server instead of microservice

  1. Replace bootstrap logic inside main.ts from microservice
  const app = await NestFactory.createMicroservice(AppModule, {
    transport: Transport.RMQ,
    options: {
      urls: [
        `amqp://${process.env.RABBITMQ_DEFAULT_USER}:${process.env.RABBITMQ_DEFAULT_PASS}@${process.env.RABBITMQ_NODENAME}:${process.env.RABBITMQ_FIRST_HOST_PORT}/${process.env.RABBITMQ_DEFAULT_VHOST}`,
      ],
      queue: 'microservice_queue',
      queueOptions: {
        durable: false,
      },
    },
  });

  await app.listen(() => {
    logger.log('Microservice is listening');
  });
  1. To basic web HTTP server
  const app = await NestFactory.create(AppModule);
  await app.listen(3000);
  1. Replace message pattern in controller
  @MessagePattern({ role: 'item', cmd: 'get-by-id' })
  async getItemById(id: number): Promise<ItemEntity> {
    return this.itemService.getItemById(id);
  }

  @MessagePattern({ role: 'item', cmd: 'create' })
  async createItem(createItemDto: CreateItemDto): Promise<ItemEntity> {
    return this.itemService.createItem(createItemDto);
  }
  1. To HTTP methods (with Decorators like @Body(), @Param())
  @Get('/get-by-id/:id')
  async getItemById(@Param('id') id: number): Promise<ItemEntity> {
    return this.itemService.getItemById(id);
  }

  @Post('/create')
  async createItem(@Body() createItemDto: CreateItemDto): Promise<ItemEntity> {
    return this.itemService.createItem(createItemDto);
  }
  1. Test locally with Postman and TablePlus

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

You are welcome to contribute to Otasoft projects. Please see contribution tips

How to support

Otasoft projects are and always will be Open Source.

Core team and contributors in the Otasoft ecosystem spend their free and off work time to make this project grow. If you would like to support us you can do so by:

  • contributing - it does not matter whether it is writing code, creating designs, or sharing knowledge in our e-books and pdfs. Any help is always welcome!
  • evangelizing - share a good news about Otasoft projects in social media or during technology conferences ;)

Contact

Founder -> Jakub Andrzejewski

Special Thanks

This project wouldn't be possible without amazing work of Kamil MyΕ›liwiec and the Nest.js Core Team. Keep doing the awesome work!

License

Distributed under the MIT licensed. See LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].