This template provides a minimal setup to get React working in Vite with HMR and ESLint rules. You can use this project as a quick-start setup with the following configurations:
Clone the project
git clone https://github.com/albin-joseph/aj-react-template.git <project_name>
Replace
Remove existing git history
If you want to use the template as a fresh project, remove the existing .git history:
cd <project_name>
rm -rf .git
Reinitialize Git
Reinitialize Git for your new project:
git init
git add .
git commit -m "Initialize project from template"
Install Dependencies
install the required packages using npm or yarn:
npm install
or
yarn install
Update Project-Specific Details
package.json
and update the following fields:Set Up Environment Variables
If the template includes an .env.example
file, create a .env
file:
cp .env.example .env
Update the .env file with project-specific values.
Start the Development Server
npm run dev
Push to Your Own Git Repository
If you want to host the project in your own repository:
git remote add origin <your-repository-url>
git branch -M main
git push -u origin main
Customize the Template
Start modifying the template code to suit your project needs.
<module-name>.page
: Handles state management, lifecycle methods, and API calls. <module-name>.view
: Base visual/presentation view; includes subcomponents based on the UI design. <module-name>Slice
: Redux implementation. <module-name>.service
: Module-specific API implementations. <module-name>.utils
: Contains utility methods. components
folder: Stores all module-related subcomponents.To create a new module, run:npm run create-module <module-name>
Example:
For the Home
module:npm run create-module Home
Note: