Dittofi
  • Tutorials
    • Tutorial Index
    • Quick Start
    • Dittofi Essentials
      • Part 1: Frontend terms and concepts
      • Part 2: Backend terms and concepts
      • Part 3: Connecting frontend and backend
      • Part 4: Dittofi app structure
    • Dittofi App Design
      • 🏗️App architecture 101
      • ◼️Backend app development 101
      • 🟪Frontend app development 101
      • 🔰(optional) Web developer beginner series
  • Learn Frontend
    • 👨‍💻Getting Started
      • Welcome to Dittofi
      • Intro to the Dittofi Design Studio (Frontend)
    • 🟩Pages
    • 🟪Elements
      • Types
        • Button Element
        • Div Block Element
        • Form Block Element
        • Link Block Element
        • List Element
        • Modal Box Element
        • Tabs Element
        • Columns Element
        • Image Element
      • Partials
      • Prefabs
      • Custom
    • 🟧Variables
      • Array
      • Checkbox
      • Collection
      • Collection (Custom Model)
      • Collection (System Custom Model)
      • Custom Model
      • Date
      • Datetime
      • File
      • Json
      • Number
      • Number with decimal
      • Model
      • System Custom Model
      • Text
      • UUID
    • 🟨Events
      • 🟨External
        • HTTP Request
        • Run Endpoint
      • 🟨Flow Control
        • Condition
        • Run Action
        • Loop
        • Sleep
      • 🟨Maths
        • Add
        • Divide
        • Modulus
        • Multiply
        • Subtract
      • 🟨Navigation
        • Open Page
      • 🟨Notifications
        • Alert
        • Confirm
      • 🟨Other
        • Copy To Clipboard
        • Run Custom
      • 🟨Text
        • Concat
        • Contains
        • Ends With
        • I Contains
        • I Ends With
        • I Starts With
        • LTrim
        • RTrim
        • Text To Upper
        • Text To Lower
        • Trim
        • Starts With
      • 🟨Variables
        • Set Field
        • Remove Field
      • Validate
    • 🟦CSS Layouts
      • Holy Grail Layout
      • Side Bar Layout
      • Sticky Footer Layout
      • Sticky Header Layout
      • CSS Frameworks
    • 🔲CSS Frameworks
    • Component Libraries
    • Meta Attributes
  • Learn Backend
    • 🖥️Getting Started
      • Intro to Data
      • Intro to APIs
      • Build your first custom API
      • Actions & Events
    • 🟫Back-End Actions
    • 🟩Custom Models
      • 🟩Attributes
        • Array
        • Checkbox
        • Custom Model
        • Collection (Custom Model)
        • Collection (System Custom Model)
        • Date
        • Datetime
        • File
        • Number
        • Number With Decimal
        • Json
        • Text
    • ◼️Data Models
      • Database Fundamentals
        • Database relationships
      • ◼️Columns
        • Attachment
        • Auto Increment
        • Checkbox
        • Date
        • Datetime
        • Duration
        • Email
        • Long text
        • Link to another record field
        • Number
        • Number with decimal
        • Password
        • Phone number
        • Percent
        • Price
        • Rating
        • Single select
        • Single line text
        • URL
    • 🟥Events
      • 🟦Arrays
        • Append
        • Array Pop
        • At
        • Length
        • Prepend
        • Range
      • 🟦Conversions
        • Base64 Encode
        • Base64 Decode
        • Json Decode
        • Json Encode
        • Path Escape
        • Path Unescape
        • Query Escape
        • Query String Parse
        • Query Unescape
        • To Bool
        • To Float
        • To Int
        • To Str
        • Yaml Encode
        • Yaml Decode
      • 🟦Database Requests
        • Create
        • Create Or Update
        • Delete
        • Has Record
        • Read Event
        • Update
      • 🟦External
        • HTTP Request
        • SFTP Download
        • SFTP Upload
      • 🟦Files
        • CSV Reader Event
        • CSV Writer Event
        • File Read
        • File Save
        • File Size
        • File Type
        • JSON Reader
        • PDF Generator
      • 🟦Flow Control
        • Condition
        • Loop
        • Return
        • Run Action
        • Sleep
      • 🟦Notifications
        • Send Mail
        • Connect Websocket
        • Message Websocket
      • 🟦Maths
        • Add
        • Acos
        • Acosh
        • Asin
        • Asinh
        • Atan
        • Atanh
        • Cbrt
        • Ceil
        • Divide
        • Modulus
        • Multiply
        • Subtract
      • 🟦Security
        • Compare Password
        • JWT Decode
        • JWT Encode
        • Login
        • Logout Web User
        • Password Generator
        • Random Number
      • 🟦Time
        • Add Time
        • Day
        • Format Time
        • Minute
        • Nanosecond
        • Parse Time
        • Second
        • Time In
        • Year
        • Year Day
      • 🟦Text
        • Concat
        • Contains
        • Ends With
        • Execute Template
        • I Contains
        • I Ends With
        • I Starts With
        • Starts With
        • LTrim
        • RTrim
        • Replace
        • Regex Find All String
        • Regex Find String
        • Regex Match String
        • Trim
        • Text To Lower
        • Text To Upper
        • Text To Title
        • Url Getarg
      • 🟦Other
        • Assign
        • Run Custom
        • Redirect Web Page Event
        • Render Web Template Event
    • 🟧Variables
      • Array
      • Checkbox
      • Collection
      • Collection (Custom Model)
      • Collection (System Custom Model)
      • Custom Model
      • Date
      • Datetime
      • File
      • Json
      • Number
      • Number with decimal
      • Model
      • System Custom Model
      • Text
      • UUID
    • 🟪Webservices
  • Templates
    • Two sided marketplace template
      • Introduction
        • Part I: Installing and setting up the marketplace template
        • Part II: Understanding what features are included in the marketplace template
        • Part III: Customizing your marketplace frontend without coding
        • Exploring Dittofi's marketplace API
      • Listings
        • How to create a marketplace listing
    • How to build a CRUD app
  • Third Party APIs
    • OAuth 2.0 APIs
      • Introduction To OAuth 2.0
      • Google OAuth 2.0 - PART I
      • Google OAuth 2.0 - PART II
  • Dittofi Admin
    • Your Account
      • Workspace Admin
      • Manage Billing
      • Connect a custom domain
      • How to use a discount code to Dittofi Pro
  • FAQ
    • API Generator
    • How to write custom SQL?
    • Why does my image not display?
    • How can I set up Google Analytics?
    • Exporting and deploying my frontend code
    • What is a partial and what is a prefab?
    • How to set up a basic mulit tenant app on Dittofi
    • How to write a custom endpoint in Dittofi
    • How to integrate Font Awesome into Dittofi
    • How can I set up Dittofi to run on my own private server?
    • How to add roles such as Super Admin, Admin, Manager & User
    • How to prevent duplicate records being added to the database
    • What to do when relation cannot be created because their is violating data in the referenced table
  • Change Logs
    • Dittofi Change Logs
Powered by GitBook
On this page
  • Part 1. Exporting the code
  • Part 2. Building and installing your frontend code
  • Part 3. Updating the base URL
  • Step 4. Deploying your frontend code

Was this helpful?

  1. FAQ

Exporting and deploying my frontend code

In this FAQ we explain how you can export your frontend code and connect this to a Dittofi backend that is run inside Dittofi's hosting.

PreviousHow can I set up Google Analytics?NextWhat is a partial and what is a prefab?

Last updated 3 years ago

Was this helpful?

Dittofi is a no-code, visual app builder that sits behind powerful automatic code generation technology. This means that behind each section of visual app development, there is real, high quality code being automatically generated. The languages that we generate are React / Redux on the frontend and Google GO on the backend.

In this FAQ we explain how you can export your frontend code and connect this to a Dittofi backend that is run inside either Dittofi's hosting, a third party backend or backend code that has been exported from Dittofi.

To perform these steps you need to have knowledge of:

  • React

  • npm

  • AWS, GCP, Microsoft Azure or other hosing provider

  • Nginx or other web server

Part 1. Exporting the code

To export your apps code, locate the app inside your workspace and click on the downward facing arrow under your app. Next choose the option for "Get App Code".

Next, you have two options. The simplest option is to "Download code".

Part 2. Building and installing your frontend code

Once you have downloaded your code, this will come in two folders marked frontend and backend.

The frontend code is a React code base that is inside your frontend code folder.

PLEASE NOTE

The code comes with a package.json allowing you to install and build your code using npm. Please note that npm is a standard build process for React based applications. If you are unfamiliar with npm or React then we recommend looking at:

Go into the the frontend/Home folder and run the npm commands:

  1. npm install

  2. npm run build

This will install and build your frontend project.

Note, you may need to update the dependencies in your React code depending on your npm version.

Part 3. Updating the base URL

When running the Dittofi frontend code in the Dittofi hosted environment the frontend code will by default run endpoints at the URL of your app.

When exporting the code you will however need to update the URL to explicitly point at your apps backend.

To do this, open the file restAPI inside frontend/Home/src/api/

and update the variable baseUrl. This is on line 9 of the file restApi.js.

// // Line 9 in the file frontend/Home/src/api/restApi.js
baseUrl = baseUrl ? baseUrl : `${protocol}//${hostname}:${port}/1487/iapi`;

You can now point the baseUrl at any server that is hosting your Dittofi backend. The base URL of your Dittofi test app for example can be read from the Url inside any Dittofi Endpoint. See an example of this highlighted below.

Any other baseUrl that you might have, for example, your production baseUrl can be found under the Publish button dropdown.

Remember to rebuild your exported code once you've exported and modified it.

Step 4. Deploying your frontend code

Once you have built your code e.g. AWS, GCP, Microsoft Azure and so on. You can also host your code with a server provider or run the code locally.

NOTE

Depending on the hosting provider that you choose, the steps for each will be different.

The official React website: where you will see a simple example of creating and building an app using npm in an almost identical way to how you would install and build your Dittofi code base.

The official npm website: where you will see information regarding install npm.

Each hosting provider will provide information and recommendations on how to deploy web sites and web applications using their service. For example, for see Amazon Webservice's recommendations for deploying websites and web applications @ .

https://reactjs.org/docs/create-a-new-react-app.html
https://docs.npmjs.com/getting-started
https://aws.amazon.com/websites/