~/SWArch/5200_flask_app: flask run
- The
UI
relies on theBootstrap
andJavaScript
. - Navigating to the
upload
page, you will be greeted with a drop down menu where you choose the country to upload. - Selecting a country triggers an
Ajax
request to aform factory
that returns correct version of the form based on country selected. - Client side validation is responsible for ensuring that the
required fields
for that country are not empty.
- It is instantiated through the factory pattern.
- It consults rules tables for the fields to be provided for countries.
- The
API
can be invoked by the application as well as the user. - The
API
receives requests, either from the UI or from a service such ascurl
. - When calling the
API
for upload or query,Country Data
must always be provided inJSON
format. API
providesfour
endpoints.- The
home(/api)
endpoint gives information about accessible endpoints and accepted data format. - The
upload(/api/upload)
andquery(/api/query)
endpoints are invoked by the UI throughPOST
requests to upload and query the address data. - The address can also be directly updated using
/api/update/{addressID}
endpont. This accepts thePUT
requests and expectsJSON
payload with the addressID.
- The
- start mongodb:
mongo --authenticationDatabase admin
- use mongodb terminal:
mongo --port 27017 --authenticationDatabase admin
- create a db called
arch
in the terminal:use arch;
//it's not created actually until you insert some ducuments into it - create a collection:
db.createCollection("addresses");
- insert a document into the collection:
db.addresses.insert({"name":"test"});