• Stars
    star
    155
  • Rank 236,280 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 3 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Frappe app (CLI) to magically setup single page applications and Vue/React powered desk pages on your custom Frappe apps.

Doppio

Unit Tests

A Frappe App to setup and manage single page applications (using Vue 3 or React) on any other custom Frappe App.

Installation

In your bench directory:

bench get-app https://github.com/NagariaHussain/doppio

This will install the Doppio frappe app on your bench and enable some custom bench CLI commands that will ease the process of attaching a SPA to your Frappe Application.

Setting Up React/Vue SPA

To set up a new Single Page Application, you can run the following command in your bench directory:

bench add-spa --app <app-name> [--tailwindcss] [--typescript]

# or just, and answer the prompts
bench add-spa

You will be prompted to enter a name for your single page application, this will be the name of the directory and the URI path at which the application will be served. For instance, if you enter dashboard (default), then a folder named dashboard will be created inside your app's root directory and the application will be served at /dashboard.

You will then be asked to select the framework you prefer: React or Vue.

You can also select whether you want to use Typescript or Javascript.

You can optionally pass the --tailwindcss flag which will also setup tailwindCSS (who doesn't like tailwind!) along with the Vue 3/React application.

The above command will do the following things:

For Vue 3

  1. Scaffold a new Vue 3 starter application (using Vite)

  2. Add and configure Vue router

  3. Link utility and controller files to make the connection with Frappe backend a breeze!

  4. Configure Vite's proxy options (which will be helpful in development), check the proxyOptions.js file to see to what ports the Vite dev server proxies the requests (you frappe bench server).

  5. Optionally, installs and set up tailwindCSS.

  6. Update the website_route_rules hook (in hooks.py of your app) to handle the routing of this SPA.

For React

  1. Scaffold a new React starter application (using Vite)

  2. Add and configure frappe-react-sdk to make the connection with Frappe backend a breeze!

  3. Configure Vite's proxy options (which will be helpful in development), check the proxyOptions.js file to see to what ports the Vite dev server proxies the requests (you frappe bench server).

  4. Optionally, installs and set up tailwindCSS.

  5. Update the website_route_rules hook (in hooks.py of your app) to handle the routing of this SPA.

Once the setup is complete, you can cd into the SPA directory of your app (e.g. dashboard) and run:

yarn dev

This will start a development server at port 8080 by default (any other port if this port's already in use). You can view the running application at: <site>:8080.

Adding FrappeUI

If you want to add a frappe-ui starter project to your custom app, you can do that using just a single command:

bench add-frappe-ui

Building for Production

The below command builds the application and places it in the www directory of your frappe app:

cd <your-spa-name> && yarn build

Check the package.json file inside the Vue application directory to learn more about the dev server / build steps.

If you already have a package.json file with scripts in your app's root directory, you can add the following two scripts to your app's package.json file in order for the bench build command to work as expected:

"dev": "cd <your-spa-folder> && yarn dev",
"build": "cd <your-spa-folder> && yarn build"

License

MIT

More Repositories

1

doppio_bot

AI ChatBot Template, built into Frappe's admin/desk Interface
JavaScript
46
star
2

digistore

FOSS Digital Asset Distribution Platform built on Frappe.
Vue
35
star
3

doppio_mobile

React Native + Expo Starter template to build apps backed by Frappe
JavaScript
21
star
4

tldraw_whiteboard

tldraw powered whiteboard, right in Frappe's Admin UI / desk
CSS
20
star
5

idea-wallet

React Native Mobile App for recording your ideas.
JavaScript
17
star
6

the-missing-frappe-manual

The Missing Frappe Manual by Build With Hussain
Astro
14
star
7

frappe_dynamic_og

Dynamic OG Image Generation in Frappe Sites
Python
12
star
8

star_ebook_store

Simple Frappe App For Tutorial Purposes
Python
10
star
9

buildwithhussain.dev

Official #BuildWithHussain Website
XSLT
7
star
10

appointments_app

appointments_app
HTML
6
star
11

frappe_actions

Web version of Actions iOS App, created with Frappe Framework during Build with Hussain
Python
6
star
12

shiny_astro_portal

Astro powered Frappe Portal Pages
Python
6
star
13

resend_integration

Resend Integration for Frappe
Python
4
star
14

movie_tickets

Movie Tickets Booking App with FF and FrappeUI
Vue
3
star
15

frappe_firebase_functions

Frappe JS SDK in Firebase Cloud Functions example
JavaScript
3
star
16

frappe-spa

A Vue3 SPA setup for Frappe Framework
JavaScript
3
star
17

flask-test

Inventory Management Web Application
Python
3
star
18

spa-controllers

Helper Libraries for building Single Page Applications with Vue 3 & Frappe Framework
JavaScript
3
star
19

darkify

Frappe App that switches every user to dark theme on every single login.
Python
3
star
20

frappe_accounting_app

A simple accounting app built with Frappe Framework.
Python
3
star
21

ride_management

ride_management
Python
3
star
22

awesome-asp-group

Awesome repo for awesome team.
Vue
2
star
23

simple_saas

Built live on Build With Hussain
Python
2
star
24

better_markdown

better_markdown
Python
2
star
25

portfolio-website

A static portfolio generator for my personal website.
Python
1
star
26

icab

March 2024 rental management app
Python
1
star
27

rentals

rentals
Python
1
star
28

NagariaHussain

1
star
29

.kenv

My ScriptKit setup
JavaScript
1
star
30

ionic-capacitor-vue-vite

Starter App for Setting up ionic/vue on Vitejs
CSS
1
star
31

superstar_rides

superstar_rides
Python
1
star
32

DNW-midterm

Databases, Networks and the Web: The Midterm Project
HTML
1
star
33

cabs_app

On-site training app
Python
1
star
34

ibm-data-science-capstone

My IBM Data Science Captone Project
Jupyter Notebook
1
star
35

tailala

A Vite + Tailwind + AlpineJS = πŸ”₯ template.
HTML
1
star
36

star_rides

\App for FF Training
Python
1
star
37

pga-jupyter-notebook

Assignment Jupyter Notebook for IBM Data Science course
Jupyter Notebook
1
star
38

mhn-url-shortener

My Personal URL shortening service
1
star
39

tailwindpages

TailwindCSS powered pages in Frappe
Python
1
star
40

rides_management

App made during June 2023 FS' Frappe Training
Python
1
star