Skip to content

teghoz/the-room-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

the-room-demo

Instructions and Questions here.

Here are my answers 👌.

Getting Started

Make sure you have installed and configured docker in your environment. After that, you can run the below commands from the /src/ directory and get started with the TheRoomContainers immediately.

docker-compose build
docker-compose up

Project Structure

I have approached the problem in both a microservices and monolithic way.

Monolithic Approach

Once the container is loaded up 🚀, you can get access to the TheRoomSimpleAPI service. It is standalone and performs all its activity itself. You would have to use the /api/v1/Auth/Register endpoint to get registered and logged in. An unthentication token would be provided in the response which you would use to access the other endpoints. It has its swagger documentation so you would have a means to see all the available options and test it directly.

Simple API in action

You have to pass in a bearer token to access the endpoint sitting behind authentication. All you have to do is insert Bearer eyuuiouio.............. into the modal that comes up after clicking on the padlock icon on the endpoint you want to access or you can use the authorized button above.

Microservices Approach

In this approach I have splitted out the concerns into different isolated services. The following are the services:

  • Identity Server. Find out more here and here

  • ServiceList Service - Which just handles the list of all services.

  • Bonus Service

  • RabbitMQ - which servers as the message broker on development. Do note that you have to register a new user in order to use the functionality *Default Username is the_root and Password is Pass@word

  • Web Status - Which polls the services to report health checks.

  • SQL Server - which houses some of the sevices databases.

  • MongoDb - which the bonus service would use.

  • Seq - which handles logging

Frontend Client - React

  • React - The react app gets authorized by the identity server and stores its token in localStorage. With that it gets access to the ServiceList Service which provides information about the service lists.
React app

Do note that i did not spend alot of time on the aesthetics as a result of time constraint

Auth service in action

ServiceListAPI Swagger

ServiceListAPI Sample Request

Testing

I have also showcased Unit Testing and Integration Testing for the ServiceListAPI Services.

I have use AutoFixture to mock sample data on the Unit Test and the awesome .Net TestHost for integration testing.

Outstandings
  • Bonus API Service
  • Aesthetics Improvements
if you are experiencing challenges from the docker side, you can run the projects directly on Visual Studio while the containers are up.