Structure for The Kenya Bankers Vite-React Frontend App
npm create vite app --template reactcd appnpm installnpm run dev- In
srcfolder, createpages,styles, andcomponentsfolders - Add images to the
publicfolder - Kill terminal and restart if needed
- Install Tailwind CSS (guide)
- Remove unwanted code, files, and folders
npm install react-iconsnpm install react-router-dom
- Run
npm run build - A
distfolder is created - Copy the contents of
distintopublic_htmlon Hostinger - Add
.htaccessfile inpublic_htmlfor routing and configuration
-
Public folder: Stores static assets like images that don’t need processing by Vite. Files here are directly accessible and can be used in
.jsxfiles without importing as components. Example:<img src="/ats_website/raleigh.jpg" alt="Me" className="object-cover w-full h-full" />
-
Src folder: Contains all the source code — JavaScript/JSX, CSS, and other files that Vite processes and bundles.
-
index.html: The project’s entry point where you can add favicon and set the website title. Connects to
main.jsx. -
tailwind.config.js: Configure Tailwind CSS settings, including custom screen sizes under the
themeproperty. -
src/components: Contains
.jsxfiles for reusable UI components such as buttons, text blocks, etc. These components are imported into pages. -
src/pages: Contains
.jsxfiles representing different pages of the app where components are imported and assembled. -
src/styles: Holds custom CSS files like
global.css, imported intomain.jsx. -
src/App.jsx: Imports pages and defines routes. Also contains utilities like a “scroll to top” component.
-
src/index.css: Contains Tailwind’s base styles, components, and utilities.
-
src/main.jsx: Imports global styles (
index.cssandglobal.css),App.jsx, sets upBrowserRouterfor routing, and renders the app into the root element defined inindex.html.