Skip to content

DaniilPoiarkov/Eclipse

Repository files navigation

Eclipse

Take an action

Open the Eclipse https://t.me/eclipse_app_bot!

Press /start button and choose a language you want to use, you'll be able to change it at any time!

Navigate to Settings ⚙️ menu and set your time. Your account is now configured! Here you can change the language as well in case you missclicked at the begninning.)

On Actions 🖋️ you can whether add some todo items📝 or schedule a reminder💭!

On evenings you'll receive the questionnaire with request to rate your mood. Do not hesitate to answer. After a few days you'll be able to visualize it in Reports 📑 menu! Moreover, every sunday evening Eclipse will send you report automatically!

On Reports 📑 you can also find your Statistics 📈 based on how much reminders you received and todo items finished!

In fewer words, go through menu and try everything by yourself!

Getting started

Build solution in docker

Requirements

  • Docker
  • Ngrok account
  • .NET 9

Step by step

Go to docker directory, create here a copy of docker-compose.override.yaml file with name docker-compose.local.yaml.

Follow instructions in this file to build the solution locally.

After entering all required values for your docker-compose.local.yaml file run .\build.ps1 script.

It will take a few minutes to start web api as cosmosdb emulator takes a while to prepare itself for work.

Check eclipse-webapi container logs.

Run .\stop.ps1 script to stop container. It will also remove the image.

Diagrams

Infrastructure

Service communication within Azure done using Managed Identity. infrastructure-dependencies-x3

Outbox and Inbox messages processing

outbox-and-inbox-processing

Authorization flow

For end user works as MFA-like flow, where instead of password user uses short-lived autogenerated sign in code.

For administration purposes EntraID identity provider used! eclipse-authorization-flow-png

Pipeline concept

This diagram shows how pipeline concept works and how user message proccedes: eclipse-pipeline-flow-png

Assembly references

Eclipse-Project references drawio

Assemblies

General

Basically solution follows Clean Architecture. WebAPI is a presentation layer. Application and Application.Contracts represents use-cases splitted into different assemblies where the first contains implementations and the last one defines public api. Domain and Domain.Shared represents the domain of the application, where the last one contains some domain specific definitions such as enums, constant values etc, which can be shared throughout whole solution. Infrastructure, as probably expected, contains implementations of logic-agnostic abstractions, like cache, background job manager etc. DataAccess responsibility is data persistance and defined in Domain repositories implementations. Common contains general extension methods and application-agnostic abstractions.

Nevertheless there're some assemblies which worth to mention separatelly.

Core

In general represents some sort of mini-framework for building multiple-actions pipelines which requires user interaction with bunch of additional setup.

Pipelines

Contain logic with telegram interaction. In other words it is available for end user functionality. This assembly uses Core for building new features.

Localization

Built on top of Microsoft.Extensions.Localization custom engine to work with json files as resource source with bunch of useful stuff. Additionally provides an api which allows you to use another culture in disposable scope.

Tests

Each Test project reference base Eclipse.Tests assembly, that provides helpers which used through all tests.

Each layer has own test project.

Integration tests also isolated in separate assembly called Eclipse.IntegrationTests.

Integrations

API

  • Google API
  • Telegram API
  • EntraID

Tech stack

  • ASP.NET 9
  • Quartz
  • Azure CosmosDb
  • Polly
  • Scrutor
  • Serilog
  • EFCore
  • Redis
  • Azure Application Insights
  • MiniExcel
  • ScottPlot
  • Docker
  • Terraform

Testing

  • NSubstitute
  • XUnit
  • FluentAssertions (version 7.0.0, planned switching to Shouldly)
  • Bogus
  • Meziantou
  • Testcontainers

Deployment and CICD

  • GitHub actions
  • Azure App Service
  • Terraform

Terraform used for cloud provisioning.

PR policy

Includes build, test, and generate result and coverage reports steps, which will be attached as a comments by github-actions bot.

Merge

Includes build, test, build docker image, and deploy to Azure App Service jobs. Uses Service Principal for deployment with RBAC access.