Skip to content

Latest commit

 

History

History
253 lines (153 loc) · 5.91 KB

Contribution.md

File metadata and controls

253 lines (153 loc) · 5.91 KB

Contributing to Peppubuild

Peppubuild is an open-source no-code builder, where you can visually create your websites, applications, and plug into a CMS of their choice. We appreciate your interest and efforts to contribute to Peppubuild. See the LICENSE for licensing information.

Repository Setup

This repository contains all the folders necessary to setup Peppubuild, except the website (peppubuild.com), whic is hosted at Peppubuild Front. Here's a summary of the folders, what they hold, and where they're hosted.

  • Playground: This folder contains the frontend application for Peppubuild (https://app.peppubuild.com), hosted with Netlify. It makes calls to server.js, which is hosted in Cpanel's Node.js server.

  • Plugins: Since Peppubuild is built on Grapesjs, we have some plugins to enhance the default editor. From page management, bootstrap, and panel enhancement.

  • Server.js: This contains the functions for our server-side calls to Peppubuild. The utils folder is used by server.js.

Functions and Methods.

This section contains a detailed overview of all the functions in the client, server, and plugin folders.

Server.js

Table of Contents

Peppubuild uses Firebase for authentication and Google Drive (appDataFolder) to store user information. Since we are only accessing (appDataFolder), we can't access the users files in drive, only information we have created. For more information, checkout https://developers.google.com/drive/api/guides/appdata.

startServer

All of our functions are wrapped around the startServer() function. At the end of the file, we call this function and listen to port 1404.

getContent

This function retrieves the gjs JSON content, which forms our website page, from Google's Drive (appDataFolder).

Parameters

Clientdeploy

app.post('/clientdeploy/:pname', (req, res) => {}) Route serving deploy, to publish project. We use FTP server to upload files. We also call uploadFrom() with params readablestream and file name.

Parameters

  • pname string Project name
  • page callback gjs page data.

createSub

Create Subdomain This function creates a subdomain for our user in our Namecheap shared hosting account.

Parameters

listFiles

This function lists all projects created with Peppubuild, from Google's Drive (appDataFolder).

Parameters

  • accessToken string Oauth Access Token

Logout

app.get('/logout', (_req, res) => {}) This route deletes the cookie pepputoken, which contains our Oauth.

Parameters

  • pepputoken string res.clearCookie

Login

app.get('/logout', (_req, res) => {}) This route retrieves Oauth token after authentication with firebase. Next, it stores the cookie pepputoken, which contains our Oauth.

Parameters

  • providerToken string Oauth token

createFrontend

Create File to store application's data on Google Drive (appDataFolder).

Parameters

  • projectName string Project Name
  • accessToken string Oauth AccessToken

updateDB

Update the project file created on Google Drive (appDataFolder), with gjs JSON.

Parameters

  • project
  • Id string FileId
  • accessToken string Oauth AccessToken
  • projectName string Project Name

deleteContent

Function to delete file and the content of the project.

Parameters

Delete_Project

app.post('/pdelete/:id', (req, res) => {}) Route to delete project from Google Drive.

Parameters

Retrieve_Project

app.post('/project/:id', (req, res) => {}) Route to retrieve the data of a single project. Useful route for loading editor with pre-saved project.

Parameters

Delete_Project

app.post('/pdelete/:id', (req, res) => {}) Route to retrieve all of the projects from Drive.

Parameters

Save_Project

app.put('/save/:id', (req, res) => {}) Route to save changes to corresponding file on Drive.

Parameters

Publish_Project

app.post('/publishfront/:name', (req, res) => {}) Route to publish file to Namescheap