Skip to content

Ajay-Dhangar/my-react-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my-react-app

This project is a basic React application created for practice purposes. It uses both npm and yarn as package managers to demonstrate their usage. This README.md file will guide you through the setup process, project structure, and various commands you can use.

Table of Contents

Introduction

my-react-app is a simple React application built for educational purposes. It serves as a starting point for beginners to learn about React, project setup, and package management using npm and yarn.

Getting Started

Prerequisites

Before you begin, ensure you have the following installed on your local machine:

  • Node.js (version 18 or higher)
  • npm (comes with Node.js)
  • yarn (optional, but recommended)

You can check your Node.js and npm versions by running the following commands in your terminal:

node -v
npm -v

To install yarn, run:

npm install -g yarn

Installation

To set up the project on your local machine, follow these steps:

  1. Clone the repository:
git clone https://github.com/ajay-dhangar/my-react-app.git
cd my-react-app
  1. Install dependencies using npm or yarn:
# Using npm
npm install

# Using yarn
yarn install

Running the App

To start the development server, you can use either npm or yarn:

# Using npm
npm start

# Using yarn
yarn start

This will launch the app in your default web browser at http://localhost:3000.

Project Structure

Here's an overview of the project structure:

my-react-app/
├── node_modules/
├── public/
│   ├── index.html
│   └── ...
├── src/
│   ├── components/
│   │   └── ExampleComponent.js
│   ├── App.js
│   ├── index.js
│   └── ...
├── .gitignore
├── package.json
├── README.md
└── yarn.lock
  • public/: Contains the public assets and the HTML file.
  • src/: Contains the React components, main application file, and other JavaScript files.
  • .gitignore: Specifies which files and directories to ignore in the Git repository.
  • package.json: Lists the project dependencies and scripts.
  • yarn.lock: Lock file for dependencies when using yarn.

Available Scripts

In the project directory, you can run the following scripts:

npm start / yarn start

Runs the app in 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 / yarn test

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

npm run build / yarn build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back! If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Learn More

To learn more about React, check out the React documentation.

You can also refer to the following resources:

Contributing

Contributions are welcome! If you have any suggestions or improvements, please open an issue or create a pull request. For major changes, please discuss them first by opening an issue.

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/YourFeature)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add some feature')
  5. Push to the branch (git push origin feature/YourFeature)
  6. Open a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.