Skip to main content

Build App

You can build your React.js application anytime after you fetch your design from Figma. If your Figma design has prototyping, then that would be auto-implemented to create actions and navigations, which you can see on the generated code file when you build the app.

Build app to generate code

All the design has been generated with tailwindcss. Find all the theme related configuration inside tailwind.config.js

Example banner

CRA? CRACO? Custom Webpack? ViteJS?

Using DhiWise, you can generate web applications from Figma in a few minutes. After generating the code, you can download the zip file and run it on your IDE.

To make your developer experience more delightful, you can now generate code in four different ways:

1. CRA (Create React App)

This beginner-friendly setup helps all the newbies and all the ReactJS developers who prefer the CRA setup. This comes with react-scripts v5.0.0

2. CRACO (Create React App Configuration Override)

This is CRA with a twist for better, opinionated, faster bundling. So you can configure it, whatever works best for you.

This comes with @craco/craco v^6.4.5

3. Webpack

Want a custom setup for your project? Want to go old-school?

Then this is for you. Each part of this setup is designed to match your application's needs with easy configuration and minimal tweaks and is entirely customizable. Powered by Webpack.

For this, we use the following packages:

"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3",

Thanks, Webpack team! 👍🏽

4. ViteJS

The next-gen front-end tooling is here for lightspeed builds.

Vite brings all the fantastic features:
  • Instant Server Start

  • Lighting Fast HMR (Hot Module Replacement)

  • Optimized Builds

  • Universal Plugins

    "@vitejs/plugin-react-refresh": "^1.3.1",
    "vite-plugin-svgr": "^0.3.0",
    "vite": "^2.3.2",

Storybook support

All the above flavors come with storybook support. Storybook helps you start building and maintaining your applications' UI components.

How to use Storybook in DhiWise-generated ReactJS web applications?

Install and Initialize

     npx storybook init

Run the Storybook

      npm run storybook

Download the source code or sync it to GitHub or GitLab

You will be redirected to the code screen and from there you can download the source code and sync it to GitHub & GitLab !

info

The source code is debugged. Therefore, it can be run directly on your favorite IDE.

You can still make changes to your application by adding actions, changing views, & authentication, then re-build your application. Click on "Build app" to generate the updated code.

We recommend you to check the README.md file. This file consists of the following information:

Install Dependencies

npm install

Running the app

npm start

README.md

# Design System

All the design has been generated with [tailwindcss](https://tailwindcss.com/).
Find all the theme related configuration inside tailwind.config.js

<div>
<h1 align="center">Getting Started with React Figma Web 🚀 </h1>
<strong>
Generated with ❤️ from Dhiwise
</strong>
<p>
This is the documentation of React Figma Web.
It holds all the info you need to get started with
and make changes to your App
</p>
</div>

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

This project is integrated with a [Tailwind CSS](https://tailwindcss.com/) setup, a new utility-first css framework, in an CRA environment. You can read more over on [Getting Started with Tailwind](https://tailwindcss.com/docs/installation).

## Table of Contents

- [System Requirements](#system-requirements)
- [Setup Feedback](#setup)
- [Install Dependencies](#install-dependencies)
- [.env file](#env-file)
- [Running the App](#running-the-app)
- [Folder Structure](#folder-structure)
- [Available Scripts](#available-scripts)
- [npm start](#npm-start)
- [npm test](#npm-test)
- [npm run build](#npm-run-build)
- [npm run eject](#npm-run-eject)
- [Changing the Page `<title>`](#changing-the-page-title)
- [Installing a Dependency](#installing-a-dependency)
- [CRA User Guide](#cra-user-guide)
- [How to Update to New Versions?](#how-to-update-to-new-versions)
- [What’s Included?](#whats-included)

## System Requirements

- [git](https://git-scm.com/) - v2.13 or greater
- [NodeJS](https://nodejs.org/en/) - `12 || 14 `
- [npm](https://www.npmjs.com/) - v6 or greater

## Setup

Setup you project by running the following commands.

## Install Dependencies

npm install

## .env file

This file contains various environment variables that you can configure.

**PORT** - Port to run your frontend on \
**REACT_APP_GOOGLE_CLIENT_ID** - (Optional) Your Google Client ID

## Running the App

npm start

## Folder Structure

After creation, your project should look like this:

.
├── craco.config.js
├── package.json
├── package-lock.json
├── postcss.config.js
├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
├── README.md
├── src
│ ├── App.js
│ ├── assets
│ │ ├── fonts ---------- Project fonts
│ │ └── images --------- All Project Images
│ ├── components --------- UI and Detected Common Components
│ ├── constants ---------- Project constants, eg: string consts
│ ├── hooks -------------- Helpful Hooks
│ ├── index.js
│ ├── pages -------------- All route pages
│ ├── Routes.js ---------- Routing
│ ├── styles
│ │ ├── index.css ------ Other Global Styles
│ │ └── tailwind.css --- Default Tailwind modules
│ └── util
│ └── index.js ------- Helpful utils
└── tailwind.config.js ----- Entire theme config, colors, fonts etc.


For the project to build, **these files must exist with exact filenames**:

- `public/index.html` is the page template;
- `src/index.js` is the JavaScript entry point.

You may create subdirectories inside src. For faster rebuilds, only files inside src are processed by Webpack.
You need to put any JS and CSS files inside src, otherwise Webpack won’t see them.

Only files inside public can be used from public/index.html.
Read instructions below for using assets from JavaScript and HTML.

You can, however, create more top-level directories.
They will not be included in the production build so you can use them for things like documentation.

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br>

### `npm run build`

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Syntax Highlighting in the Editor

To configure the syntax highlighting in your favorite text editor, head to the [relevant Babel documentation page](https://babeljs.io/docs/editors) and follow the instructions. Some of the most popular editors are covered.

## Displaying Lint Output in the Editor

> Note: this feature is available with `react-scripts@0.2.0` and higher.<br>
> It also only works with npm 3 or higher.
> Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint.

They are not required for linting. You should see the linter output right in your terminal as well as the browser console. However, if you prefer the lint results to appear right in your editor, there are some extra steps you can do.

You would need to install an ESLint plugin for your editor first. Then, add a file called `.eslintrc` to the project root:

{
"extends": "react-app"
}


Now your editor should report the linting warnings.

Note that even if you edit your `.eslintrc` file further, these changes will **only affect the editor integration**. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes.

If you want to enforce a coding style for your project, consider using [Prettier](https://github.com/jlongster/prettier) instead of ESLint style rules.

## Changing the Page `<title>`

You can find the source HTML file in the `public` folder of the generated project. You may edit the `<title>` tag in it to change the title from “React App” to anything else.

Note that normally you wouldn’t edit files in the `public` folder very often. For example, adding a stylesheet is done without touching the HTML.

If you need to dynamically update the page title based on the content, you can use the browser [`document.title`](https://developer.mozilla.org/en-US/docs/Web/API/Document/title) API. For more complex scenarios when you want to change the title from React components, you can use [React Helmet](https://github.com/nfl/react-helmet), a third party library.

## Installing a Dependency

The generated project includes React and ReactDOM as dependencies. It also includes a set of scripts used by Create React App as a development dependency. You may install other dependencies (for example, React Router) with `npm`:


npm install --save react-router


Alternatively you may use `yarn`:


yarn add react-router


This works for any library, not just `react-router`.

## CRA User Guide

You can find detailed instructions on using Create React App and many tips in [its documentation](https://facebook.github.io/create-react-app/).

## How to Update to New Versions?

Please refer to the [User Guide](https://facebook.github.io/create-react-app/docs/updating-to-new-releases) for this and other information.

## What’s Included?

Your environment will have everything you need to build a modern single-page React app:

- React, JSX, ES6, TypeScript and Flow syntax support.
- Language extras beyond ES6 like the object spread operator.
- Autoprefixed CSS, so you don’t need `-webkit-` or other prefixes.
- A fast interactive unit test runner with built-in support for coverage reporting.
- A live development server that warns about common mistakes.
- A build script to bundle JS, CSS, and images for production, with hashes and sourcemaps.
- An offline-first [service worker](https://developers.google.com/web/fundamentals/getting-started/primers/service-workers) and a [web app manifest](https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/), meeting all the [Progressive Web App](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) criteria. (_Note: Using the service worker is opt-in as of `react-scripts@2.0.0` and higher_)
- Hassle-free updates for the above tools with a single dependency.

The tradeoff is that **these tools are preconfigured to work in a specific way**. If your project needs more customization, you can ["eject"](https://facebook.github.io/create-react-app/docs/available-scripts#npm-run-eject) and customize it, but then you will need to maintain this configuration.



Got a question? Ask here.