Giter Club home page Giter Club logo

firechat's Introduction

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.

firechat's People

Contributors

samethope avatar

Stargazers

Mustafa avatar  avatar

Watchers

 avatar

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.