This is a sample project that uses React for the frontend and Django for the backend.
- Git should be installed on your machine.
- Node.js should be installed. You can download it from https://nodejs.org/.
- Python 3.6 or higher should be installed on your machine.
- PostgreSQL should be installed on your machine.
- Clone this repository:
git clone https://github.com/username/projectname.git. cdinto theprojectnamedirectory.- Run
npm installto install the required dependencies for the React app. cdinto thebackenddirectory.- Create a Python virtual environment by running
python -m venv venv. - Activate the virtual environment by running
source venv/bin/activate. - Run
pip install -r requirements.txtto install the required dependencies for the Django app. - Create a PostgreSQL database named
projectname. - Create a
.envfile in thebackenddirectory with the following contents:
Replace username and password with your PostgreSQL username and password.
cdinto theprojectnamedirectory.cdinto thebackenddirectory.- Activate the virtual environment by running
source venv/bin/activate. - Run
python manage.py migrateto create the database tables. - Run
python manage.py runserverto start the Django development server. - Open a new terminal window and
cdinto theprojectnamedirectory.
cdinto thefrontenddirectory.- Run
npm startto start the React development server. - Open your browser and go to http://localhost:3000/.