Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alesancor1/djangorest-react-threejs-template

Template respository with Django and React+ThreeJs for 3D browser development & complex UI
https://github.com/alesancor1/djangorest-react-threejs-template

3d-web django django-rest-framework javascript python react reactjs template templates three-js threejs

Last synced: 7 days ago
JSON representation

Template respository with Django and React+ThreeJs for 3D browser development & complex UI

Awesome Lists containing this project

README

        

# DjangoRest & React+ThreeJs

Template repository using Django in backend as a Rest API consumed by React in front.

## Get Started 🚀

Follow these instructions in order to start your new project!

### Required 🔧

In order to build the app you will need:

* [Node.js](https://nodejs.org/es/download/) - For executing React and install dependencies such as ThreeJs
* [Python + pip](https://www.python.org/downloads/) - Needed for Django & DjangoRestFramework

### Config & Running code 📦

After the installation of Python & pip it's time to install Django and DjangoRestFramework:

* Django - See docs [here](https://docs.djangoproject.com/en/3.1/)
```
pip install Django==3.1.6
```

* DjangoRestFramework - Already configured in this template, just install through pip, see docs [here](https://www.django-rest-framework.org/)
```
pip install djangorestframework
```

Now that Django is installed we need to create a superuser for db before running:
```
cd ./db
python manage.py migrate
python manage.py createsuperuser
```
Introduce an username and password for db superuser (email is not required)

Once the db su is created, you can run the dev server:
```
python manage.py runserver
```
Note: If python has not been added to PATH ```python``` will not be recogniced, instead you can use ```py -3``` (if you installed python 3 or higher) or ```py -2``` (if you installed python 2)

Then you can see the db info in http://localhost:8080/api


Now let's install required dependencies for React-app (ThreeJs is already included)
```
cd ./app
npm install
```
Once the installation finish we can run the js code:
```
npm start
```
This will open a browser window in http://localhost:3000 (if not just do it manually)
You should see a blue cube spinning in the center of screen, the code for this cube is located in App.js file.

## Author ✒️

* **Alejandro Santisteban** - *[email protected]* - [Github](https://github.com/alesancor1)