- Install mongodb and postgresql.
- Install python dependencies
pip3 install pymongo
andpip3 install psycopg2
- Find keywords
connection string
indb_script/init_db.py
and replace connection string. - Run the
init_db.py
GET
/api/orders which returns array of json:
{
"_id": "1",
"company_name": "Roga & Kopyta",
"customer_name": "Ivan Ivanovich",
"order_date": "2020-01-02T15:34:12Z",
"delivered_amount": 6.73,
"total_amount": 918.13
}
POST
/api/ordersBetween that ACCEPTS json body:
{
"start": "2019-02-16T13:00:00.000Z",
"end": "2020-02-23T13:00:00.000Z"
}
and in response sends array of json:
{
"_id": "1",
"company_name": "Roga & Kopyta",
"customer_name": "Ivan Ivanovich",
"order_date": "2020-01-02T15:34:12Z",
"delivered_amount": 6.73,
"total_amount": 918.13
}
- Install all dependencies:
go get -u github.com/gorilla/mux
go get github.com/gorilla/handlers
go get github.com/jinzhu/gorm
go get go.mongodb.org/mongo-driver
go get github.com/lib/pq
- go to pghelper/pghelper.go change the connection string to suit your environment
- go to mongohelper/mongohelper.go and do the same.
- run the server
go run backend/main.go
. - endpoint will be served in localhost:9999
cd to frontend/packform-test
and donpm install
npm run serve
openlocalhost:9999
There's a bug with the date range picker, filtering this way never works on the first try but any instances after will work fine.