User and Account management for SaaS using Golang

Software-as-a-Service usually provides its service after a user has created an account and authenticated. The web-app service in the Golang SaaS Starter Kit has extensive functionality for signup and authentication.

Go Templates for the User and Account pages

The web app pages for user and account management use this base layout:
saas-starter-kit/blob/master/cmd/web-app/templates/layouts/base.gohtml

The base layout wraps the authenticated pages in the web app with this additional partial layout:
saas-starter-kit/blob/master/cmd/web-app/templates/partials/app-wrapper.tmpl

Go code for SaaS Customers to View and Update Account

example Go code of account view in SaaS web app

Once a user signups to your SaaS via the web app, an account is created. This functionality demonstrates the read operation of CRUD.

example.saasstartupkit.com/account

saas-starter-kit/blob/master/cmd/web-app/templates/content/account-view.gohtml

example Go code of account update in SaaS web app

Users with role of admin can view and update the details of their account, while non-admins can only view the details of their account.

example.saasstartupkit.com/account/update

saas-starter-kit/blob/master/cmd/web-app/templates/content/account-update.gohtml

Go code for Users to View and Update their Profile

example Go code of user profile view in SaaS web app

After users authenticate with the web app, there is example code for them to view their user details - view their profile.

example.saasstartupkit.com/user

saas-starter-kit/blob/master/cmd/web-app/templates/content/user-view.gohtml

example Go code of user profile edit and update in SaaS web app

A user can then update the details for the record of their user as another example demonstration the update operation.

example.saasstartupkit.com/user/update

saas-starter-kit/blob/master/cmd/web-app/templates/content/user-update.gohtml

example Go code of user password change in SaaS web app

The update my profile page also allows the user to change their password.

Go code for Listing Users

example Go code of listing users index for management in SaaS web app

Users with role of admin have access to functionality that allows them to manage the users associated with their account. This index page uses Datatables to demonstrate providing advanced interactivity to HTML tables.

example.saasstartupkit.com/users

saas-starter-kit/blob/master/cmd/web-app/templates/content/users-index.gohtml

Go code for Creating User and Inviting Users

example Go code of creating user in SaaS web app

From the users index page, users can access the functionality to create a new record. This create page demonstrates how a new record can be created for users. The create functionality also allows one or more roles to be applied for ACLs.

example.saasstartupkit.com/users/create

saas-starter-kit/blob/master/cmd/web-app/templates/content/users-create.gohtml

example Go code of user invite in SaaS web app

If the admin would rather the new users provide their own user details, there is Go code demonstrating how users can be invited. The invite functionality allows users to specifiy one or more email addresses. Once submitted, the web app will send email invites to allow the users to activate their user.

example.saasstartupkit.com/users/invite

saas-starter-kit/blob/master/cmd/web-app/templates/content/users-invite.gohtml

example Go code of inviting users in SaaS web app

Once users are invited, the status of those users remains as invited until the user(s) accept their invitation.

Go code for Admins of Account to View and Update Users

example Go code of admin user view in SaaS web app

From the users index page, admins for an account can view users details. This page also provides access to update the user as well as archive it.

saas-starter-kit/blob/master/cmd/web-app/templates/content/users-view.gohtml

example Go code of admin user update in SaaS web app

A user can then update the details for the record of their user as another example demonstration the update operation. As part of ACL, the roles for a user can be added or removed.

saas-starter-kit/blob/master/cmd/web-app/templates/content/users-update.gohtml

custom date time formatting

example Go code to customize date time format in SaaS web app

The web app service in the SaaS Startup Kit also provides functionality for the format of the date time to be customized. The format can be set as a default for the account as well as users can set their own format for date time.

saas-starter-kit/blob/master/internal/platform/web/models.go#L45

Provide Feedback via our Google Slides

If you would like to provide us feedback on any of these screen captures and associated functionality, you are welcome to publicly comment on our Google Slides:

Open in Google Slides