/job-app-deltatre

A quick demo of a REST API and gRPC with clean architecture, CQRS, event-driven design, TDD, DDD, mediator pattern, IoC (dependency injection), repository pattern, and docker

Primary LanguageC#

A simple microservice project with API as the front-end service and a gRPC application for back-end service.

Patterns / Tech used:

  • multi-tier / onion architecture
  • event-driven design
  • service layer pattern
  • inversion of control (IoC, DI)
  • CQRS (partially)
  • mediator pattern
  • repository pattern
  • DDD, TDD
  • c#, dotnetcore 3.1
  • gRPC. (this is my first time using this tech. spent most of my time exploring)
  • docker - due to issues with SSL, this can't be used to run the services. please refer to section "How to run locally"
  • used a template project that I created (still in progress though): https://github.com/markglibres/dotnetcore-api-template/tree/master/src/workingdirectory

Pre-requisites:

  • dotnetcore 3.1 <
  • powershell or bash

How to run locally

  1. open powershell or bash then clone project
git clone git@github.com:markglibres/job-app-deltatre.git
  1. change directory to /job-app-deltatre/src
cd ./job-app-deltatre/src/
  1. run tests and build project with this command
./build.sh
  1. run services with this command
./run.sh

or

./run.sh --skip-build
  1. open up browser to check health status of API (front-end service) http://localhost:5000/health
  2. click Ctrl+C to stop services. (failure to do this might not kill the process. you have to manually kill the process for ports 5000 & 50001)

Api endpoints

  1. Get top searched words:
  2. Search for a single word:
  3. Update list of words. (will not add duplicated words)

NOTES for demo purposes:

  • test coverage is not 100%.
  • AutoMapper wasn't used.
  • Swagger wasn't included
  • docker-compose was the initial plan to run services, but have issues dealing with SSL within docker, so have to create shell script instead
  • was planning to implement 1 simple end-to-end test using node.js & jest, but was running our of time
  • data is not persisted. list of words are stored in memory.