Git Product home page Git Product logo

superchat-backend-challenge-ando's Introduction

Superchat - Backend Technical Challenge

Author: An Do


I try to design and implement the challenge with microservice design in mind. However, the setup and configuration of microservices quickly grows and draws too much effort that distract me from real business logic. Nevertheless, I decided to take a hybrid approach:

  1. Module packages under de.superchat could be viewed as microservices on their own. You might expect some model duplication due to this nature.
  2. Database tables are designed to be used in their own service context boundary. The only exception is auth and user services share user table.
  3. Internal communication are done by REST client and context propagation. No service discovery registration.
  4. No API gateway. I intended to add Nginx as API routing but because we keep code in one place and run in same Quarkus instance. There is no more need.

Assumptions

I assume a couple of things during the development:

  1. Only local dev environment supported, no production build.
  2. No realtime chat supported.
  3. I actually created source table with external webhook. However, I end up to not support creation and chatting with external users. The main focus for webhook is to "receive messages from an external service via a webhook", not communicate with them.

Tech stack

  1. Language: Java(sorry, not Kotlin!)
  2. Framework: Quarkus
  3. Database: Postgres
  4. Messaging: Kafka
  5. ORM: Hibernate
  6. Build tool: Maven
  7. DevOps: Docker

LOCAL UP AND RUNNING

To ease the development, dependencies(Postgres, Admininer, Kafka) start in docker containers. However, the quarkus application itself run directly in localhost using Maven.

See START_AND TEST_GUIDE

Logging and debugging

DEBUG log files are generated under logs/ folder.

Adminer is deployed at http://localhost:8082/. You could manage Postgres DB with its simple UI. Use below configuration to connect:

  • username=superuser
  • password=superuser
  • host=superchat-postgres
  • database=superchat_database
  • schema=public

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.