Hosted by Rubberdøk
Demo repo used in crash course for students learning web development. Contains a basic React frontend and Django backend for creating and showing todos.
Table of Contents
Following these steps prepares you to join the interactive demos of the crash course. If you have any trouble with the preparation, please file an issue.
- Download and install
Node.jsfrom https://nodejs.org/en/- Select the "Recommended For Most Users" option
- Find the terminal on your computer
- Mac:
Terminal - Windows:
Powershell/Command Prompt/Windows Terminal
- Mac:
- Open the terminal, and check that Node was installed correctly by typing
npm --version- If
npmis not recognized, try restarting your computer. If it still does not work, try following these steps for Windows, or these for Mac.
- If
- Open the repository folder in the terminal and type
cd react-demo - Type
npm installto install the project's dependencies - Type
npm start- After some setup, this should open a browser tab with your app! Now you're all set for the interactive demo.
- Download and install Python from https://www.python.org/ (if you don't already have it)
- Find the terminal on your computer
- Mac:
Terminal - Windows:
Powershell/Command Prompt/Windows Terminal - VSCode:
Terminal(in the top bar) ->New Terminal
- Mac:
- Install Python 3.9 or 3.10, then check that it was installed correctly with
python --version- If using Python 3.14 or later, please change the
django-demo/backend/requirements.txtDjango version as described by comment.
- If using Python 3.14 or later, please change the
- Open the repository folder in the terminal and type
cd django-demo/backend - Create a virtual environment with
python -m venv .venv - Activate the virtual environment:
- Windows PowerShell:
.\.venv\Scripts\Activate.ps1 - Mac/Linux:
source .venv/bin/activate
- Windows PowerShell:
- Type
pip install -r requirements.txtto install Django and the backend dependencies - Type
python manage.py migrateto initialize the database - Type
python manage.py loaddata initial_datato load example authors and todos - Type
python manage.py createsuperuserto create an account for the Django admin - Type
python manage.py runserverto run the backend athttp://localhost:8000 - Open a new terminal window (and leave the previous one running!)
- Move to the frontend with
cd django-demo/frontend - Type
npm installto install the frontend dependencies - Type
npm startto run the frontend athttp://localhost:3000
I recommend everyone to install VSCode as your code editor:
- Download and install from https://code.visualstudio.com/
- Launch it
- Go to
File -> Open Folder - Find the
react-demo/django-demofolder (depending on which project you want to open), and double-click it. If you made it from a fresh terminal window earlier, it should be located in:- Mac:
/Users/[your username]/[react-demo/django-demo](pressCommand + Shift + Hand you should see it) - Windows:
C:\Users\[your username]\[react-demo/django-demo]
- Mac:
- Now you should see your React/Django files on the left in VSCode. Next time you open VSCode, you'll enter right into this folder and be ready to join the demo!
react-democontains a simple React todo app used for the interactive demo.django-demo/backendcontains a simple Django backend for todos, with a GraphQL API using Graphene.django-demo/frontendis a copy ofreact-demo, but now connected to the Django backend to fetch and create todos.slidescontains the presentation slides from the crash course (in Norwegian, since the course has been held for students in Trondheim)