*Resident Resource Network - Hope *
Project Architecture
* First time users for local setup please jump to * Software Download and Setup Step
Technological Stack for this Project
- Java 1.8 or higher
- Spring Boot 2.x or higher (see version in pom.xml) - spring boot comes with embedded tomcat
- Thymeleaf for UI bindings to Backing bean
- Bootstrap CSS for styling
- jQuery for browser scripting and traversing
- PostgreSQL for database - our database can be hosted online like in ElephantSQL platform
- Datatables API for all tabular presentation
- C3.js for all Charting in reports Tab.
Java / Spring - Intermediate knowledge is required. Others (Thymeleaf / Bootstrap / jQuery / etc..) - Beginners knowledge should be enough to maintain project. PostgreSQL - Good to have SQL knowledge that should be enough.
Production Deployment and prerequisites
In order to deploy to production, please see database-setup-prod.dml.sql you need to modify this file and add few things: (look for all "TODO" in this file) and add accordingly
- Cross check Property Table and validate each insert statements to see if properties names, county , state , city all looks correct
- Create Insert Statements for REFERRAL_PARTNER TABLE - (basically All Agencies names)
- Insert row into Service coordinator table. Remember to always insert Encrypted password in DB not direct password
- how to Encrypt Password - see image below
- use this encrypted password for your given password and go to section writeup insert into service_coordinator dml (refer example in data.sql for same)
- once you do this you have to write up insert into user_role table as well (user_id , role_id ) is must. user_id = sc_id from service_coordinator table. ROLE_Id = 1 or 2 (1 = ROLE_ADMIN and 2 = ROLE_USER) - Look for TODO in this .dml.sql file.
- Once this file - database-setup-prod.dml.sql is modified, saved, copy paste entire contents and run in production Schema (this is one time task) - once SC started using website - DO NOT run contents of this file as it will overwrite database.
- This concludes Database setup
Deploy to Cloud - May have to look Microsoft Azure Spring boot deployment and how routing is done. (we have shown in past how to deploy with Pivotal Cloud Foundry)
- routing is nothing but global load balancer url or host url of the project that is connected to source IP of the system
- Memory instance and all have to be defined as per Azure documentation.
Database Management
- If you go with ElephantSQL, have their own database backup so you are not going to loose any data in case of a disaster.
- Once resident is in System he/she should be always in system and should never be deleted from the System.
- Quarterly and Demographics Report includes Inactive and Active Resident both to produce accurate number of resident served for a given year.
- Action Plan, Contact Notes and all 7 life domain assessment maintains system of record by "on_this_date" so you will find this field in these table.
- There may be scenario like in 10 years if there are tons of assessment per resident and you want to archive those you should only archive these table - Action Plan / Contact Notes and Resident Assessment Questionnaire but System should be performant enough to handle data quantity easily.
- Its good idea to go over database-setup-prod.dml.sql to understand database in depth and then also understand how views are written.
- we extracted ER Diagram from DBeaver tool and then saved as PNG in repo, if more tables are created in future ER Diagram needs to be recreated and export as PNG.
hint: please see which dataTaype is json , date, number, varchar etc to look closely how data is getting stored in each
- Views are created to make data extract from json field easy based on per life domain and so on.
Project Screen Shots:
Engagement and Intake pending numbers don't automatically updates while you are logged in. Once you logout and login back you will see numbers.
Software Download and Setup
- Download Eclipse or any similar Development Space
- Create a folder "workspace" in any drive and open eclipse Project here.
- Go to Help Menu under Eclipse then Marketplace and download plugins atleast: Eclipse Web Developer Tools, DBeaver, Egit, Spring Tools 4
- It may ask to restart eclipse several time after each plugin as shown below but you can do so once after installing all the plugins
- Configure JDK Version in Eclipse as shown below:
- Download lombok and follow the instructions from the website. find your eclipse.ini file and add what is shown in the image below, restart eclipse (Lombok is useful in compiling @Data Annotation locally to support getter/setter else you will get compile time errors on all getter setter)
- Eclipse Maven setting --> window preferences type "maven" and follow below screen shots:
- Download DBeaver
- Git Clone project from the github Release1 Branch - Release1
Database configuration
- we are using PostgreSQL in our project for backend Relational Database. Please follow link here to create your own account:
- ElephantSQL - Choose TinyTurle Free Plan while creating instance (it gives you 20 MB which is more than enough to Store 1000s of record in each table)
- After creating instance go to "Details" Tab and it will look like this
- Let's Open this DB on DBeaver now: open DBeaver that you downloaded from above step and File -> New -> DBeaver (Database Connection) as shown in iamge below:
- Put values from your elephantSQL Account as shown below:
- Copy entire contents of data.sql from github location - data.sql and put it in new SQL Editor of DBeaver and execute entire SQL Script (Alt +X) in DBeaver. This will create All tables/ views and insert initial Data
- After Executing Script your Table and views looks like as below:
- Please go through data.sql file completely and you will understand how each views are written for complete Reporting.
Configure Local Workspace
- Clone Projet from GitHub and import as git project into Eclipse
- Configure Eclipse Maven Run Configurations, Go to "Run" and "Do run configurations" right click above maven build and choose "Create new"
- clean build Project go to Project and choose Clean build as shown in image below:
- In order to deploy to cloud you may also need to generate JAR add one more Maven jar Config as shown in picture below, after run you will see jar created in target folder (Refresh Target folder).
Start Server
- open Application.properties under resources and put url, username and password from ElephantSQL Details tab after logging in ElephanSQL Account
- Configure Spring Boot Settings and see below Screenshot:
- open http://localhost:8080 Looks port in server logs where your server started. This port can specified in application.properties if you want to override on top of 8080, google how to override spring boot port.
Deploy on Cloud - TBD
How to debug UI
How to use onboarding Modify functionality
Together with name, property search we have also enable email, text, voicemail, address search as well. Please see screen shot below: