Skip to content

TimChou-ntu/muimui_backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

muimui_backend

Our system architecture

system architecture

Other codes

Env

  • python 3.7.1

How to run

  • Install project dependencies
$ pip3 install -r requirements.txt
  • Create .env and put your secret key in it
$ cd mysite/
$ echo SECRET_KEY={your secret} > .env
  • Migrate database tables
$ python3 manage.py makemigration
$ python3 manage.py migrate
  • Create super user
$ python3 manage.py createsuperuser
# follow the prompts and create the user
  • Run the backend server
$ python3 manage.py runserver 0.0.0.0:8000
  • Run the backend server in ssl
$ python3 manage.py runsslserver
  • You can access backend by input http://localhost:8000/hide/ in your browser

REST API format

Auth

  • login
    • POST http://localhost:8000/api/token/
    • data: {"username", "password"}

view cars (AuthOnly)

  • view all cars
    • GET http://localhost:8000/rest/clients/
  • reserve a car
    • POST http://localhost:8000/rest/clients/
    • data={"carID"}

connect to car

  • get sdp, ip, carID
    • GET http://localhost:8000/rest/cars/<YOUR_TOKEN>/
  • send your sdp answer
    • POST http://localhost:8000/rest/cars/
    • data={"carID", "sdp", "carIP"}

Websocket connection

  • to construct a websocket connection
    • ws:/localhost:8000/ws/chat/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages