Open SaaS template without some funcitonalities? (e.g., without Auth)

What is the best way to remove some functionalities from the Open SaaS template? e.g., if I want to remove Stripe payments, how should I do it (ideally in a clean way)? Because I tried removing the Stripe related parts from main.wasp, but that yields errors because of Stripe related imports, so I go to the .tsx files that do those imports and remove them, but then I get errors because of these later imports that have been removed, and so on. Same thing happened with Auth. Cheers!
3 Replies
kapa.ai
kapa.ai5mo ago
Hi @franfram. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To remove certain functionalities from the Open SaaS template, you would indeed start by removing the related parts from the main.wasp file. However, as you've noticed, this can lead to errors due to dependencies in the code. To resolve these errors, you would need to go through the codebase and remove any imports and usage of the functionality you're removing. This can be a bit tedious, but it's necessary to ensure the application still works correctly without the removed functionality. For example, if you're removing Stripe payments, you would need to remove any Stripe-related imports and usage in the .tsx files. If this leads to further errors due to removed imports, you would need to resolve these as well. As for the authentication functionality, it's a bit more complex because it's deeply integrated into the application. You would need to remove the auth-related fields from the User entity in the main.wasp file, as well as any usage of these fields in the codebase. You might also need to remove the externalAuthEntity field from the app.auth and the SocialLogin entity if you used Google or GitHub auth. After making these changes, you would need to run wasp db migrate-dev to apply the changes to the database source (https://wasp-lang.dev/docs/migrate-from-0-11-to-0-12#2-cleanup-the-old-auth-system). If you're unsure where certain functionalities are implemented, you can look in the src/client/admin directory for the Admin Dashboard code, as suggested by a community member on the Wasp Discord server source (https://discord.com/channels/686873244791210014/1220792321805647872). Remember to test your application thoroughly after making these changes to ensure everything still works as expected. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @franfram, 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?
martinsos
martinsos5mo ago
@franfram yeah it's a bit of a manual process at the moment! We are working on reorganizing the code more vertically so that all payment-related code is closer together or that all file upload code is closer together, which will make it easier to remove it instead of hunting down all piece of it through the codebase. This will likely be happening quite soon. As for more long term improvements, we are planning on releasing full stack modules (FMSs) at some point, which should make configuring, plugging in and removing such funcionality much easier as it would be a standalone Wasp package! But that you can probably expect closer to the end of this year. Finally, one idea is also to, when creating new opensaas project, have questions for you that ask you want you want and then you get only those parts embedded into final codebase. We will probably do all of these as time goes, but at the moment is really a manual process. Docs should be helpful though, they cover each part of opensaas relatively well so should give you a good idea what to remove. Btw I am not sure I quite got the errors you got with imports: if you remove imports from main.wasp and also related JS code, you should be good! Likely you didn't remove all of it?
franfram
franframOP5mo ago
Thank you for your reply @martinsos ! Can't wait to see those changes! I'll show you the errors tomorrow, Cheers, Francis
Want results from more Discord servers?
Add your server