Coder Social home page Coder Social logo

uche40 / silex-for-hosting-company Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lexoyo/silex-for-hosting-company

0.0 1.0 0.0 174 KB

this is an example of how one can use silex in their projects

Home Page: https://github.com/silexlabs/Silex/wiki/Silex-for-hosting-providers

JavaScript 100.00%

silex-for-hosting-company's Introduction

An example of use of Silex website builder

In Silex, these are some useful terms to know, please read this wiki page to know what we are talking about: Silex vocabulary

About this repository

This repository shows you how Silex open source website builder can be customized for companies selling hosting or integrating Silex with a proprietary SaaS solution.

This demo shows how to integrate Silex to you infrastructure and offer a user experience close to the "usual" website builder, where the user can load/save from your hosting and publish to your server

With this customized instance of Silex:

  • you user will not be proposed cloud storage such as Dropbox or Github
  • all the files will be store on the server's file system, in the user's directory
  • your user will not be proposed to publish in a folder, the website will allways be published in the user's "Website/" folder
  • there is a custom login mechanism which you are supposed to customize for real life use, see bellow

Run this custom instance of Silex

100% online with heroku

You can deploy Silex for free without leaving the browser thanks to heroku. Then you can customize Silex from the browser in Github, just for testing purpose.

Fork this repository

Deploy on heroku Folow this link for 1 click deploy to heroku

With this method you can test adding templates, components and changing unifile config without leaving the browser, without any local instal.

Local installation

Clone this repo with git and then run Silex

$ nvm i
$ npm run build
$ npm start

Add custom components and custom templates

This will probably be useful to you if you want to customize Silex:

Integrate Silex with your infrastructure

Provide a cloud storage

customize silex add service

You can let your users store their work (html and image files) on your server:

silex.unifile.use(new CustomService({
  redirectUri: config.ceOptions.rootUrl + '/custom-service/signin-custom',
  sandbox: '/tmp/'
}));

This unifile service is defined in custom-service.js and contains a method where you can define your custom authentication mechanism:

  login(session, loginInfos) {
    // TODO: insert here the authentication login
    Object.assign(session, loginInfos);

    // FIXME: this is just for the test
    // create the user's dir
    this.mkdir(session, '');

    return Promise.resolve(session);
	}

Notes:

  • you can add unifile services, and then use them to provide hosting to your Silex users
  • if Silex sees only one unifile service and one hosting provider, the user will not see the other choices and the user experience will be like with proprietary website builders where hosting is provided only by the company.

Provide hosting to your users

customize silex add hosting provider

Look at the custom hosting provider and how it is added to Silex:

silex.publishRouter.addHostingProvider(new CustomProvider(silex.unifile))

silex-for-hosting-company's People

Contributors

lexoyo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.