MDP is a portal created for hospital staff use. This app was tailored for ease of use and access for important hospital information consisting of patient and report information.
API routes that will be used by our frontend server
Schema of how MDP's database will be set up using PostgreSQL.
List of features needed for the Minimum Viable Product (MVP) and its CRUD features.
The most difficult challenge was finishing the Many to Many relationship feature. Because I wanted many to many relationships to be edited when a staff clicked on save, I had to keep in mind the current state so I can accurately pass in the correct data to my REST API to whether add or delete a relationship. Not only was this a challenge for the front-end but also the backend. I have to accurently parse the information making sure that the relationship must exist before deleteting and that the relationship must not exsist before deleting. I know there could be duplicates of relationships that can cause errors and break the server.
- Full CRUD for Reports
- Full CRUD for Patients
- Full CRUD for Departments
- Full CRUD for Messages
- Full CRUD for Many to Many relationships between, Reports, Patients, Departments, Staffs
- Setup AWS S3 to allow staffs to upload profile picture for themselves or patients.
- Setup WebSockets to allow messaging between staff in real time.
- Canvas to allow highlight when hovering over department buildings
- React.js
- Python
- Flask
- Render
- Docker
- PostgreSQL
- AWS
- WebSocket
-
Clone this repo
https://github.com/vernfongchao/MDP.git
-
Install dependencies for the back end
pipenv install --dev -r dev-requirements.txt && pipenv install -r requirements.txt
-
Install dependencies for the react front end
cd react-app npm install
-
Create PostgreSQL user
CREATE USER mdp_app_dev WITH CREATEDB PASSWORD 'any_password'
-
Create PostgreSQL Database
CREATE DATABASE mdp_app WITH OWNER dp_app_dev
-
Create a
.env
file in the root directory with the same variables as.env.example
and change the value of DATABASE_URL and SECRET_KEY- Replace 'password' with any that you see fit and make sure its the same password when creating database User
DATABASE_URL=postgresql://mdp_app_dev:any_password_here@localhost/mdp_app
- Replace the value of SECRET_KEY to any secure encripted string of characters
SECRET_KEY=Thisistotallynotawellkeptsecretkey,makesureyouchangeit
- Go setup your AWS account and bucket (Please follow this guide for setup)
S3_BUCKET='bucket name' S3_KEY='AWS User Key' S3_SECRET='Any secret key of your choosing'
-
Flask backend, Migrate, Upgrade, and Seed! In the root directory run
pipenv shell flask db upgrade flask seedall
-
Start back end server while in root directory
flask run
-
In a new terminal, enter react frontend directory and run
npm start
-
If a new broswer tab does not open, navigate to
localhost:3000
in your browser -
Start using Stay The Night!, Demo user is set up in the Login form. Please Enjoy!