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:

    1. Install BikinProject: Start by installing BikinProject on your machine.
      npx bikinproject@latest
    
    1. 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 .
    
    1. 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
    
    1. 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
    
    1. 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
    
    1. Start Building Your Project: After BikinProject generate the starter project, you can start building your project.

    2. Copy Environment Variable: Copy the environment variable with the following command

    cp .env.example .env
    
    1. 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:

    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