Medify was a project developed by three separate teams of four developers. The teams focused on the Database/Api level, the Backend controllers and the Frontend webpages.
Medify is a Java WebApp developed using the Java Spring Model View Controller framework and currently intended to run off of a Apache Tomcat local server.
The purpose of the application was to develop an engaging solution to aid individuals with FASD in developing routines of taking medications, while also giving a system to their assigned case workers to be able to track their medication adherence.
This demo focuses on the perspective of the systems primary user group (individuals with FASD) and was developed for the course CIS 3750 at the University of Guelph along with assistance from Comminuty Living Cambridge as our community partners for the course.
Please ensure you have JDK 8 installed
I suggest using IntelliJ for your IDE and will write thetinstructions for getting setup using IntelliJ. It has built in support for building Spring and Maven applications. It also has support for viewing/editing databases integrated (so no need to use SQLDeveloper) And its free for students!
I am going to go over the process of cloning the project through IntelliJ as it is the simplest way. Alternatively you can still clone via command line and import with your preffered IDE.
- Navigate to File > New > Project from Version Control > Github
- Paste this repo's repoistory URL in the the top field (https://github.com/FilipHasson/BestSuperTeam.git)
- Change your path/directory name if you wish and hit clone
- When the project is downloaded you will have to do some basic setup with Intellij
- In the bottom right corner corner click the speach bubble to open the Event Log
- There should be a message reading
Non-managed pom.xml file found:
- Click the link below reading
Add as Maven Project
and wait for the process to complete - There should be another event reading
Frameworks detected: Web framework is detected in the project
- Click the
Configure
link - This should bring up a popup, if it has a list of selected files click OK without changing any
10.1 If it reads
No frameworks are detected
simply click OK - Clear your event log
- Attempt the next section Building The Project, this should give you a new event reading
Error running Build: Project JDK is not specified.
- Click the
Configure
link - Select Java Verson 1.8 you may have to click New > JDK and navigate to your
- Ensure that Project Language Level is set to
8 - Lambdas, type annotations ect.
- Click Apply followed by OK and attempt to run the build again, this time it should succeed
Now that the project is fully imported we will need to build it
- Navigate to Run > Edit Configurations...
- In the top left corner of the new window click the + sign
- Select Maven from the dropdown list
- Name the configuration 'Build'
- Ensure the Working Directory is pointing to your project directory
- Enter
clean install
in the Command line field - Click 'Apply' then 'OK'
- Navigate to Run > Run 'Build'
- In the bottom of the screen you should see an output log. This may take several minutes the first time you run this as all the dependancies need to be resolved and downloaded. Once you see BUILD SUCCESS check that a .war file was generated in the new target directory of your project
This section will go over installing your local Tomcat 7. This is an application server that will run off of your own machine and is used as a testing/development environment
- Go to Tomcat
- Click '7.0.82' under Quick Navigation
- When the .zip file downloads extract create a directory named 'Tomcat' and extract the contents of the .zip there
- Within your tomcat directory go to conf and edit tomcat-users.xml erase the contents of the file and replace it with:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager-gui"/>
<user email="admin" password="admin" roles="manager-gui"/>
</tomcat-users>
- Save the file, you can change the email and password if you wish, but this is a local server so it won't matter security wise
Now that you have your project built as a .war and your Tomcat installed this section will show how to deploy/run the project
- Ensure that your Tomcat is not running (If this is your first time doing this disregard this step)
- Copy your .war file:
~/target/best-superteam.war
- Paste your .war file in:
~/Tomcat/webapps
- In a terminal cd to the Tomcat directory
- Run the command
./bin/startup.sh
- Verify the server stared up with the command
tail logs/catalina.out
- The last line of output should look similar to:
INFO: Server startup in 4852 ms
- This means your server has started, if it does not give this message try the command again in a few seconds. Depending on the size of the application and speed of your computer startup time will vary
- In a web browser go to (http://localhost:8080) to verify that the server has started (should have a GUI)
- To run our application go to (http://localhost:8080/best-superteam/)
- Alternatively you can go to the Manager App and log in with the credentials you defined above and enter the application through there
- To shut down your Tomcat server from the Tomcat directory run the command
./bin/shutdown.sh
Note: If you redeploy a new WAR and notice no changes, shutdown the server, delete the best-superteam
directory from within ~/Tomcat/webapps
and start the server again
Going to document fixes to miscellanious project settings problems that occur.
- Navigate to File > Project Structure > Project Settings/Modules
- Change
Language Level
to8 Lambdas, Type Annotations ect.
- Navigate to File > Settings > Build, Execution, Deployment > Java Compiler
- Change
Target Bytecode Version
to 1.8
With the most recent commit to the Database branch I've created a locale Sqlite3 Database for our use. To view/access the database through IntelliJ:
- Open the Database View (ctrl+shift+a search for database)
- Click the green plus sign in the top left corner of the new window
- Select Data Source > Sqlite(Xerial)
- Under file hit ... and navigate to ~/BestSuperTeam/database/bestsuperteam.db
- Click the button underneath to download the approrpaite driver
- Click Apply then OK You should now be able to view all the databases/schemas/tables and edit them in IntelliJ
In order to run the program and successfuly use the database there are a few quick changes that need to be made.
- Open the file
src>main>java>com>best>superteam>config>Constants.java
- Edit DB_PATH by replacing the '~'symbol with the path to your directory for example mine looks like:
"C:/Users/filip/IdeaProjects/BestSuperTeam/database/bestsuperteam.db"
Second is importing the library for sqlite in IntelliJ
- Navigate to File > Project Structure
- On the side panel select Libraries
- Click the plus sign on the top of the page to and select Java
- In the file selector go to
~/BestSuperTeam/database/sqlite-jdbc-3.21.0.jar
- Click Apply and OK The code should now be able to run and not get an SQLException when reaching JDBC portions
Because of the number of people developing for this project we should follow a proper project management system
master
should always contain our last delivered demo code, thus it will always be working
develop
is where we will merge our each teams changes. We should only be merging functioning code into develop, and this branch will work as a staging ground to ensure everything is working be
The remaining 3 branchs i've create database
, backend
, and web
can be used at the discretion of each team. You can create branches off of these for individual developers, individual features or simply push directly to that branch.
Before attempting to merge into develop
or master
you should submit a Pull Requeest so that someone else can review the changes before attempting the merge. This will minimize the potential for any conflicts, catch issues or bugs, and reduce the ammount of commits to the main two branches low which will help with tracking whats actually been done.