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
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
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
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
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
Go code for Listing Users
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
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
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
Go code for Admins of Account to View and Update Users
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
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
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: