Before you start, ensure you have the following prerequisites installed on your system:
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:
Install virtual environment
python -m pip install --user virtualenv
Setup virtual environment, where <environment_name>
is replaced by your virtual environment name
Gadgets-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
and password
, where password
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:
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:
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!