Code reusability between Projects

Hi everyone,

I’m very new to Wappler, but not new to low-code tools.

My background is with OutSystems and I’m doing a POC with Wappler to try to understand if Wappler has what we need to replace our existing OutSystems stack.

To accomplish this and to speed things up, I don’t want to keep writing the same code over and over again or copy-pasting it between projects.

My question is, is there a way to create some sort of a “library” project that we can then reuse/reference on multiple Projects? So that when we make a change to this “library” it affects the projects that have a reference to it.

The use cases I see for us are:

  1. Reuse Consumed API between projects.
  2. Reuse CSS between projects.
  3. Reuse Server Actions between projects.

It has not been clear to me if I can actually do this, I’ve already built some web pages with Wappler and this tool really looks promising.

Thank you!

Hi Luis and welcome to Wappler and our great community!

I’m sure you will find a lot of similarities between Outsystems and Wappler. Wappler is more generic so you can use it in much more user cases and have of course actually hosting freedom.

As for library of reusable components, we do already have some. Like the library in the Server Actions ( although those are for reuse within the same project.

It is more challenging to make it very generic because we are dealing with many dependencies in Wappler. Like server actions are dependent on database with specific schema, so those won’t just work in other projects.

We do have a lot of generators that will save you a lot of work in generating bootstrap tables and forms based on a database source or server connect action output.

As everything is based on data schema in Wappler, we also just released a Database Templates library functionality so you can create your own for reuse indeed. It is in the latest Wappler 6 beta.

There is also a feature request for library chest, so you can vote on it:

Also keep on supplying us with good ideas, then we can just implement those in Wappler.

Yes indeed, that is why we are looking into Wappler, to have hosting freedom and more fine control over the generated code.

Got it, being able to reuse it in the same project is good enough.

Basically, that means that if we have 2 Web Apps and if they share CSS + Server Action it is best to keep them both in the same Project, since we can use git to cooperate with multiple devs that is not a problem.

Our back-end is going to be a mix of database connection and Rest API so I can see this work fine.

We may have the need to have duplicated code between projects, especially because we will most definitely split between our back-office and user-facing applications, but we will see when we get there :slight_smile:

Thanks a lot for the insights!

For what it’s worth, I use a symlink to reuse an entire mobile project’s www code including js and css files. It allows us to white label our mobile app to several difference clients/projects. We have a main project that is the only one we edit. Other projects have a symlink to the www folder of the main project. It’s not exactly a supported Wappler feature, but it works well for our use case.

White labeling is actually something that we need to do.

Thanks for the tip.