Before you start, ensure you have the following prerequisites installed on your system:
- Node.js: Installation Guide
- npm (Node Package Manager): It comes bundled with Node.js.
- Git: Installation Guide
To set up a React project with Vite, follow these steps:
-
Create a New Project:
Initialize a new Vite project with the
create-vite
command, using one of the available plugins:-
Using Babel for Fast Refresh (Recommended):
npx create-vite@latest my-react-app --template react
-
Using SWC for Fast Refresh:
npx create-vite@latest my-react-app --template react-swc
Replace
my-react-app
with your preferred project name. -
-
Navigate to Your Project:
Change your current directory to the newly created project:
cd my-react-app
-
Install Dependencies:
Use npm to install project dependencies:
npm install
Now that your React + Vite project is set up, you can start using it:
-
Development Server:
Start the development server with hot-reloading by running:
npm run dev
This will open a development server and display a URL in the console. Open that URL in your web browser to see your React app.
-
Build for Production:
To build your project for production, use:
npm run build
The optimized production build will be available in the
dist
directory.
The default Vite configuration for React should work seamlessly with the chosen Fast Refresh plugin. If you need to make custom configurations, you can do so by editing the vite.config.js
file. Refer to the official Vite documentation for detailed configuration options.
Before you start, ensure you have the following prerequisites installed on your system:
- Python: Installation Guide
-
Install virtual environment
python -m pip install --user virtualenv
-
Setup virtual environment, where
<environment_name>
is replaced by your virtual environment nameGadgets-E-Commerce_React_Django\backend> python -m venv <environment_name>
-
Activate virtual environment
Gadgets-E-Commerce_React_Django\backend> <environment_name>\Scripts\activate
-
After successfully activate virtual environment. Now, Install backend dependencies
(<environment-name>) Gadgets-E-Commerce_React_Django\backend> pip install -r requirements.txt
-
Create makemigrations file
(<environment-name>) Gadgets-E-Commerce_React_Django\backend> python manage.py makemigrations
-
Create database table
(<environment-name>) Gadgets-E-Commerce_React_Django\backend> python manage.py migrate
-
Create superUser for control admin panel
(<environment-name>) Gadgets-E-Commerce_React_Django\backend> python manage.py createsuperuser
-
After command No. (7) set your
username
,email
andpassword
, wherepassword
is invisible for you. -
Now run the server
(<environment-name>) Gadgets-E-Commerce_React_Django\backend> python manage.py runserver
-
Now, your Django server is prepared to communicate with any other frontend.
This project integrates several technologies:
- React: A JavaScript library for building user interfaces.
- React Router DOM: A library for handling routing in React applications.
- Tailwind CSS: A utility-first CSS framework for quickly building responsive designs.
- Firebase: A cloud-based platform for building web and mobile apps.
- Django: A high-level Python web framework for building robust web applications.
Make sure to configure and utilize these technologies as needed for your project.
Contributions to this project are welcome! If you'd like to contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear and descriptive commit messages.
- Push your changes to your forked repository.
- Create a pull request to the original repository, detailing your changes.
This project is licensed under the LICENSE_NAME. Please review the license before using or contributing to the project.
Feel free to reach out if you have any questions or need further assistance. Happy coding!