Skip to content

A chat app demo for Windows made for practice and example purposes using WPF and Firebase Realtime Database with FireSharp.

License

Notifications You must be signed in to change notification settings

SametHope/FireChat

Repository files navigation

FireChat

A chat app demo for Windows made for practice and example purposes using WPF and Firebase Realtime Database with FireSharp.

More information about the techs used and images of the app as well as the database and project structure are listed below.

Frontend

  • Technology: Windows Presentation Foundation (.Net Framework 4.8) themed with MahApps.Metro.
  • Choice Rationale: Opted for WPF due to its suitability for rapid development and lack of cross-platform requirements. Would consider Avalonia if cross-platform functionality were needed.
  • Framework Version: Selected .Net Framework 4.8 for WPF as it's pre-installed on modern Windows machines, eliminating the need to package the runtime with the app. Utilized build tools/extensions for a compact build.

Backend

  • Database: Used Firebase Realtime Database with FireSharp as the API.
  • Implementation: Backend operations are mainly handled in a single class named ChatDatabase, a basic wrapper around FireSharp tailored for my usage, utilizing FireSharp API features such as FirebaseConfig, FirebaseClient, Client.GetAsync, Client.SetAsync, Client.DeleteAsync, Client.PushAsync, and Client.OnAsync.
  • Security Measures: Used Bcrypt.Net-Next for hashing and salting passwords before storage in the database, caring for security even in a demo environment.

Images

Login Window

Ekran görüntüsü 2024-05-09 105343

Register Window

Ekran görüntüsü 2024-05-09 105501

Chat Window

You can see 2 messages sent by the currently logged in client. The username and the nickname is visible on the title.
You can also choose to set your nickname as "anonymous" on your messages if you want to. The actual senders username is still sent to the database.

Ekran görüntüsü 2024-05-09 105726

Chat Window Fullscreen

I used the Grid control to scale up the height of the messages ListView when relevant so more messages can be viewed on fullscreen and made the app more responsive.
Also noticee this image is from another client with a different logged in account.

Ekran görüntüsü 2024-05-09 110106

No Connection Screen

This screen is displayed if the connection with the database is not established.

Ekran görüntüsü 2024-05-09 110222

Project Solution Structure

The DatabaseTester class is made for console apps and I left it on the project as a reference.

Ekran görüntüsü 2024-05-09 115456

Database Structure

Usernames are used as primary keys. Message keys are generated by Firebase/FireSharp itself when they are pushed into the Messages table.

Ekran görüntüsü 2024-05-09 112619

Notes

Security

  • The secret key and database path are hardcoded.
  • This setup suits my use case as I'm on a Spark (free) account; excess requests are simply denied by the server.
  • Permissions are not configured, meaning anyone can manipulate data. Exercise caution and avoid using real passwords.

Miscellaneous

  • The project lacks a proper commit history due to not starting with version control. In fact, almost all of the commit history is readme updates.
  • Originally developed using Winforms, but due to compatibility issues with my custom DPI settings, I rewrote the app using WPF.
  • I considered Avalonia when Winforms became problematic first, but with my knowledge of WPF/xaml/MVVM led to choosing WPF as it would be easier and Avalonia would simply be overkill.
  • Opting for WPF also reduced the executable size to ~2.5 MB, which I find favorable.

About

A chat app demo for Windows made for practice and example purposes using WPF and Firebase Realtime Database with FireSharp.

Topics

Resources

License

Stars

Watchers

Forks

Languages