d-avko / Vibechat.Core

Telegram-like messenger created with ASP.NET Core 3.0 and Angular 8: features end-to-end encrypted chats, SMS login system & more.

Home Page:https://denisavko.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vibechat - Simple ASP.NET Core messenger

ASP.NET Core Messenger: PWA Asp.Net core & Angular messenger that features Groups, dialogs, end-to-end encrypted chats. Uses mobile phone login system (firebase is used as SMS provider) and tokens based authorization. Running at https://denisavko.me, UI Api: https://denisavko.me/swagger/ui/index.html

Messaging User profiles
1 2
Side drawer Group profiles
3 4
Search Start view
5 6

Plan:

Back-end overview:

  1. Authorization & login system.
  2. Messaging.
  3. End-to-end encrypted chats.
  4. Database.
  5. Storage.
  6. Publishing.

Front-end:

  1. Tech stack.

Authorization & login system

  • Login system & registration: to register or log in, user must have a valid phone number. If user logs in for the first time, he'll be asked to change his auto-generated username.
  • Sms provider: For free SMS ( 10k/mo ) firebase was used. See link to get started.
  • Tokens: After user logs in, he'll be granted a JWT refresh token - token with long expiration date, which, in turn, needed to get short-term tokens.

Messaging

For messaging and push-events SignalR was used.

End-to-end encrypted chats

Standard Diffie-Hellman scheme was used. Public keys are 2048 bits length and pre-generated on server. On secure chat creation, client which creates secure chat sends a request to server whereupon server fires push event on this client with created secure chat. Now the client needs to initiate key exchange. Key exchange could be initiated in 2 ways: immediately(if user in dialog is online), or via subsription system: when second client comes online, key exchange will be initiated.

Storage

For storage, Kestrel with PhysicalFileProvider was used.

Database

EF Core with PostgreSQL provider was used.

Publishing

Deployment of fileserver
  1. docker build -t vibechat.fileserver .
  2. docker save -o <Output path> vibechat.fileserver
  3. On linux VM: docker load --input <filename>; docker run -p 5000:5000 -e ASPNETCORE_URLS=http://*:5000 vibechat.fileserver --mount source=fileserver_volume,target=/app vibechat.fileserver.
Deployment of database, front-end and back-end:
  1. docker-compose build
  2. Save database image and back-end image, and load them onto your VM, as shown above.
  3. docker-compose up
  4. Install nginx, copy config file, run nginx.

Front-end

Framework and UI: Angular 8: internationalization (i18n), UI components(Angular material).

About

Telegram-like messenger created with ASP.NET Core 3.0 and Angular 8: features end-to-end encrypted chats, SMS login system & more.

https://denisavko.me

License:MIT License


Languages

Language:C# 57.1%Language:TypeScript 31.1%Language:HTML 9.2%Language:CSS 1.9%Language:Dockerfile 0.3%Language:JavaScript 0.2%Language:Python 0.1%Language:Shell 0.0%