Personal Projects


"Personal projects make you a better developer"

Like many software developers who are passionate about latest technologies, I enjoy having multiple personal software projects all the time. Sometimes I spend countless night and weekend hours on them and sometimes they get parked for months or even years. These projects give me a chance to work on the technologies or ideas that I cannot usually try at work. In most cases, they will also serve a personal purpose of mine or my contacts. A list of some of my such projects is given under the "My Software" section on this website.

Technolgy Preferences:

  • App Type
    • 1) Universal: These days it makes sense to make one app that runs on all platforms: web, desktops, and mobile phones. Blazor is a good option.
    • 2) Web: If the app need to be accessible outside, go for web applications. I prefer ASP.NET Core with Razor Pages/C#.
    • 3) Desktop: For personal productivity apps, I prefer standalone desktop applications developed using .NET (Win Forms or WPF)/C#
    • 4) Mobile or Multiplatform: Some apps may need to use device specific features and it make sense to use a platform that targets both iOS and Android and I prefer .NET Multi-platform App UI or NET MAUI
  • Data Storage
    • 1) Files: For single user or simple apps, I prefer data to be stored on file system itself by serializing the whole app data model class as encrypted binary data or simple XML format. This avoids the overhead of a database system, and makes everything faster as whole app data can be loaded to memory on startup.
    • 2) SQLite: is my next favourite free file based database.
    • 3) SQL Server: For any serious projects, SQL Server is still the best option and it makes it easier to manage if it is on Azure.

Development Environment

Hosting

Firebase hosting is a Google hosting service which provides static web content to the user in a secure, fast, free and easy way. It by default provides free subdomains on the web.app domain that has SSL certificate.

  • Install Node and NPM if not there from https://nodejs.org/en/
  • Install firebase tools using command prompt: npm install -g firebase-tools
  • Create a new project on Firebase at https://firebase.google.com/
  • Add a web app to this project (Choose a new subdomain than the project one, copy paste the script tags to index.html)
  • Using command prompt, navigate to the root folder of the project, not specific web app
  • Login there using gmail id and password with the command: firebase login
  • Initiate the project there: firebase init (Choose hosting, and go with default options)
  • Once completed, define target: firebase target:apply hosting Coolwayfarer Coolwayfarer
  • Edit the firebase.json file to add site configs.

    {
    "hosting": [ {
    "target": "GetCool",
    "public": "GetCool",
    "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
    ]
    },
    {
    "target": "Coolwayfarer",
    "public": "Coolwayfarer",
    "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
    ]
    }
    ]
    }
  • Copy all publish content to the folder and then run firebase deploy to deploy all sites or run firebase deploy --only hosting:Coolwayfarer to deploy a specific site.

Development

Pre-requisites

Project Creation

  • Open VS > Create a New Project > MudBlazor Templates > Project Type (Server)

Authentication and Autherization without Identity

  • https://www.youtube.com/watch?v=iq2btD9WufI

    Sqlite Database access using Dapper

  • Add package reference: Microsoft.Data.Sqlite, Dapper, Dapper.SimpleCRUD

  • Add an App_Data folder
  • Add connection string in appsettings.json: "ConnectionStrings": {"CoolBMSContext": "Data Source=App_Data\CoolBms.db"}
  • Add a DataContext class for creating connection and initializing database
  • Add model class and service class to access data
  • In Program.cs, add context and service class
  • https://www.c-sharpcorner.com/article/implementing-dapper-in-blazor-server-application/

    Publish

  • Rt Click project > Publish > Create new profile > Azure Web App (Windows) : Login using Azure microsoft account and choose the app and complete.


About Me
Hi, I'm Sameer. I love anything technology related and have chosen the field of Information Technology for my profession. I'm passionate about travel and never miss any chance to Read more...
Disclaimer
The views expressed on this website, be they in text, pictures or sound, are my own and not those of my business, university, employer or colleagues. Any points of Read more...