In this blog, I will be talking about our first sprint retrospective. My team is working on making free food pantry software. In the first few days of class, we were doing research on different food pantry software. There was not much we could find that is open source and free which kinda sucks since food pantries are not for profit. Since these softwares are not free, we could not even demo them, therefore it was hard to get an idea on what this software should look like and what functionalities it should have.
After getting assigned into teams, our first sprint started. The first day we all sat together, there was some initial set up that we had to do so that we could communicate with each other and have tasks assigned to each of the members. We set up a task board using trello, joined the slack group for our team, and shared everyone’s contacts and git usernames. In our second meeting, we were trying to figure out where to start. We know that we were working on a food pantry software but we were not sure as to what we should actually be doing since other colleges are working on the same software as well. Then I saw on the slack channel that the other channel that they needed a REST API. So we started planning.
The first thing that we talked about is what functionality this REST API would have. The only thing we know is that we need this API to read a JSON file from the USDA’s website. After looking through the file, there was a lot of information about food and their expiration and some other stuff like tips on cooking or if they need to be refrigerated. Since we know that we are gonna be hosting this API we discussed on where to host it. There were a couple of options but we settled with Heroku since there is a free tier option although it might be a slower service since it has a thirty seconds time out when your API is not being used. Then we talked about which language we are gonna use. Researching about reading a JSON file, most of the tutorials were in Java and since we all have experience using Java, we have settled on it. The next thing was setting up an initial commit on gitlab for our project. Most of it was done by Sean and he was handling most of the task board as well. While the others work on figuring out how to host our API on Heroku.
To host a Java application on Heroku you need three things:
- Java 8*
- Maven 3*
- Heroku CLI and an Account
After that, we researched how to read and write a JSON file. We are using JSON.simple to parse the foodkeeper.json file.
Steps I took:
- Download JSON.simple jar file
- Import the jar file into Eclipse by adding it to your project’s build path
- Added json.simple dependency into the pom.xml file
-
<
dependency
>
<
groupId
>com.googlecode.json-simple</
groupId
>
<
artifactId
>json-simple</
artifactId
>
<
version
>1.1.1</
version
>
</
dependency
>
There are a few tips on reading the JSON file. JSON file consists of array and objects so you just have to create an object or an array depending on what you are trying to get.
ex. Array [], Object {}
A JSON file might have something like this:
“sheets”: [
{
“name”: “Version”,
“data”: [
That means that there is an array called sheets, and an object inside the array called “name”. You can get to it by creating a JSON object first and then creating a JSON array like this:
Object obj = new JSONParser().parse(new FileReader(“foodkeeper.json”));
JSONObject jo = (JSONObject) obj;
JSONArray sheets = (JSONArray) jo.get(“sheets”);
We still have a lot to do, so hopefully, on the next sprint we could implement and get all the necessary information from the JSON file and have methods to return them as an object or as a JSON file.
From the blog CS@Worcester – Computer Science by csrenz and used with permission of the author. All other rights reserved by the author.