-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.html
50 lines (50 loc) · 5.21 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<h1>measure-g</h1><p>A site to visualize data around the expenditure of Oakland Measure G funds</p>
<p>The <code>measure-g</code> project (now cleverly called TrackG) is hosted here: <a href="http://trackg.org">http://trackg.org</a></p>
<hr>
<h2>Set Up Development Environment</h2><h3>Install Node / npm</h3><ul>
<li><a href="http://nodejs.org/download/">Node</a></li>
<li><a href="https://docs.npmjs.com/getting-started/installing-node">npm</a></li>
</ul>
<p>Note: Node comes with npm which is a package manager for Node. You can use the instructions above to update to the latest version and verify that it's installed.</p>
<h3>Install & Run Harp</h3><p>TrackG is using a minimal server framework called <a href="http://harpjs.com/">Harp</a> for EJS templating and sass stylesheets. Currently, trackg.org is just compiled static HTML and not a Harp server. But that may change and Harp simplifies the development process.</p>
<pre><code>npm install harp -g
</code></pre><p>To start the Harp server, git clone this directory and then run:</p>
<pre><code>harp server
</code></pre><p>Now you can hit the server at <code>localhost:9000</code> (by default). Any changes you make in source will automatically compile on refresh.</p>
<h2>Deployment</h2><p>Since we are using GitHub pages for hosting, pushing up changes is a little tricky. Shell scripts are currently being used to make the process easier for you.</p>
<h3>Setup</h3><p>If it's the first time you are deploying to your machine, get write access to the <a href="https://github.com/openoakland/measure-g-staging">measure-g-staging</a> repository.</p>
<p>Then run:</p>
<pre><code>bash ./deploy_setup.sh
</code></pre><p>See the script for comments on what goes on in that script.</p>
<h3>Staging</h3><p>Once you have that setup process complete, you can run:</p>
<pre><code>bash ./deploy_staging.sh
</code></pre><p>to see your changes at <a href="https://openoakland.github.io/measure-g-staging/">https://openoakland.github.io/measure-g-staging/</a></p>
<p>Staging is hosted on GitHub pages here: <a href="https://github.com/openoakland/measure-g-staging">https://github.com/openoakland/measure-g-staging</a></p>
<h3>Production</h3><pre><code>bash ./deploy_production.sh
</code></pre><p><a href="https://trackg.org">trackg.org</a></p>
<p>Hosted on GitHub pages here: <a href="https://github.com/openoakland/measure-g-production">https://github.com/openoakland/measure-g-production</a></p>
<h2>Data Maintenence</h2><h3>Adding Enrollment Data</h3><p>Our enrollment source has been the <a href="https://nces.ed.gov/ccd/pubschuniv.asp">US Dept of Ed National Center for Education Statistics</a> and the <a href="https://www.cde.ca.gov/ds/sd/sd/filesenr.asp">CA Dept of Ed</a>. These instructions are for the CA Dept of Ed.</p>
<ol>
<li><a href="https://www.cde.ca.gov/ds/sd/sd/filesenr.asp">Download the enrollment data</a> for the year you would like to add</li>
</ol>
<p><em>Carto Postgres Hosting (jbaldo.carto.com)</em></p>
<ol>
<li>To conserve file size, delete all rows where district != 'Oakland Unified' (Excel can do this pretty easily)</li>
<li>Save as csv (original sorce is text flat file)</li>
<li>Upload to the carto account as a new dataset</li>
<li>This data is broken out by ethnicity and grade level. <a href="https://github.com/openoakland/measure-g/issues/65">Use this query in Carto</a> to sum up the enrollment for each school site and union with existing data.</li>
<li>In Carto, save the query result as a new dataset. Name something like <code>ousd_enrollment_YYYY</code> with the year you are adding.</li>
<li>In <code>_harp.json</code>, update <code>latestEnrollmentYear</code> with the year you just added (2017-18 school year would be <code>2017</code>) and <code>enrollmentDataTable</code> with the name of the table you created in step 6.</li>
</ol>
<h3>Adding Annual Measure G Data</h3><p>We request the data each year from OUSD's finance office (typically through the Measure G Oversight Committee)</p>
<ol>
<li>Change column names to match the <code>measure_g_actuals</code> table</li>
<li>Format spending columns into <code>####.##</code></li>
<li>Add a <code>year</code> column and place the same year in every row. This should be the year that the school year started. For example, if it were to 2014-2015 school year, you would place 2014 in the column.</li>
<li>Upload to carto. Be sure that columns containing numberic ids or spending are in number format, not text.</li>
<li>Use a <code>UNION ALL</code> query in Carto to join the datasets. <a href="https://github.com/openoakland/measure-g/issues/63">Something like this.</a></li>
<li>Create a new dataset from the query. Make it public and name it <code>measure_g_actuals</code> to replace the existing table with that name.</li>
<li>Update the <code>supported_years</code> and <code>yearsToDisplay</code> arrays in <code>programs.ejs</code> and <code>school.ejs</code> to include the year you just added. (Unfortunately, it may break without this adjustment).</li>
<li>Update <code>latestExpenditureDataYear</code> in <code>harp.json</code> to the year you have just added and add another element to to the <code>year-select</code> element in <code>map.ejs</code>.</li>
</ol>
<p><a href="https://github.com/openoakland/measure-g/pull/67">Example Change</a></p>