OpenSAAS for a Course website
I'm in the process of launching a SaaS website aimed at selling text-based courses. I successfully deployed a minimal version of the website using a template from OpenSaaS. However, I'm at a crossroads regarding how to proceed further. While the Astro documentation engine appeared promising for integrating my course content, it redirects users to a different page or user experience (UX), which deviates from my goal of keeping everything unified within the main application.
I'm seeking recommendations on how to implement a dedicated section for my text-based courses that supports authorization with both free and premium (Pro) access levels. Specifically, I want to ensure that certain sections of the course are exclusively visible to Pro users. Could you advise on the best approach to achieve this while maintaining a seamless user experience within my main app?
7 Replies
Hi @anthonyk8375. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Sure, I can provide some guidance based on the information available in the knowledge sources.
Firstly, you can add a
role
field to the User
entity in your Wasp application. This role can be used to determine the access level of a user (free or Pro). You can then use this role in your queries/actions to decide if a user should be able to access certain sections of your course content. If they are not allowed, you can throw an HTTP error 403 or something similar. This approach is mentioned in a Discord support thread (https://discord.com/channels/686873244791210014/1211733266235916358).
For an example of how to implement role-based access control, you can check out the open-saas template provided by Wasp. It comes with the concept of admins and even has an admin dashboard in it. You can find more details about this template here (https://wasp-lang.dev/docs/project/starter-templates#available-templates).
As for integrating your text-based courses into your main application, you might need to create new pages and actions. Wasp provides a tutorial (https://wasp-lang.dev/docs/tutorial/queries) on how to add pages and actions to your application.
Remember, the goal is to keep the user experience seamless within your main app. So, while integrating your course content, ensure that the design and navigation are consistent with the rest of your application.
Lastly, keep in mind that while Wasp and OpenSaaS provide a great starting point, you might need to write custom code to fully realize your vision for your SaaS website. This will require knowledge of React, Node.js, and Prisma, as mentioned in another Discord thread (https://discord.com/channels/686873244791210014/1206921679608090646).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @anthonyk8375, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?@Vinny (@Wasp) do you have some thoughts on how would you do it? 🙂
hmm. good question.
My first though would be to check out MDX and use that to author markdown content with react/jsx components in it, and keep everything within the Wasp app, so that you can protect certain pages and authorize users that way
https://mdxjs.com/
MDX
Markdown for the
component era | MDX
MDX lets you use JSX in your markdown content. You can import components, such as interactive charts or alerts, and embed them within your content. This makes writing long-form content with components a blast.
What made you want to use the Astro blog/docs app to author your content, @anthonyk8375 ?
are there specific features there that are attractive to you? why couldn't you just create new pages within the Wasp app?
Supporting what @Vinny (@Wasp) wrote.
@anthonyk8375 do you intend to keep all of the written content behind the login/auth? If so, creating it as pages inside of Wasp should be fine, and as Vince said, you can use MDX to make it easier for yourself to write those pages.
If part of them you also want to keep completely public and optimized for SEO, then those might be better fit for keeping in Astro or a similar solution.
Btw I just opened an issue on Wasp GH repo for this, so we can see about providing some more advanced support for use cases like this: https://github.com/wasp-lang/wasp/issues/1944 (be it just docs, or some nice integrations with Docusaurus and Astro and similar, or something more).
GitHub
Provide better direct support for static content in Wasp · Issue #1...
We have some users that have content heavy apps: often it is a combo of an app and a blog of some kind (e.g. educational content). While we currently advise to use Wasp + something like Astro, this...
Thanks @martinsos and @Vinny (@Wasp) for the detailed suggestions and insights
I'm planning to use freemium content to boost SEO and offer sneak peeks to users. The content will be partially public and partially gated.
I'm considering MDX but am unsure if it supports outline navigation like Astro. I mentioned Astro because it's part of OpenSaaS.