silexlabs / Silex

Silex live web creation, free/libre no-code website builder, next gen Webflow for the static web
http://www.silex.me
GNU Affero General Public License v3.0
2.22k stars 580 forks source link

Saving Templates in database #801

Closed sfkazmi closed 4 years ago

sfkazmi commented 6 years ago

I have templates html and css stored in my database, can i integrate silex with my website for my clients to edit, update and create new template and save it in my website database?? If yes then what is proper whay to do this??

lexoyo commented 6 years ago

Hi @sfkazmi

Thank you for your interest in Silex project With Silex your users can edit templates made with Silex only, not any HTML template

For Silex to store in a database instead of a file or cloud storage, you need to create a unifile service, we can guide you

sfkazmi commented 6 years ago

@lexoyo Thank you for your response, I need your guide line how i can integrate in my web application. I allow users to add blank templates and edit already added templates. I am using grapesJs but it do not allow absolute positioning and to freely move elements in canvas, So I need an editor like silex to integrate in my website,

User create or edit templates and save in database, then website generate a url to open that template a user has stored,

lexoyo commented 6 years ago

How are your users authenticated, do they sign up to your platform? What is your platform, does it provide a route for Silex to read/write in the database?

sfkazmi commented 6 years ago

I am using laravel authentication and my project is in laravel, and every user use it with login, My platform is masmenus, it is a digital menus platform where users can add html templates and thoese templates will load on android by using specific generated urls. I can provide a url for read write by silex

lexoyo commented 6 years ago

Ok, this is interesting as we have a beta version of Silex coming soon, dedicated to hosting providers. You have probably seen issues talking about features which make it possible to add "unofficial" services to store users data, or to provide custom ways to publish websites online...

You will have to create small nodejs scripts for that and use npm. Are you ok with that? We can help you here

Stay tuned we will need use cases in less than one week

sfkazmi commented 6 years ago

That's Great. I am waiting for that and always available if you need anything,

lexoyo commented 6 years ago

hi @sfkazmi i did this sample, do you feel like it is addressing your use case? https://github.com/lexoyo/silex-for-hosting-company

lexoyo commented 6 years ago

you can deploy it for free on heroku with this link: https://heroku.com/deploy?template=https://github.com/lexoyo/silex-for-hosting-company/tree/master

lexoyo commented 6 years ago

here is what it does:

sfkazmi commented 6 years ago

How can i load and save templates in database?? did you find anyway to load and save template in mysql database??

sfkazmi commented 6 years ago

i have deployed it on heroku but it is not working properly, https://masmenus.herokuapp.com/

lexoyo commented 6 years ago

I see it working on https://masmenus.herokuapp.com/ What is the problem?

sfkazmi commented 6 years ago

I cannot move elements

lexoyo commented 6 years ago

Oh ok, the env vars were missing in heroku's app.json file It is fixed, please try again: https://heroku.com/deploy?template=https://github.com/lexoyo/silex-for-hosting-company/tree/master

You will need to create a github app, follow the instructions please

lexoyo commented 6 years ago

i just deployed it here: https://test09876aaaa.herokuapp.com/

sfkazmi commented 6 years ago

Now it's working fine, but how i can fetch templates stored in database, and save the templates in database?? because according to my requirements, i have to save templates in database not on github repo. For a hosting company every one wants to save and secure data, so find a way to save data in database. I can provide api to post data

sfkazmi commented 6 years ago

there should be another options for optional params like posting userId and other values

lexoyo commented 6 years ago

there should be another options for optional params like posting userId and other values

This I did not understand

Now it's working fine, but how i can fetch templates stored in database, and save the templates in database?? because according to my requirements, i have to save templates in database not on github repo. For a hosting company every one wants to save and secure data, so find a way to save data in database. I can provide api to post data

Now you are supposed to create your "unifile service", like this one: https://github.com/silexlabs/unifile-webdav/blob/master/lib/unifile-webdav.js

Would you consider using a mounted file system to store the data? Or access a distant SFTP server? It could be transparent for your users, but you could use one of the existing unifile services

lexoyo commented 6 years ago

hi @sfkazmi what do you think?

saudAtIrisdame commented 2 years ago

Hello @sfkazmi

I am using grapesJs but it do not allow absolute positioning and to freely move elements in canvas, So I need an editor like silex to integrate in my website,

I am facing the same problem with grapejs how did you address this problem?

User create or edit templates and save in database, then website generate a URL to open that template a user has stored,

I have the same requirement I want to save templates in the database.

If you found the solution & don't mind sharing I am desperately looking for it. I am not able to find your email but here's mine chougle.saud@irisdame.in