Skip to content

In this repository I'll be experimenting on how to convert a static html template to reusable react components, hence creating a dynamic react app.

Notifications You must be signed in to change notification settings

Kuria-byte/StaticHTML-to-React

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static- toReact

image

About

If you ever wanted to use a static html template for your react app, I present a proven way to do so. By breaking down a huge HTML file to managable react components that you can reuse

Note Worthy📐

  • Where to place your styling ? Import all styling in the app.js
  • Where to place the assets (css, fonts, js, images) folder ? Inside the src folder - this way you won't have to import the styling on each component
  • Removing all default html comments
  • Html class attributes should be converted to className (class is a keyword in javascript and JSX is an extension of javascript. That's the principal reason why React uses className instead of class.)
  • Use camelCases
  • All html elements to be used inside a component should have closing tags
  • Importing images using src ={imageName} - refer to ( https://create-react-app.dev/docs/adding-images-fonts-and-files/)

What's in Store

  • User authentication and database implemented with google firebase
  • Used React-router for dynamic web navigation
  • Complex state management managed by Redux with memorized selectors
  • Used Redux-Persist and local storage for persistence
  • Implemented credit card payment with stripe
  • Asynchronous API request handled with Redux -saga
  • Dynamic Filtering ( Shop by categories)
  • Deployed on vercel

Commits

  • Browse through commits to see the project flow from inception to deployment image

Project Structure🚀

The structure of the web app

  • assets- all common scripts and stylings (css), fonts used on the pages, theme scripts included in script.js file
  • src - all jsx files
  • components - all react components

Hosting

  • Vercel - continous delivery/ Automatically deploys app each time you commit to the master branch
  • Heroku - great option but slow

Getting Started with Create React App

This project was bootstrapped with Create React App.

Start

  • git clone the proect
  • npm install

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

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

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

References

Inspiration ❤

About

In this repository I'll be experimenting on how to convert a static html template to reusable react components, hence creating a dynamic react app.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published