https://github.com/arvind-4/django-react
Django-React-Typescript-Vite Starter Template
https://github.com/arvind-4/django-react
css3 django django-react django-react-integration html5 javascript python3 python39 react reactjs typescript vite vite-django vitejs
Last synced: 6 days ago
JSON representation
Django-React-Typescript-Vite Starter Template
- Host: GitHub
- URL: https://github.com/arvind-4/django-react
- Owner: Arvind-4
- License: mit
- Created: 2021-12-25T15:40:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-18T13:31:29.000Z (about 1 year ago)
- Last Synced: 2024-08-18T14:42:47.877Z (about 1 year ago)
- Topics: css3, django, django-react, django-react-integration, html5, javascript, python3, python39, react, reactjs, typescript, vite, vite-django, vitejs
- Language: Python
- Homepage: https://awesome-django-react.vercel.app
- Size: 555 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django-React Starter Template
## Stack
- [React](https://reactjs.org/) - A JavaScript library for building user interfaces.
- [Django](https://www.djangoproject.com/) - Django makes it easier to build better web apps more quickly and with less code.
- [Vite](https://vitejs.dev/) - Next Generation Frontend Tooling
- [Typescript](https://www.typescriptlang.org/) - JavaScript with syntax for types.
## Project structure
```
$PROJECT_ROOT
│
├── src/backend # backend file
│
├── src/ui # React files
│
├── src/templates # Django Templates
│
├── src/staticfiles # Django Static Files
```
---
### Get the Code
#### For Backend
- Clone Repo
```bash
mkdir django-react
cd django-react
git clone https://github.com/Arvind-4/django-react.git .
```
- Create Virtual Environment for Python
```bash
python3.10 -m pip install virtualenv
python3.10 -m virtualenv .
```
- Activate Virtual Environment
```bash
source bin/activate
```
- Install Dependencies
```bash
cd src
pip install -r requirements.txt
```
- Install Dependencies (For Poetry)
```bash
cd src
poetry install
```
- Make Migrations
```bash
cd src
python manage.py makemigrations
python manage.py migrate
```
- Run Server
```bash
cd src
python manage.py runserver
```
#### For Frontend
- Install Dependencies
```bash
cd src/ui
pnpm i
```
- Run Vite
```bash
cd src/ui
pnpm dev
```
- For production
```bash
cd src/ui
pnpm collectstatic
```