• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How to Develop Web Applications With Create React App

By Abhishek Ghosh June 17, 2023 6:51 pm Updated on June 20, 2023

How to Develop Web Applications With Create React App

Advertisement

Often we need to create single-page web applications for various purposes, such as for our IoT projects or to create some server monitoring web page or just an informational web page for a GitHub repo.

Many of us tend to use PHP, Ruby, and Python even to create simple apps. When we need just to create an informational web page for a GitHub repo, then we edit some HTML templates. These methods are still great but today there are easier ways to create professional-looking webpages. There are some JavaScript libraries such as React.js, and Next.js which are created for building user interfaces based on components. These are far from difficult to learn when they are about simple things.

As because today there are things such as separate backend services (such as Firebase, AppWrite, Supabase etc) and application hosting service such as Netlify, this way of deployment is easier. Web applications developed in this way can easily be converted to Android or iOS apps. Also, Firebase and Supabase are popular ways to develop things with Arduino and ESP32.

Advertisement

---

So, let’s get started.

 

Install an IDE and the Required Components

 

It is convenient to use an IDE to write code and edit on localhost.

Visual Studio Code or VS Code is free to download and use. Please install it on your local computer. Next, download and install Node.js (installer for GUI) from their official site for your operating system.

Later you can install react, create-react-app, supabase, firebase and netlify via npm (npm is included in Node.js). Create React App is an officially supported method to create single-page React applications. This Create React App is the main thing. Usually, we need two more stuff, namely TailwindCSS and DaisyUI. We can install all of these using npm, but instead of npm, you can use npx. This will avoid odd errors (npx comes with npm 5.2+ and higher). Open Command Prompt if you are using Windows OR open the terminal app if you are using MacOS or Linux and run the commands to install.

Vim
1
npm install -g create-react-app

How to Develop Web Applications With React app
 

Get Started Developing With React app

 

Now, launch VSCode and choose File > Open. Then select the folder that was created by create-react-app. VSCode includes a terminal, which can be accessed by clicking Terminal > New Terminal on the top menu. Open src > App.js on the left menu. Run these commands:

Vim
1
2
3
4
npm install --save supabase axios
npm install daisyui tailwindcss postcss autoprefixer react-router-dom
npx tailwindcss init -p
npm start

You should change the directory to somewhere else to create the example app, such as:

Vim
1
2
3
cd Documents
create-react-app my-basic-example
# npx create-react-app my-basic-example

This will create these files:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
my-basic-example
├── README.md
├── node_modules
├── package.json
├── .gitignore
├── tailwind.config.js
├── public
│   ├── favicon.ico
│   ├── index.html
│   ├── logo192.png
│   ├── logo512.png
│   ├── manifest.json
│   └── robots.txt
└── src
    ├── App.css
    ├── App.js
    ├── App.test.js
    ├── index.css
    ├── index.js
    ├── logo.svg
    ├── serviceWorker.js
    └── setupTests.js

The src directory is the place where the source code for our application lives.

The public directory contains files that will be read by our browser when we are developing the app; there will be the index.html. React’s backend will inject code into this file.

The package.json file contains information about our project. You don’t need to understand this file.

The above command will start open port 3000 and you can see your web application live at localhost:3000. Your command create-react-app my-basic-example created a template which includes a SVG logo of React.js. We could use this kind of command instead to use any other template:

Vim
1
npx create-react-app my-app --template [template-name]

You will get the list of templates here. You can search with TailwindCSS, DaisyUI, supabase, firebase, netlify etc.

Right-click src > New File and create canvas.jsx, supabase.jsx, and then style.css. What is .jsx? You can read this document :

Vim
1
https://legacy.reactjs.org/docs/introducing-jsx.html

style.css is for styling the application. For example, we added canvas.jsx, but there is no CSS for it.

canvas.jsx is for rendering an HTML5 canvas element which allows the creation of graphics on the web using JavaScript. You can search the web or read the document to learn about it.

supabase.jsx is an optional file to connect with the backend server of supabase. Alternatively, you can load the required info via index.js:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import { createClient } from "@supabase/supabase-js";
import { Provider } from "react-supabase";
import App from "./App";
import { BrowserRouter } from "react-router-dom";
 
const supabaseUrl = process.env.REACT_APP_SUPABASE_URL;
const supabaseAnonKey = process.env.REACT_APP_SUPABASE_ANON_KEY;
 
const client = createClient(supabaseUrl, supabaseAnonKey);
 
ReactDOM.render(
  <React.StrictMode>
    <BrowserRouter>
      <Provider value={client}>
        <App />
      </Provider>
    </BrowserRouter>
  </React.StrictMode>,
  document.getElementById("root")
);

Next, navigate into your tailwind.config.js file and modify the following code to this (I have added plugins: [require("daisyui")]):

Vim
1
2
3
4
5
6
7
8
9
10
module.exports = {
  darkMode: 'class',
  content: [
    "./src/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [require("daisyui")],
}

DaisyUI has a theme generator and examples:

Vim
1
https://github.com/daisyui/react-daisyui

This article ends here since you have to study the documents and examples to create your own thing.

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How to Develop Web Applications With Create React App

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • How to Install Supabase on Ubuntu Server (with Docker)

    In our earlier guide, we discussed installation of AppWrite on own server. If you are developing ESP32 Arduino, then probably Supabase will feel more like Firebase. Apart from Firebase, AppWrite, and Supabase, there are other options such as AceBase, Amplication, Conduit and so on. Supabase is one the most established BaaS provider among the three. […]

  • Nginx WordPress Configuration Sample File

    Here is Ready to Use Nginx Wordpress Configuration Sample File Which Can Used With Either Community Edition of Nginx or Nginx Plus & PHP5-FPM.

  • Create Facebook App Page With Free Google Sites

    Create Facebook App Page With Free Google Sites with just few clicks without knowing a single bit of coding things. We are giving warranty, it will look great.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy