Categories
.NET Core

Get started with ABP framework on a Mac

In this post we’ll explore setting up the popular ABP framework for .NET Core on a Mac with a Postgres database.

In case you’re unaware, the ABP framework offers a number of out of the box features that can save a tremendous amount of time when starting a new web application. This includes a strong and opinionated architecture based on domain driven design, as well as multi-tenancy, theming and more.

Getting your environment setup

In this post we’ll explore getting the basic ABP app with Blazor up and running on a Mac.

Firstly, if you haven’t already done so download and install the latest .NET Core 5 SDK from Microsoft’s site.

Once installed you’ll want to add the ABP command line tools. These will allow you to quickly scaffold projects and code. This can be installed by opening the Terminal.app on your Mac, and running this line of code:

dotnet tool install -g Volo.Abp.Cli

If you’re running a more recent version of macOS – such as Big Sur – you’ll now be using ZSH by default instead of Bash in the Terminal app.

Try running the command abp --help. If you get a message stating that abp is not a known command, you may need to create a .zshrc file to allow you to access the ABP CLI from ZSH. Within Terminal, run the following commands:

  1. vi ~/.zshrc
  2. Paste export PATH=$HOME/.dotnet/tools:$PATH
  3. Run the command :wq to write the file to disk and quit
  4. Restart Terminal.app and you should be able to run abp --help

Creating the ABP project

Create a new folder called ToDoProject. Navigate to it from within Terminal, and run the following command:

abp new TodoApp -u blazor-server

This creates a new .NET Core solution based on the ABP framework.

If you’re on a Windows machine, normally you would now run the DbMigrator project to setup your database tables. However by default the ABP project uses LocalDB which is unavailable on the Mac.

As an alternative, you can use Postgres which IS available for the Mac.

The easiest way to install Postgres is to download and install the Postgres.app for free. Once launched, you can then install an app like Postico or use the command line to create a new Postgres database.

If using Postico, connect to your localhost Postgres server either via the server settings within Postico, or by double clicking the server from within the Postgres app.

Then, navigate to your server within Postico by clicking localhost in the top navigation bar. Click “+ Database” and add a new database called todoapp.

Click these buttons to setup the new database

Now we need to make some changes to the sample ABP app. Open the TodoApp.sln in your editor of choice (for the Mac this can include Visual Studio for Mac, Visual Studio Code or Rider).

Next replace the SQL package with Postgres. Add the Volo.Abp.EntityFrameworkCore.PostgreSql package via Nuget, and remove Volo.Abp.EntityFrameworkCore.SqlServer.

Then follow the rest of the steps in this article to update your project files to use the new Postgres package.

Lastly you’ll need to update the connection strings for your database.

Open src/TodoApp.Blazor/appsettings.json and update the following line to connect to your Postgres database, updating `<your username>` with your database username (for a Mac this is normally your Mac login username, unless you’ve specified a new user):

"ConnectionStrings": {
  "Default": "Server=localhost;Port=5432;Database=todoapp;User Id=<your username>/;Password="
}

Similarly, open src/TodoApp.DbMigrator/appsettings.json and update the same connection string:

"ConnectionStrings": {
  "Default": "Server=localhost;Port=5432;Database=todoapp;User Id=<your username>/;Password="
}

From within your IDE you should now be able to build and run your app, or from the Terminal app run dotnet run to see your first ABP web app running!

Categories
Microsoft Graph

How to export Microsoft Teams chats

Looking to export chats within Microsoft Teams? Exporting chats from Teams is an oft-requested feature, but at the moment there’s no out of the box functionality available for end users.

If you’re an end user

If you don’t have admin rights, at present your options are limited for exporting chats from Teams especially while using a work Office 365 account.

Easily export your Teams chats

Be one of the first to try our new Teams chat exporter app. Whether you’re an admin or an end-user, this is the tool for you!

‚Äč

Export your Microsoft Teams chats into HTML, PDF & more.

    We respect your privacy. Unsubscribe at any time.

    If you’re using a personal Microsoft account with Teams, you may be able to export your messages following the steps listed here.

    For work accounts, one option is to setup a workflow using Microsoft Flow to call the Microsoft Graph API and convert individual chats to HTML or a PDF file.

    An alternative is to call the Graph API endpoints to retrieve messages and conversations yourself as part of your own script/program, although that has a higher degree of complexity when compared to using a tool such as Microsoft Flow. These endpoints are also in beta.

    If you’re an admin

    The options are still quite limited, but you can try and use the eDiscovery tools available in Office 365 to retrieve messages from channels.

    Categories
    Cloud

    Integrating Gumroad and WordPress

    Gumroad is one of the hottest new ways for creatives to sell their products and services online. And with WordPress being one of the most popular content management systems in the world right now, in this post we’ll explore how you can connect both systems together to offer paid products and services from your WordPress blog.

    There are 3 ways in which you can connect Gumroad with your WordPress site:

    • Via the free, official Gumroad plugin
    • Using the HTML embed codes
    • Via a paid third-party WordPress plugin

    Free, official Gumroad plugin

    Free (WordPress Plugin Marketplace)

    This is the easiest free way to connect Gumroad and your website. You simply install the free Gumroad plugin from the Plugins section of your WordPress administration site.

    The plugin adds a Gutenberg block that can be used within your content.

    Unfortunately that’s about as advanced as you can get when using the official plugin. There’s no support for syncing paying customers between Gumroad and WordPress for sites such as online courses or membership areas. For that you’ll need to use a third-party plugin.

    HTML embed codes

    Gumroad provides HTML code that you can manually insert on your product pages within WordPress.

    You can choose from an overlay, where a customer performs the entire flow from within a modal window on your site or an embed which can redirect customers to the Gumroad site to complete the transaction.

    To generate the code, simply open your product within the Gumroad website, click “Share” and copy and paste the code from either “Overlay” or “Embed” into your WordPress post.

    3rd-party WordPress plugin

    If you’re looking for something more advanced – perhaps to restrict your content & blog posts to paying customers – then you may want to turn to a premium third-party WordPress plugin.

    ProductPress (paid, pricing starting at $39) is one of the more established products in this space, allowing you to setup sites for things like online courses and membership sites.

    These plugins rely on the Gumroad API to integrate deeper into your WordPress installation – so make sure if you are using a third-party plugin that it’s legitimate and not going to compromise your customer data or Gumroad account.