Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sentre - Secure Messenger

Sentre Logo

Secure, Anonymous End-to-End Encrypted Messenger

Build Status Angular .Net 10 License

🌟 Overview

Sentre is a modern, secure messaging application built with privacy and security as core principles. Featuring end-to-end encryption, real-time messaging, and a clean, intuitive user interface, Sentre provides a safe space for private communications.

✨ Key Features

  • End-to-End Encryption - All messages are encrypted using industry-standard protocols
  • Real-Time Messaging - Instant message delivery with WebSocket connections
  • Anonymous Registration - Optional anonymous account creation
  • Responsive Design - Works seamlessly on desktop and mobile devices

πŸ› οΈ Technology Stack

Frontend

  • Framework: Angular 17+
  • UI Library: Angular Material
  • Styling: SCSS with CSS Variables
  • Build Tool: Angular CLI

Backend

  • Runtime: .NET 8 & .NET 10
  • Framework: ASP.NET Core Web API
  • Database: PostgreSQL
  • ORM: Entity Framework Core 10
  • Authentication: JWT with refresh tokens
  • Encryption: libsodium / crypto
  • Real-time: SignalR

DevOps & Tools

  • Version Control: Git
  • CI/CD: GitHub Actions

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL 17.7 (local or cloud)
  • .Net 8 & .Net 10
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/IvanGazul/Sentre.git
    cd Sentre
  2. Install dependencies

    # Install frontend dependencies
    cd frontend
    npm install
  3. Start the application

    # Start frontend
    ng serve
    
    # Start backend
    dotnet run --project Sentre.Presentation
  4. Access the application

πŸ“ Project Structure

Sentre.Frontend/
β”œβ”€β”€ πŸ“ public/
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“ app/
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ message-input/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ message-input.component.html
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ message-input.component.scss
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ message-input.component.spec.ts
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ message-input.component.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ message-item/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ message-item.component.html
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ message-item.component.scss
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ message-item.component.spec.ts
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ message-item.component.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ message-list/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ message-list.component.html
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ message-list.component.scss
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ message-list.component.spec.ts
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ message-list.component.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ notification-container/
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ notification-container.component.ts
β”‚   β”‚   β”‚   └── πŸ“ welcome-page/
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“„ welcome-page.component.html
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“„ welcome-page.component.scss
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“„ welcome-page.component.spec.ts
β”‚   β”‚   β”‚       └── πŸ“„ welcome-page.component.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“ constants/
β”‚   β”‚   β”‚   └── πŸ“„ validation.constants.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“ interceptors/
β”‚   β”‚   β”‚   └── πŸ“„ auth.interceptor.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“ interfaces/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ interfaces.service.spec.ts
β”‚   β”‚   β”‚   └── πŸ“„ interfaces.service.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/
β”‚   β”‚   β”‚   └── πŸ“ chat/
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“„ chat.component.html
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“„ chat.component.scss
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“„ chat.component.spec.ts
β”‚   β”‚   β”‚       └── πŸ“„ chat.component.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ api.service.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ chat.service.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ notification.service.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ session.service.ts
β”‚   β”‚   β”‚   └── πŸ“„ websocket.service.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“„ app.component.html
β”‚   β”‚   β”œβ”€β”€ πŸ“„ app.component.scss
β”‚   β”‚   β”œβ”€β”€ πŸ“„ app.component.spec.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“„ app.component.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“„ app.config.ts
β”‚   β”‚   └── πŸ“„ app.routes.ts
β”‚   β”œβ”€β”€ πŸ“„ index.html
β”‚   β”œβ”€β”€ πŸ“„ main.ts
β”‚   └── πŸ“„ styles.scss
β”œβ”€β”€ πŸ“„ .editorconfig
β”œβ”€β”€ πŸ“„ .gitignore
β”œβ”€β”€ πŸ“„ angular.json
β”œβ”€β”€ πŸ“„ package-lock.json
β”œβ”€β”€ πŸ“„ package.json
β”œβ”€β”€ πŸ“„ README.md
β”œβ”€β”€ πŸ“„ tsconfig.app.json
β”œβ”€β”€ πŸ“„ tsconfig.json
└── πŸ“„ tsconfig.spec.json
Sentre.Backend/
β”œβ”€β”€ πŸ“ Sentre.Application/
β”‚   β”œβ”€β”€ πŸ“ Abstractions/
β”‚   β”‚   β”œβ”€β”€ πŸ“ Data/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ IAppDbContext.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ IChatRepository.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ IMessageRepository.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ ISessionRepository.cs
β”‚   β”‚   β”‚   └── πŸ“„ IUnitOfWork.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“ Messaging/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ IChatHubClient.cs
β”‚   β”‚   β”‚   └── πŸ“„ IChatNotificationService.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“ Security/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ IChallengeService.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ IJwtTokenGenerator.cs
β”‚   β”‚   β”‚   └── πŸ“„ IKeyExchangeService.cs
β”‚   β”‚   └── πŸ“„ IDateTimeProvider.cs
β”‚   β”œβ”€β”€ πŸ“ Common/
β”‚   β”‚   └── πŸ“ Algorithms/
β”‚   β”‚       └── πŸ“„ LevenshteinDistance.cs
β”‚   β”œβ”€β”€ πŸ“ DTOs/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ ChatDto.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ MessageDto.cs
β”‚   β”‚   └── πŸ“„ UserDto.cs
β”‚   β”œβ”€β”€ πŸ“ Features/
β”‚   β”‚   β”œβ”€β”€ πŸ“ Auth/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ Challenge/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ GetChallengeQuery.cs
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ GetChallengeQueryHandler.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ Login/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ LoginCommand.cs
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ LoginCommandHandler.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ Logout/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ LogoutCommand.cs
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ LogoutCommandHandler.cs
β”‚   β”‚   β”‚   └── πŸ“ Register/
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“„ RegisterCommand.cs
β”‚   β”‚   β”‚       └── πŸ“„ RegisterCommandHandler.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“ Chats/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ DeleteChat/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ DeleteChatCommand.cs
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ DeleteChatCommandHandler.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ GetChatMessages/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ GetChatMessagesQuery.cs
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ GetChatMessagesQueryHandler.cs
β”‚   β”‚   β”‚   └── πŸ“ GetMyChats/
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“„ GetMyChatsQuery.cs
β”‚   β”‚   β”‚       └── πŸ“„ GetMyChatsQueryHandler.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“ Conversations/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ Events/
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ ChatCreatedEvent.cs
β”‚   β”‚   β”‚   └── πŸ“ StartConversation/
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“„ StartConversationCommand.cs
β”‚   β”‚   β”‚       └── πŸ“„ StartConversationCommandHandler.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“ Messages/
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ Events/
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ MessageSentEvent.cs
β”‚   β”‚   β”‚   └── πŸ“ SendMessage/
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“„ SendMessageCommand.cs
β”‚   β”‚   β”‚       └── πŸ“„ SendMessageCommandHandler.cs
β”‚   β”‚   └── πŸ“ Users/
β”‚   β”‚       β”œβ”€β”€ πŸ“ GetUserByUsername/
β”‚   β”‚       β”‚   β”œβ”€β”€ πŸ“„ GetUserByUsernameQuery.cs
β”‚   β”‚       β”‚   └── πŸ“„ GetUserByUsernameQueryHandler.cs
β”‚   β”‚       └── πŸ“ SearchUsers/
β”‚   β”‚           β”œβ”€β”€ πŸ“„ SearchUsersQuery.cs
β”‚   β”‚           └── πŸ“„ SearchUsersQueryHandler.cs
β”‚   └── πŸ“„ DependencyInjection.cs
β”œβ”€β”€ πŸ“ Sentre.Domain/
β”‚   β”œβ”€β”€ πŸ“ Constants/
β”‚   β”‚   └── πŸ“„ ValidationConstants.cs
β”‚   β”œβ”€β”€ πŸ“ Entities/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ Chat.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ Message.cs
β”‚   β”‚   └── πŸ“„ Session.cs
β”‚   β”œβ”€β”€ πŸ“ Enums/
β”‚   β”œβ”€β”€ πŸ“ Exceptions/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ ChatAlreadyExistsException.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ ChatNotFoundException.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ NicknameAlreadyTakenException.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ NicknameInvalidException.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ NicknameTooLongException.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ SessionExpiredException.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ SessionNotFoundException.cs
β”‚   β”‚   └── πŸ“„ UnauthorizedChatAccessException.cs
β”‚   └── πŸ“ Primitives/
β”‚       β”œβ”€β”€ πŸ“„ DomainEvent.cs
β”‚       └── πŸ“„ Entity.cs
β”œβ”€β”€ πŸ“ Sentre.Infrastructure/
β”‚   β”œβ”€β”€ πŸ“ BackgroundJobs/
β”‚   β”‚   └── πŸ“„ MessageCleanupJob.cs
β”‚   β”œβ”€β”€ πŸ“ Configurations/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ ChatConfiguration.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ MessageConfiguration.cs
β”‚   β”‚   └── πŸ“„ SessionConfiguration.cs
β”‚   β”œβ”€β”€ πŸ“ Messaging/
β”‚   β”‚   └── πŸ“„ ChatNotificationService.cs
β”‚   β”œβ”€β”€ πŸ“ Migrations/
β”‚   β”œβ”€β”€ πŸ“ Persistence/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ AppDbContext.cs
β”‚   β”‚   └── πŸ“„ UnitOfWork.cs
β”‚   β”œβ”€β”€ πŸ“ Repositories/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ ChatRepository.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ MessageRepository.cs
β”‚   β”‚   └── πŸ“„ SessionRepository.cs
β”‚   β”œβ”€β”€ πŸ“ Security/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ ChallengeService.cs
β”‚   β”‚   β”œβ”€β”€ πŸ“„ JwtTokenGenerator.cs
β”‚   β”‚   └── πŸ“„ KeyExchangeService.cs
β”‚   └── πŸ“„ DependencyInjection.cs
└── πŸ“ Sentre.Presentation/
    β”œβ”€β”€ πŸ“ Properties/
    β”‚   └── πŸ“„ launchSettings.json
    β”œβ”€β”€ πŸ“ Controllers/
    β”‚   β”œβ”€β”€ πŸ“„ ApiControllerBase.cs
    β”‚   β”œβ”€β”€ πŸ“„ AuthController.cs
    β”‚   β”œβ”€β”€ πŸ“„ ChatController.cs
    β”‚   β”œβ”€β”€ πŸ“„ MessagesController.cs
    β”‚   └── πŸ“„ UsersController.cs
    β”œβ”€β”€ πŸ“ Hubs/
    β”‚   β”œβ”€β”€ πŸ“„ ChatCreatedEventHandler.cs
    β”‚   β”œβ”€β”€ πŸ“„ ChatHub.cs
    β”‚   └── πŸ“„ MessageSentEventHandler.cs
    β”œβ”€β”€ πŸ“ Middleware/
    β”‚   └── πŸ“„ GlobalExceptionHandler.cs
    β”œβ”€β”€ πŸ“„ appsettings.json
    └── πŸ“„ Program.cs

πŸ”’ Security Features

  • End-to-End Encryption: Messages encrypted with Curve25519, XSalsa20, and Poly1305
  • Perfect Forward Secrecy: New encryption keys for each conversation
  • Zero-Knowledge Architecture: Server cannot decrypt user messages
  • Secure Authentication: JWT tokens with refresh token rotation
  • Rate Limiting: Protection against brute force attacks
  • Input Validation: Comprehensive request validation
  • HTTPS Only: Secure transport layer encryption

πŸ“± Screenshots

Login page

Login page

Main page

Main page Main with chat

Chats

Covnersation Chats

🀝 Contributing

We welcome contributions to Sentre! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Commit your changes
    git commit -m "Add amazing feature"
  5. Push to your branch
    git push origin feature/amazing-feature
  6. Open a Pull Request

πŸ™‹β€β™‚οΈ Support & Contact


Made with ❀️ for secure communications

⭐ Star this repo | πŸ› Report Bug | πŸ’‘ Request Feature

About

Secure, Anonymous End to End Encrypted Messenger.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages