reactioncommerce/example-storefront

Add Maintenance Page

Opened this issue · 3 comments

Feature Name

Add Coming Soon and Maintenance Pages

Summary description

Provide two a pages for stores which are either (1) not yet launched or (2) undergoing maintenance. In both cases provide the user an experience that allows the user to take some action which continues to grow the business (e.g. a launch email sign-up form).

Rationale for why this feature is necessary

It's standard fare for e-commerce sites. The launch page is expecially helpful for allowing store operators users to log in and view the store in production but before it's launched.

Expected use cases

Prospective customers may sign-up for email notification/newsletter prior to launch.
Store operators may log-in from Coming Soon if they've been given the credentials by the admin.
Admins may demo a production-ready product to stakeholders and gather feedback.
Shoppers receive a more professional experience when the site is down.

Here's an example Coming Soon page I mocked up using Chakra UI:

www jamupuri com_password_(iPad)

Thanks for taking the time to file this issue and preparing a mockup @balibebas!
The example storefront, as the name says, is just an example implementation meant to be customized.
I don't really consider such a screen a priority at all as it is easy to add one based on individual requirements, although I also wouldn't consider it to be an issue to showcase this functionality if someone wants to do a PR.

The issue I see is, that this would either involve some more work or give a false sense of security. To offer a proper maintenance mode, there would me adjustments on the API to maybe store this on the shop document, some admin ui to toggle this and then it could be used during getStaticProps in the storefront to present such a maintenance screen. But the API would actually need to take that into consideration and deny acess to most of the queries apart from shop for non-authorized users.
Also, as we use static generation were possible, still allowing storefront access to some authenticated users could be another challenge and probably be solved by using nextjs preview mode.

Honestly I wouln't expect what I just described to be implemented anytime soon, although I guess such a maintenance mode would be a welcome addition if someone wants to provide PRs for that.

Wonder what @mikemurray and @focusaurus think about this.

A really quick and simple solution instead could be to just add some MAINTENANCE_MODE env variable and accompanying pages + redirects, if others agree that this provides any value to the way they work with the storefront.

Similar to how the IOU payment example works for the API plugins I feel it would be good to keep a custom landing page of some sort present so this rather typical use case will always be considered as refactoring of the app and docs occur. Given not everyone needs a fancy landing page providing some sort of experience for API outages or errors would be nice. So having a maintenance page which appears when one clicks a product during an outage would be useful for most uses.

Closing due to lack of activity