I added a new demo project called ContactForm.Sample at github.com/OviCrisan/ContactForm.Sample. It's just a sample solution with 2 projects, one to show a contact form with both C# and JS / AJAX, which then uses HTTP POST to a web API project, which saves data to a Postgres database. The web API (Contactform.Sample.Postgres) is build as a separate infrastructure project because I intend to add some more API projects for other databases, SQL and no-SQL.
Here's a simple diagram of the projects:
And the regular C# web form with Google reCAPTCHA (demo) enabled:
More technical details are added to readme files in the project source code, including details to run it with Docker compose from Docker containers.
By the way, the project Docker images are also available on Docker Hub here and here.
Comments are welcome. Thanks.
Sunday, November 24, 2019
Monday, November 18, 2019
Seagate external hard drive
Black Friday came earlier this year for me with a new Seagate 6TB external hard drive, for all videos and books scattered of different computers and laptops I use, at home and at work. All good with it so far but it's formatted with NTFS which doesn't quite work on Mac OS. After a bit of digging I found out that Seagate offers a free version of Paragon NTFS for Mac. Installed and tested. Nice.
Thursday, November 7, 2019
ContactForm github project
It's been a while since I wanted to post a personal project on GitHub, with few features I'm interested in: ASP.NET Core MVC and APIs, Azure DevOps, Azure Functions & AWS Lambda, as well as Docker images. Some other features will be covered in another project I'm working on, but let's keep that as a secret until available.
The project I'm presenting now it's called ContactForm and is available at github.com/OviCrisan/ContactForm (see the link on the right side bar). It's meant for a simple contact form processing page, which works with both HTTP POST form data as well as REST API JSON, on the same endpoint (the root of deployed URL). There is more in the readme.md files from the project, with this diagram trying to explain different components:
The core of it is a .NET Standard 2.0 library deployed to NuGet.org (nuget.org/packages/OviCrisan.ContactForm), which then is used in ContactForm.Web (web app + web API), ContactForm.AzFunc (Azure Function) and ContactForm.AWSLambda (AWS Lambda function). Some libraries are using older versions just because AWS Lambda uses .NET Core 2.1, and also at the time of writing this Azure Functions 3.0 are in 'preview' mode.
Depending on the settings in the config file or environment variables it enables email notification and/or webhook posting or REST API call. Also, optionally, you can enable Google reCAPTCHA v2 with visible checkbox. For this last option you need to register your own set of keys or use for testing Google provided samples, which you can find in the readme files in the project.
The web application is also deployed as a Docker image at hub.docker.com/r/OviCrisan/ContactFormWeb, read more here.
The core library and web app have some unit testing projects, but very minimal (using XUnit). Also provided Azure DevOps YAML file for core library continuous integration. Some other additions will be added soon.
Comments, suggestions and bugs reporting are welcome. Thanks in advance.
The project I'm presenting now it's called ContactForm and is available at github.com/OviCrisan/ContactForm (see the link on the right side bar). It's meant for a simple contact form processing page, which works with both HTTP POST form data as well as REST API JSON, on the same endpoint (the root of deployed URL). There is more in the readme.md files from the project, with this diagram trying to explain different components:
The core of it is a .NET Standard 2.0 library deployed to NuGet.org (nuget.org/packages/OviCrisan.ContactForm), which then is used in ContactForm.Web (web app + web API), ContactForm.AzFunc (Azure Function) and ContactForm.AWSLambda (AWS Lambda function). Some libraries are using older versions just because AWS Lambda uses .NET Core 2.1, and also at the time of writing this Azure Functions 3.0 are in 'preview' mode.
Depending on the settings in the config file or environment variables it enables email notification and/or webhook posting or REST API call. Also, optionally, you can enable Google reCAPTCHA v2 with visible checkbox. For this last option you need to register your own set of keys or use for testing Google provided samples, which you can find in the readme files in the project.
The web application is also deployed as a Docker image at hub.docker.com/r/OviCrisan/ContactFormWeb, read more here.
The core library and web app have some unit testing projects, but very minimal (using XUnit). Also provided Azure DevOps YAML file for core library continuous integration. Some other additions will be added soon.
Comments, suggestions and bugs reporting are welcome. Thanks in advance.
Wednesday, November 6, 2019
PostgreSQL 12 on Windows 10
I used previous versions of PostgreSQL, but I installed them with default Windows installer from the website which came with a Windows Service easy to start / stop. This last version 12 I installed with Chocolatey and I couldn't find any Windows Service to start.
So, back to documentation and googling. First I create environment variable PGDATA pointing to a newly created data folder, like C:\pgdata (easier than specify that folder in parameters). Then from C:\Program Files\PostgreSQL\12\bin I ran:
.\initdb C:\pgdata
.\pg_ctl start
.\createuser --interactive
.\createdb test1
Newly created user 'postgres' has the superuser role.
Additionally, you can create other users with passwords to be used by the applications.
Then, I prefer to use Valentina Studio which integrates nicely with Postgres.
So, back to documentation and googling. First I create environment variable PGDATA pointing to a newly created data folder, like C:\pgdata (easier than specify that folder in parameters). Then from C:\Program Files\PostgreSQL\12\bin I ran:
.\initdb C:\pgdata
.\pg_ctl start
.\createuser --interactive
.\createdb test1
Newly created user 'postgres' has the superuser role.
Additionally, you can create other users with passwords to be used by the applications.
Then, I prefer to use Valentina Studio which integrates nicely with Postgres.
Monday, November 4, 2019
Big Azure update today
There are a lot of announcements today from Microsoft Azure specially for Ignite event, some of most important ones in my opinion:
- Introducing Azure Arc - a set of technologies that unlocks new hybrid scenarios for customers by bringing Azure services and management to any infrastructure.
- Azure Data Share - a safe and secure service for sharing data with third-party organizations.
- Autopilot mode for provisioned throughput is now in preview - Cosmos DB should be automatically scalable, otherwise what's the point? Plus new v3 SDK.
- SQL Server 2019 is now generally available
- Azure SQL Database serverless - pay the compute by the seconds of actual use + storage costs
- Azure Functions - v3 preview + PowerShell support + Premium plan GA . I was working recently on a sample Azure Function project but decided to use v2 instead of preview version v3, for few reasons (for instance, to reuse the code with AWS Lambda function).
- Azure Database for PostgreSQL - Hyperscale (Citus) is now available
- Azure Kubernetes Service (AKS) cluster autoscaler
- Azure Spot VMs are now in Preview
- Visual Studio Online is now in preview - VS in the browser, everywhere, cool!
- New Azure API Management developer portal is now generally available
- Free Transport Layer Security (TLS) for Azure App Service is now in preview
- Azure Monitor Prometheus integration is now generally available
Subscribe to:
Posts (Atom)