Tracking the Spread of COVID-19 at Chicago Public Schools, the 3rd Largest Public School District in the United States
Tags: serverless, aws, covid19, javascript
Published: 2021-02-12 16:47:45

## Some Background 
The Chicago Public School District (CPS) is the 3rd largest school district in the United States [[1]](https://en.wikipedia.org/wiki/List_of_the_largest_school_districts_in_the_United_States_by_enrollment) serving more than 355,000 students in 642 Schools [[2]](https://www.cps.edu/about/stats-facts/). On March 13, 2020, with 46 cases of COVID-19 being reported in Illinois, including cases at a CPS school [[3]](https://chicago.suntimes.com/news/2020/3/6/21168708/coronavirus-cps-high-school-aide-portage-park), all on-site learning was halted and classes transitioned to a remote model. 

As COVID-19 ravaged the United States and the world, the children remained home and everyone adjusted to this new way of learning. The 2020 school year completed remote, and the 2021 school year began remote with a plan for future hybrid learning in the works. With the coming of 2021, CPS pulled the trigger and opened their schools to students who opted in to in person learning with plans in place to make learning safe [[4]](https://www.cps.edu/school-reopening-2020/health-and-safety/).

While CPS has maintained that they will prioritize the safety of students, teachers, and staff, many question the feasibility of this. Over the Summer, CPS surveyed parents, students, and staff to gauge their desire to return to in-person school. While parents remained relatively split, teachers and staff remain very united in their desire to continue teaching remotely, with only 10.5% of teachers wanting to return to their classrooms [[5]](https://www.cps.edu/school-reopening-2020/reopening-framework/).

![Two pie charts. Chart 1 shows that for parents of K-8th grade students opinions on returning to school, 28.1% say Yes, 40.8% say No, and 31.1% are not sure. Chart 2 shows Teachers opinions on returning to school, 10.5% say Yes, 69.9% say No, and 19.9% are not sure.](https://dev-to-uploads.s3.amazonaws.com/i/0896eqkmn1gdxp1334h4.png)


Since the Summer, community prevalence of COVID-19 in Chicago has risen [[6]](http://www.dph.illinois.gov/countyschool?county=Chicago) yet CPS remains certain of their ability to safely return to school. This transition started January 11, 2021 as CPS schools reopened their doors for Pre-K students who opted for to in-person learning. CPS also had plans to expand this to the elementary students (K-8th) on February 1, 2021, but that was delayed due to push back from the Chicago Teachers Union (CTU) which resulted in Pre-K students and teachers temporarily returning to remote learning.

CPS and the CTU have now agreed on a phased return plan which will have all (opt-in) elementary students returning by March 8 [[7]](https://www.chicagotribune.com/coronavirus/ct-covid-19-cps-ctu-union-vote-schools-reopen-20210210-k6453s2syndw7gilvmwn3learm-story.html).


| Grades | Teachers Return | Students Return |
|:-------:|:---------------:|:---------------:|
| Pre-K   | February 11    | February 11    |
| K-5th   | February 22    | March 1        |
| 6th-8th | March 1        | March 8        |

The perennially warring factions of parents, teachers, and administrators are unlikely to agree on the how effective CPS's safety interventions are in keeping students and staff safe. However, one thing we can use to measure efficacy and drive our decision making so to whether we think it is safe for our children to be in school is data. 

To facilitate this, I have created a CPS COVID-19 dashboard that will display the COVID-19 case data made [publicly available](https://www.cps.edu/school-reopening-2020#trackingCOVID) by CPS. 

Obvious caveats to these data are that CPS will only share "actionable" cases that are reported to them. This means that if a parent doesn't report that their child has a positive test, that child's case will not be in CPS's numbers. It also means that CPS makes a determination as to whether a case is "actionable" suggesting that not all cases reported to CPS will meet a standard to warrant disclosure to their classroom and school and, therefore, will not be added to the case numbers. More information about potential caveats of the data and how to read the data can be found at the [FAQ](https://cpscovid.com/faq.html).

The live site can be found at [cpscovid.com](https://cpscovid.com/index.html).

---
## Architecture

### Back-End

[GitHub Repository](https://github.com/misterjacko/CPS-COVID-BE)

![Image of back end architecture1](https://dev-to-uploads.s3.amazonaws.com/i/n02w2mqe4095a79lcfz8.png)

I built a serverless back-end using the [AWS Serverless Application Model (SAM)](https://aws.amazon.com/serverless/sam/) and have hosted it on AWS. The application consists of:

- An EventBridge Scheduled Event
- A Lambda function written in Python that collects and parses new data using [Pandas](https://pandas.pydata.org/)
- A .csv file updated daily by the Lambda that contains all the data
- A Cloudwatch alarm that will notify me via SNS if an update fails

![Architecture with labels first phase](https://dev-to-uploads.s3.amazonaws.com/i/s35tepafmq3sjou3rx9p.png)

Every night the Lambda function is triggered by an EventBridge scheduled event. The Lambda function imports both historical data from my S3 bucket and updated data from the CPS spreadsheet into Pandas dataframes. 

![Architecture with labels second phase](https://dev-to-uploads.s3.amazonaws.com/i/4o163e20kkbww8pdhrxo.png)

Then the function updates the historical dataframe with a new date and any additional cases that were reported that date. The updated data is then exported back into the S3 bucket for requests by the front end.

In the event of Lambda failure, a CloudWatch alarm is triggered and will notify me via SNS.

### FRONT END
[GitHub Repository](https://github.com/misterjacko/CPS-COVID-FE)

I built a serverless front-end which is also hosted on AWS and consists of HTML, JavaScript, and CSS (with associated image and data assets) served out of an S3 bucket configured as a static website. DNS and CDN service are also provided by AWS via Route53 and CloudFront. 

![Image of Main District Page](https://dev-to-uploads.s3.amazonaws.com/i/e3hkgr17afi4368e8dmw.PNG)

I utilize both the [PapaParse](https://www.papaparse.com/) and [D3.js](https://d3js.org/) JavaScript libraries to load and parse the .csv file serving as my database layer, and use the [Leaflet](https://leafletjs.com/) and [D3.js](https://d3js.org/) libraries for map and graph visualization respectively. 

Because I had no interest in generating and maintaining 500+ pages for each school (code is a liability), I use one page for all schools and pass parameters into it through the url. This was my first time working with url parameters and they are pretty cool.

![Image of an example of a school's page that is dynamically created by passing the school's name and coordinates into the url](https://dev-to-uploads.s3.amazonaws.com/i/f866666a5o962kxpiy2s.PNG)

---
## Summary

I started this project due to an interest in the CPS COVID-19 numbers and how they will (maybe) respond to the reopening of schools. This all depends on how open the district is with their case data. I hope they continue to do the right thing. 

It is also a belated entry for the [ACloud.guru Challenge](https://acloudguru.com/blog/engineering/cloudguruchallenge-python-aws-etl) run by [Forrest Brazeal](https://forrestbrazeal.com/) and the other fine folks at [ACloud.guru](https://acloud.guru). While this project is not at all what they had outlined (you can read that above) it certainly has the soul of an event-driven Python ETL pipeline for processing COVID-19 data. 

I hope that it can serve as a tool for those in Chicago (and elsewhere) interested in how COVID-19 might spread following the reopening of a large and diverse school district. There are a number of features that I plan on adding after this initial release, but as with most projects, my interest will depend largely on the interest in the community in using it. 

If you find this interesting or useful or want to tell me what I am missing, send me a note on twitter [@CPSCovid](https://twitter.com/cpscovid) or add an issue to the appropriate GitHub repository. 

[jakobondrey.com](https://jakobondrey.com)

---
#### Resources:

1. [List of the largest school districts in the United States by enrollment](https://en.wikipedia.org/wiki/List_of_the_largest_school_districts_in_the_United_States_by_enrollment)
2. [Chicago Public Schools - Stats & Facts](https://www.cps.edu/about/stats-facts/)
3. [Chicago Sun-Times: "Aide at CPS special education high school tests positive for coronavirus, officials say"](https://chicago.suntimes.com/news/2020/3/6/21168708/coronavirus-cps-high-school-aide-portage-park)
4. [Chicago Public Schools - Health & Safety Protocols](https://www.cps.edu/school-reopening-2020/health-and-safety/)
5. [Chicago Public Schools - Reopening Framework](https://www.cps.edu/school-reopening-2020/reopening-framework/)
6. [Illinois Dept. of Public Health COVID-19 County & School Metrics](http://www.dph.illinois.gov/countyschool?county=Chicago)
7. [Chicago Public Schools - Reopening Home](https://www.cps.edu/school-reopening-2020#trackingCOVID)
8. [Chicago Public Schools is reopening after a bitter union fight. Now the hard part begins: Rebuilding trust, and making good on COVID-19 protection vows.](https://www.chicagotribune.com/coronavirus/ct-covid-19-cps-ctu-union-vote-schools-reopen-20210210-k6453s2syndw7gilvmwn3learm-story.html)
9. [AWS Serverless Application Model (SAM)](https://aws.amazon.com/serverless/sam/)
10. [Pandas](https://pandas.pydata.org/)
11. [PapaParse](https://www.papaparse.com/)
12. [D3.js](https://d3js.org/)
13. [Leaflet](https://leafletjs.com/)