- Evan Rozhon
- Grant Matejka
- Justin Evans
- Kaitlin Clever
- Sarah Samora
We focused in on a particular field for our project.
This field was Vendor Apps, and what this means is that we wanted to experiement with how CloudHaven and vendor apps would communicate and behave together.
CloudHaven utilizes React, Node, Express and Heroku hosted PostGres database.
All client code is in the upper most directory and server side code is in the 'api/' folder.
Vendor apps are in the subdirectory called apps
.
All CloudHaven requires is the most up to date version of Node and all other dependencies can be installed simply with npm install
Database connection requires valid credentials in a .env file
Feedback is welcome through our Google Form: https://forms.gle/h97ApKGZbs3uEo9R9
https://cloud-haven.herokuapp.com
https://travis-ci.org/github/CPSECapstone/BiggestPig
To aid in the development process here are some provided scripts:
(yarn
can be replaced with npm run
)
This will build and run both server and client side and open to 'http://localhost:3000/' with a proxy to port 5000
Install all the dependencies listed within package.json in the local node_modules folder.
Runs 'npm install' for both server and client side code
Runs our ESLint style checker over all .js files with the --fix tag to automatically fix any simple issues (usually whitespace)
Launches the test runner in the interactive watch mode for client code.
In a bash system should be able to just run script in top level folder called run
.
This will run both cloudhaven and vendor app in parallel and allow them to communicate with each other based on set up ports.
In apps/javaVendor
there is an example vendor app. It runs on http://127.0.0.1:4040/
and by default it broadcasts to the local network. Sending a get request to http://127.0.0.1:4040/
will result in receiving a response indicating how to get customized sample json.
This app relies on libraries with the following Maven coordinates.
com.github.javafaker:javafaker:1.02
javax.json:javax.json-api:1.1.4
org.glassfish:javax.json:1.0.2
org.junit.jupiter:junit-jupiter:5.4.2
In apps/pythonVendor
there is an example vendor app. It runs on http://127.0.0.1:5001/
and by default it broadcasts to the local network. Sending a get request to http://127.0.0.1:5000/
will result in receiving the following default response:
{
"authorization": "6fa691d2c07bea6ae78b7022c80e9d20",
"components": [
{
"columns": [
{
"children": [
{
"component": "textFormField",
"label": "Full Name",
"required": "true",
"validation": "[a-fA-F0-9]"
},
{
"component": "textFormField",
"label": "Address",
"required": "true",
"validation": "[a-fA-F0-9]"
}
]
},
{
"children": [
{
"component": "textFormField",
"label": "Phone Number",
"required": "true",
"validation": "[a-fA-F0-9]"
},
{
"action": "Submit",
"component": "button",
"target": "78b83774d3a907fbea42783d58a95204"
}
]
}
],
"component": "form",
"formID": "78b83774d3a907fbea42783d58a95204"
}
],
"target": "42aefbae01d2dfd981f7da7d823d689e"
}
There is also a second supported operation of sending a GET request to http://127.0.0.1:5001/hello/<name>
to which the endpoint will respond with a custom hello message. This is an example sent to http://127.0.0.1:5001/hello/World
:
{
"message": "Hello World!"
}
- Navigate to the apps directory using:
cd BiggestPig/apps/pythonVendor
- Install the requirements using pip:
pip install -r requirements.txt
-
download the PG admin software from https://www.pgadmin.org/ an exe is not included in this repo in order to keep the versions up to date.
-
When setting up Pgadmin it should prompt you to create a password. this is the password that you will use to log in and set up your own servers.
-
Add the PostgreSQL bin directory path to the PATH environmental variable. *
-
Open the psql command-line tool: In the Windows Command Prompt, run the command: psql -U userName Enter your password when prompted (set up with pg admin).
-
set up database using CREATE DATABASE with the following settings database name VendorApps CREATE DATABASE VendorApps WITH ENCODING 'UTF8' LC_COLLATE='English_United States' LC_CTYPE='English_United States';
-
connect to the database structure in repo \c VendorApps
-
to load the structure use the following command replacing the file path with the filepath to the structure $ ./psql -f FILEPATH.sql -d restoredb -p 5432 -U postgres
- setting the path vairable in windows go to the system and inside advances settings link, you will see Environment vairables , add a new path environment vairable with the location of the bin discussed in step 3.
- Navigate to the pythonVendor directory using:
cd BiggestPig/apps/pythonVendor
- Run the app with:
python dummy.py
- 3 seperate vendor apps with different use cases and programed style.
- Dynamic updates using data from posgres database
- Basic validation on user fields ensuring correcty looking data entered
- Vender App Creation using Approved API
- Profile,Table and Forms all supported
- command line startup using Yarn to manually test vender apps
- expectant form behavior for populated fields such as passwords being * out in webpage.
TODO: make two main demo applications based on in class figma, with the java app based on clinic spec Switch away from yarn and get rid of heroku development instance