nicholeemma / conquest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raise a Request through Conquest API

An App allows user to create a request and attach a picture to that request.

Basic ideas

Users fill in request related information, with submit button clicked, the request will be stored as an item in the database, meanwhile, the information will be transformed in JSON format and post to Conquest "create_request" API. If the post is successful, requestID will be returned. The requestID and picture address will be transformed in JSON format and post to Conquest"add_document" API. After that a picture is linked to the request in success. The users can see the what did they input in the below "request information table".

Demo

Web app demo for create a request https://youtu.be/Y4eUWJ544Oo

Check the result from the mobile App https://youtu.be/9yKiXP4yq5w

Tech-Stack

How to use

  1. Under the path \conquest\conquestapp, open console, run " python manage.py runserver 8100" (Before this, you might need to pip install python and django)
  2. Open the "http://localhost:8100/" in the browser

Relevant Code:

Front end: https://github.com/nicholeemma/conquest/tree/master/conquestrequest/templates/index.html

Back end: view.py demonstrates how the data interact, post to API and show on the webpage

model.py data schema

form.py form validation

url.py directs which function corresponds to the page

Attention: The token can be out of date, you might need to update the token in view.py line 44

What can be improved in the future

  1. Form validation (For now, I used a content length limit as one rule of form. In the future, the form can validate whether the picture link is accessible and workable)
  2. Picture upload(If the current web application can be deployed and accessed through a HTTPS link, I can upload the picture from desktop. The picture will be firstly stored in the database and can be accessed through HTTPS link, then I can use this link as "address" to attach a picture in a request. I have realized partial development.)
  3. UI

Jiayue(Nicole) Yang 6/11/2020

If you have any question, contact me through "hpyangjiayue@gmail.com"

About


Languages

Language:Python 74.9%Language:HTML 25.1%