Skip to content

This is the final project of NTU 113-1 Web App course.

Notifications You must be signed in to change notification settings

rongzunzzz/113-1-WebApp-Final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 

Repository files navigation

113-1-WebApp-Final

This is the final project of NTU 113-1 Web App course.

Setup

Start Developing

Clone repo.

git clone https://github.com/rongzunzzz/113-1-WebApp-Final.git

Switch to your main developing branch

git switch backend

or

git switch frontend

Pull from main to ensure the version of the other end is stable

git pull origin main

⚠️⚠️⚠️ Only push either of the frontend or backend folder ⚠️⚠️⚠️

Make sure you are under directory your/local/path/113-1-WebApp-Final/, and enter either

git add frontend/(backend/)
git commit -m "some message"
git push origin dev/frontend(backend)

Backend

Open a terminal and go to backend folder.

cd backend

Create an .env file first for mongodb uri and

MONGO_URI=Your_Mongo_URI

Create virtual environment(MacOS) and activate.

python3 -m venv .venv
. .venv/bin/activate

Install requirements.

pip install --upgrade pip
pip install -r requirements.txt

Run Django server.(http://localhost:8000)

python manage.py runserver

Frontend

Open ANOTHER terminal and go to frontend folder.

cd frontend

Install dependencies

If you use npm then use the corresponding syntax/commands.

yarn

Run frontend(http://localhost:5173)

yarn run dev

Backend Migrations

python manage.py makemigrations 
python manage.py migrate 
python manage.py runserver

Backend API testing, e.g. saveTest

curl -X POST http://127.0.0.1:8000/api/saveTest/ \
-H "Content-Type: application/json" \
-d '{
    "test_id": "test123",
    "title": "Sample Test",
    "questions": ["What is your name?", "What is your age?"],
    "results": ["Result A", "Result B"],
    "backgroundImage": "http://example.com/image.jpg",
    "user_id": "user456"
}'

About

This is the final project of NTU 113-1 Web App course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published