React.js
Learn about the React.js framework Template.
Reactjs Template (Include Tailwindcss, TypeScript & JavaScript)
This is a React.js project bootstrapped with vitejs
.
Technologies Used
Features
The features included in this project template are:
- Project Architecture.
- Authentication.
- Customize
React Hooks
. - Some custom functions that I often use.
Architecture Projects
There are several important points related to how to run a proper architecture project. For this case study, I have created a customized blank project template that I have implemented how to organize a good architecture project so that it looks tidy.
/
āāā public/
āāā src/
ā āāā components/
ā ā āāā Common/
ā ā āāā Containers/
ā ā āāā Mixins/
ā ā āāā README.md
ā āāā config/
ā āāā context/
ā āāā data/
ā āāā hooks/
ā āāā interfaces/ # TypeScript only
ā āāā layouts/
ā āāā lib/
ā āāā pages/
ā āāā providers/
ā āāā index.css
ā āāā main.jsx # or main.tsx
ā āāā vite-env.d.ts # TypeScript only
āāā .gitignore
āāā .eslint.config.js
āāā index.html
āāā jsconfig.json # JavaScript only
āāā package.json
āāā postcss.config.js
āāā README.md
āāā tailwind.config.js
āāā tsconfig.app.json # TypeScript only
āāā tsconfig.json # TypeScript only
āāā tsconfig.node.json # TypeScript only
āāā vite.config.js # or vite.config.ts
Common Folder
The Common
folder is located in /src/components/
. So what does it contain? The Common
folder contains small components, such as: buttons, dropdowns, etc.
Mixins Folder
The Mixins
folder is located in /src/components/
. So what does it contain? The Mixins
folder contains components that are a combination of small components from the Common
folder. Such as: navbar (which contains some common things such as buttons, dropdowns, etc.).
Containers Folder
The Containers
folder is located in /src/components/
. So what does it contain? The Containers
folder contains a combination of the Common
folder and the page itself which form 1 page. 1 page 1 Containers
folder to keep it tidy.
If 1 container has several sections, then you must separate and put them in the components
folder but still in 1 Containers
folder. Such as: /src/components/Containers/Home/components
.
Authentication
This project template already uses authentication using React Context
. If the user has authenticated, the user cannot access the login
or register
page again.
React Hooks Customization
You can use, and add your own custom React Hooks
to the /src/hooks
folder that has been provided. There is an example of React Hooks
customization for Data Fetching
using Axios.
Getting Started
This template is available on BikinProject! How to use this template, follow these simple steps:
- Install BikinProject: Start by installing BikinProject on your machine.
npx bikinproject@latest
- Tell BikinProject Where to Create the Project: Input a directory where you want to create your project.
ā create-bikinproject-app
ā
ā Where should we create your project?
ā ./your-project # Input your project name, e.g. my-project or .
- Choose a Starter Project: Choose a starter project that suits your needs.
ā create-bikinproject-app
ā
ā Where should we create your project?
ā ./your-project
ā
ā Pick a project type within "./your-project"
ā ā React.js (Tailwind + TypeScript)
ā ā React.js (Tailwind + JavaScript)
ā ā dll.
ā # Pilih jenis proyek dengan menggunakan tombol panah
- Choose include install dependencies: Choose to install dependencies or not.
ā create-bikinproject-app
ā
ā Where should we create your project?
ā ./your-project
ā
ā Pick a project type within "./your-project"
ā React.js (Tailwind + TypeScript)
ā
ā Install dependencies? (currently only NPM is supported)
ā ā Yes / ā No
ā # Select Yes or No by using the arrow keys
- Wait for BikinProject to Create the Project: Wait for BikinProject to create the project for you.
Note:
If you choose to install dependencies, BikinProject will install the necessary dependencies for you. Please wait for the installation to complete.
ā create-bikinproject-app
ā
ā Where should we create your project?
ā ./your-project
ā
ā Pick a project type within "./your-project"
ā React.js (Tailwind + TypeScript)
ā
ā Install dependencies? (currently only NPM is supported)
ā No
ā
ā ā³ Creating project...
ā
ā š Project Created!
ā
ā Next steps. āāāāāāāāāāāāāāāā®
ā ā
ā cd ./your-project ā
ā npm install ā
ā npm run dev ā
ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāÆ
ā
ā Have a Problems? Report to https://github.com/nuflakbrr/bikinproject/issues
-
Start Building Your Project: After BikinProject generate the starter project, you can start building your project.
-
Copy Environment Variable: Copy the
environment variable
with the following command
cp .env.example .env
- Open Development Server: Open http://localhost:5173 in your browser and see the result.
You can start editing the page by modifying /src/components/Containers/Home/index.(jsx/tsx)
. The page updates automatically as you edit the file.
Learn More
To learn more about React.js, see the following resources:
- Documentation React.js - interactive React.js tutorials.
You can check out the React.js GitHub Repository - your feedback and contributions are welcome!
Author of This Template
Contributor names and contact info,
Naufal Akbar Nugroho
@nuflakbrr
@kbrnugroho