Hello Internet!

Sat Mar 20, 2021

No comments 124 reads

Uncategorized / Off Topic

armin-zia

Finally, Pegasus is live after 11 months of hard work. This is my first post on Pegasus, I'm super excited about my new website and there's so much I'm planning to do in 2021. I started this project last year (March 2020) and it's been a great opportunity to upgrade to new technologies, develop my skills further and learn new things. 2020 has been crazy, and incredibly boring at times, what a rollercoaster. But it's also been a great year to focus on work and personal development. A lot has happened in the software industry too over the past year and the future looks very promising. Lots of improvements and new technologies to build with. Follow along if you're interested to learn more about Pegasus and what I've been working on lately.

Pegasus, a blog engine for ASP.NET Core

I've always wanted to have a personal website, blog about my work and share interesting things that I learn, open-source my pet projects and have a repository of useful resources. A few years ago, I started building a blog engine with ASP.NET on the .NET Framework 4.x. I didn't want to use an existing platform like WordPress, or static site generators like Jekyll and Hugo. I could, and that would have meant saving tons of time, and instead of building a website myself, I could focus on the content and by now I would have had hundreds of useful posts. But I wanted to build everything myself, for several reasons. I wanted to have a real-world application to work on and learn more as a developer. Everything from design to implementation and testing, setting up and maintaining web servers, etc. It took me a few months and I built a really nice website using ASP.NET MVC written in C#. It worked great, looked great on mobile and desktop, supported localization (Persian/English) and it had every feature a good blog engine would offer. I launched that website over 4 years ago and even though I was happy with it, unfortunately, I didn't find the time to populate it with high-quality content and achieve the goals I had in mind. I was always busy working as a full-time lead developer and it wasn't easy to keep up with the pace. If you've ever worked as a lead developer or a CTO, developing a startup from scratch, you'd know how much work that entails (A LOT ðŸ˜Ŋ).

Last year around March, I really wanted to start blogging seriously. I had tons of stuff to share, many small and large pet projects to open source and I really needed a repository for future reference too, even if just for selfish reasons. I had a look at the old website and even though it worked great and I could maintain it, it wasn't worth the effort. I thought this would be a great time to migrate to newer technologies and apply what I've learned over the past few years. So I started Pegasus, a blog engine for .NET Core. At the time, .NET Core 3.1 was available which was fantastic. I started porting the existing project and in less than 2 months I had a working prototype. At first, I wanted to build a SPA (Single-page application) instead of a multi-page website. SPAs are fun to develop, the user experience is great, and I could move away from server-side rendered views and jQuery scripts for wiring up user interactions. The first version of Pegasus was a RESTful API plus an Angular SPA. It was great and I was loving it, but soon I realized it's not a good solution in the long run.

Single-page applications are heavy, users would need to download a few megabytes of JavaScript before they can interact with the app. Perhaps that's not an issue nowadays thanks to 4G networks and great bandwidth available to almost everyone, but still, SPAs are huge especially for mobile devices. Another issue with SPAs is SEO optimization. I could use Angular Universal or Rendertron to take care of that, but that's overkill. Single-page applications are great for web apps, but not for websites that need to load fast, be available to search engines and social platform crawlers, and don't have heavy user interactions. So I needed to make changes to Pegasus, but at the same time, I didn't want to lose my Angular SPA either. Ideally, what I wanted to achieve was to have a RESTful API and a single-page application for the admin dashboard, and have public views rendered server-side, best of both worlds.

To my surprise, I couldn't find helpful documentation or resources as to how to build a hybrid app with ASP.NET Core and Angular (or whatever web framework) to achieve what I was looking for. The SPA project templates in Visual Studio are good starting points, but you'll notice that there are several problems with those templates. Most notably, all unknown routes (routes that couldn't be matched against your MVC controllers) would be redirected to your single-page application. That's a problem, because in those cases what we want is an HTTP 404 response. Plus, the search engines need hard responses too, if a route doesn't exist, the website should write an HTTP 404 response. I spent a month or so wrestling with Angular Universal and tried to wrap my head around server-side rendering with ASP.NET. There are some plugins and open-source projects but they were all out-dated and none of them helped really. Finally, I found the solution and finalized the next iteration of Pegasus, perfect!

That's actually one of the greatest things that I've learned over the past year and I'm going to write a tutorial series on that. I couldn't spend too much time on Pegasus because I'm working as a full-time lead developer, so it took me longer than I wanted it to, but long story short, after almost a year I've finished this project and I'm very excited about the coming months. I have so much to share on my new website. Tutorial series, tips & tricks, tools and resources, sample projects, and more. Hopefully, others will find this website useful too and it'll be a great developer blog in no time. I published my new website last night (March 19th) and it's under active development. Over the next couple of months, I'm going to improve the UI and develop more features, and once I'm feeling good about the code quality I'm going to publish the source code on Github.

What you can find on this website

This is my personal website and resume, you can learn more about me, read my blog, or get in touch. Soon, I'll update the app and add more features and sections like a newsletter subscription, open-source projects, etc. The sidebar should help you navigate around but you can also search for what you're looking for, or list all posts in the Archive. You can find an RSS and Atom feed for my blog and additionally, categories and tags have their own feeds as well. The links section (found on the top navigation bar) is a repository of useful links. I needed this for myself, to organize curated lists of resources, libraries, and websites, tools, etc. Hopefully, others will find this section useful too. Links are organized under categories and subcategories, links that don't have a subcategory are filed under Miscellaneous. The comments channel is available to everyone, you can post anonymously without needing to authenticate. Your email address is never shown, they're only used for Gravatar. However, comments are published after moderation. You can reply to previous comments too. The content editor for comments is limited to basic formatting, but you can insert code snippets if need be.

What I'm working on right now

Since April 2017 I've been working as a lead developer at ONRECORD. Over the past four years, we've been working hard on an ambitious startup and we've had excellent feedback from our users so far. I have been responsible for everything from conception to design and implementation, testing and maintaining web servers and certificates, and everything else in between. In late 2019, we were discussing migrating to new technologies and upgrading our tech stack. Not just for new features and performance gains, but because our toolchain was out-dated and it was getting increasingly more difficult to develop new features and maintain the solution. A little over a month after I started working on Pegasus, I also started rewriting our solution from scratch. It took me a few months to redesign the database, and port the core features over, but it was definitely worth the effort. I'm very happy with the result, and we're very close to a production-ready version. The new platform is going to be published on Microsoft Azure and supports subscriptions too. I have learned so many things over the past four years working on ONRECORD that it's just crazy how much I have grown as a software developer, I'll forever be grateful for this opportunity. And just in 2020, I have made tremendous progress which is another reason why I'm so excited about my new website because I have tons of good content to share with the community.

Currently, I'm working with C# 9, .NET 5, ASP.NET Core, SignalR, Angular 11, TypeScript, Stripe, and numerous open-source tools and libraries. I'm still figuring out how to structure my content on this new website, but I'm committed to organizing my content and sharing it with you all. I believe blogs are a two-way communication channel so I accept comments too, although I may turn off comments on certain posts. Can't wait to start blogging here, the first step is always the hardest, and this was my first post so, there we go!

Our new year (Nowruz) is just around the corner, tomorrow at 1:07 PM. This one is a leap year, and we're entering a new century too. Exciting, as it's also a Saturday new year's even, very rare! I wish everyone a happy new year, health, and success. Hopefully, 2021 is going to be an even better year, and less boring than 2020 (don't even get me started on COVID-19 ðŸĪš). That's a wrap, I look forward to sharing everything I've learned as a software developer with the community, engaging with my audience, and having great conversations. Keep a strong spine, live long, and prosper 🖖.

Posted in Uncategorized

Tagged Off Topic