Skip to content

Commit

Permalink
Added documentation and updated the roadmap
Browse files Browse the repository at this point in the history
  • Loading branch information
Tfloow committed Jan 23, 2024
1 parent 798b982 commit 3d50015
Show file tree
Hide file tree
Showing 11 changed files with 245 additions and 15 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [How to run it ?](#how-to-run-it-)
- [Explanation of the steps](#explanation-of-the-steps)
- [Roadmap](#roadmap)
- [Documentation](#documentation)
- [License](#license)

Test the app [here](https://uclouvaindown-ed3979a045e6.herokuapp.com/)
Expand All @@ -18,7 +19,7 @@ You can find the list of all currently track services in this [json](services.js

## How does it work ?

![Homepage](image.png)
![Homepage](doc/img/image.png)![Alt text](image.png)

Here is the control panel where every website is displayed.

Expand All @@ -45,13 +46,18 @@ First, make sure to get the latest version of python (I am using 3.12). then fol
## Roadmap

- [x] Working pages
- [x] Home Page with links to other subpages
- [x] Home Page with links to other sub-pages
- [ ] A nice and clear home page with all current status
- [x] Deployed locally
- [x] Deployed globally
- [ ] Tracking downtime
- [ ] User button to report if a website is down
- [ ] Database that collect persistent data about outage
- [x] Tracking downtime
- [x] User button to report if a website is down
- [x] Database that collect persistent data about outage
- [ ] Proper database

## Documentation

You can find the documentation and have a better understanding of what is going under the hood by reading [this](doc/doc.md). (*Please, open an issue with the tag "doc" to add any comments or when you need more information about a specific point of the doc*).

## License

Expand Down
3 changes: 3 additions & 0 deletions data/404-Test/log.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ date,UP
2024-01-22T16:17:41,True
2024-01-22T18:16:18,False
2024-01-22T20:48:32,False
2024-01-22T22:28:36,False
2024-01-23T09:55:10,False
2024-01-23T12:15:12,False
2 changes: 2 additions & 0 deletions data/Gradescope/log.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ date,UP
2024-01-22T14:02:32,True
2024-01-22T14:21:28,True
2024-01-22T16:59:51,True
2024-01-23T14:18:40,True
2024-01-23T14:18:43,True
3 changes: 3 additions & 0 deletions data/LEPL1104/log.csv
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
date,UP
2024-01-22T22:27:13,True
2024-01-22T22:27:19,True
2024-01-23T07:21:24,True
2 changes: 2 additions & 0 deletions data/LEPL1201/log.csv
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
date,UP
2024-01-22T22:27:33,True
2024-01-22T22:27:36,True
58 changes: 58 additions & 0 deletions doc/doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Documentation of UCLouvain Down

- [Documentation of UCLouvain Down](#documentation-of-uclouvain-down)
- [Introduction](#introduction)
- [Overview](#overview)
- [Backend:](#backend)
- [Frontend:](#frontend)
- [Summary](#summary)


## Introduction

This website runs with Flask and the server with gunicorn. The site is hosted at heroku.

## Overview

### Backend:
- `app.py`: this where the main app is located and the website's brain
- `jsonUtility.py`: this is a python script with handy function to handle JSON and more specifically the `services.json`. It helps us updating the status, remember when the last check was done, add new services, ...
- `dataReport.py`: this python script handle the user's report of website. It handle the interactivity with the user when they want to report an outage. It will log the report into a csv and plot it.
### Frontend:

#### `templates/`
We are taking advantage of Flask and jinja syntax to avoid boilerplate code. We have a `base.html` that have the base of our website such as a header, footer, ...

We then extend this baseline to tailor specific webpages for the need. When we extend this, we can provide 3 new block of html code:
1. `header`: we can change what's inside the `<head>` tag
2. `content`: we can add our content between the footer and header
3. `script`: we can add javascript scripts inside our html or add a `<link>` to a script (see [*static*](#static))

#### `static/`

This where we store all of the content required to build a new webpage. This follows the Flask guidelines.

You can find various *stylesheet* with the name looking like `style<Name-of-Template>.css` so it is easy to see what css goes with which page.

There is also some `robots.txt` and `sitemap.xml` for SEO purposes.

There is various folder:
- `ico/`: where we store the favicon for the webpages
- `img/log/`: where we store the plot of the user's report of outages and will be displayed on each services pages.
- `script/`: where we store the few javascript we have.

#### `data/`

This part is where we store a sort "database" with all of the report of the user.

All of the folder's name correspond to a tracked service by UCLouvain down **besides** the `request/` which is a little bit different. This is where the result of the [request form](https://uclouvaindown-ed3979a045e6.herokuapp.com/request) is.

You can extract all of the logs to build something with by clicking the link under each graph. Or you can do curl command looking like :

```
curl https://uclouvaindown-ed3979a045e6.herokuapp.com/extract?get=<folder-name> -o log.csv
```

### Summary

![Summary Graph](img/sum.png)
Binary file added doc/img/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
156 changes: 156 additions & 0 deletions doc/img/sum.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<mxfile host="65bd71144e">
<diagram id="ZKKhcdbOqJRwUNd-fRH-" name="Page-1">
<mxGraphModel dx="549" dy="605" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
<mxGeometry x="50" y="120" width="760" height="440" as="geometry"/>
</mxCell>
<mxCell id="4" value="&lt;p style=&quot;line-height: 310%;&quot;&gt;&lt;br&gt;&lt;/p&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;arcSize=6;" vertex="1" parent="1">
<mxGeometry x="90" y="210" width="310" height="260" as="geometry"/>
</mxCell>
<mxCell id="5" value="&lt;b&gt;&lt;u&gt;&lt;font style=&quot;font-size: 14px;&quot;&gt;Templates&lt;/font&gt;&lt;/u&gt;&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontColor=#1A1A1A;" vertex="1" parent="1">
<mxGeometry x="215" y="210" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="13" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=11;fontColor=#1A1A1A;strokeColor=#474747;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="6" target="7">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="245" y="320"/>
<mxPoint x="145" y="320"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="6" value="&lt;font color=&quot;#1a1a1a&quot;&gt;base.html&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="200" y="240" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="7" value="&lt;font color=&quot;#1a1a1a&quot;&gt;index.html&lt;br&gt;&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="100" y="340" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="8" value="&lt;font color=&quot;#1a1a1a&quot;&gt;404.html&lt;br&gt;&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="200" y="340" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="10" value="&lt;font color=&quot;#1a1a1a&quot;&gt;serviceList.html&lt;br&gt;&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="250" y="398" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="11" value="&lt;font color=&quot;#1a1a1a&quot;&gt;request.html&lt;br&gt;&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="300" y="340" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="12" value="&lt;font color=&quot;#1a1a1a&quot;&gt;&lt;font style=&quot;font-size: 11px;&quot;&gt;itemWebsite.html&lt;/font&gt;&lt;br&gt;&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="150" y="398" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="14" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=11;fontColor=#1A1A1A;strokeColor=#474747;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="6" target="12">
<mxGeometry relative="1" as="geometry">
<mxPoint x="221.66666666666663" y="310" as="sourcePoint"/>
<mxPoint x="155" y="350" as="targetPoint"/>
<Array as="points">
<mxPoint x="245" y="320"/>
<mxPoint x="195" y="320"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="15" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=11;fontColor=#1A1A1A;strokeColor=#474747;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="6" target="10">
<mxGeometry relative="1" as="geometry">
<mxPoint x="240" y="300" as="sourcePoint"/>
<mxPoint x="165" y="360" as="targetPoint"/>
<Array as="points">
<mxPoint x="245" y="320"/>
<mxPoint x="295" y="320"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="16" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=11;fontColor=#1A1A1A;strokeColor=#474747;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="6" target="8">
<mxGeometry relative="1" as="geometry">
<mxPoint x="250" y="300" as="sourcePoint"/>
<mxPoint x="175" y="370" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="17" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=11;fontColor=#1A1A1A;strokeColor=#474747;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="6" target="11">
<mxGeometry relative="1" as="geometry">
<mxPoint x="251.66666666666663" y="340" as="sourcePoint"/>
<mxPoint x="185" y="380" as="targetPoint"/>
<Array as="points">
<mxPoint x="245" y="320"/>
<mxPoint x="345" y="320"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="18" value="&lt;font style=&quot;font-size: 12px;&quot;&gt;&lt;i&gt;herits&lt;/i&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontColor=#1A1A1A;" vertex="1" parent="1">
<mxGeometry x="250" y="280" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="19" value="&lt;p style=&quot;line-height: 310%;&quot;&gt;&lt;br&gt;&lt;/p&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;arcSize=6;" vertex="1" parent="1">
<mxGeometry x="460" y="140" width="310" height="180" as="geometry"/>
</mxCell>
<mxCell id="20" value="&lt;b&gt;&lt;u&gt;&lt;font style=&quot;font-size: 14px;&quot;&gt;APP&lt;/font&gt;&lt;/u&gt;&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontColor=#1A1A1A;" vertex="1" parent="1">
<mxGeometry x="585" y="140" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="21" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=11;fontColor=#1A1A1A;strokeColor=#474747;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="22" target="23">
<mxGeometry relative="1" as="geometry">
<mxPoint x="515" y="270" as="targetPoint"/>
<Array as="points">
<mxPoint x="615" y="240"/>
<mxPoint x="525" y="240"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="22" value="&lt;font color=&quot;#1a1a1a&quot;&gt;app.py&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
<mxGeometry x="570" y="170" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="23" value="&lt;font color=&quot;#1a1a1a&quot;&gt;jsonUtility.py&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
<mxGeometry x="480" y="270" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="24" value="&lt;font color=&quot;#1a1a1a&quot;&gt;dataReport.py&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
<mxGeometry x="670" y="270" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="27" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=11;fontColor=#1A1A1A;strokeColor=#474747;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="22" target="24">
<mxGeometry relative="1" as="geometry">
<mxPoint x="680" y="270" as="targetPoint"/>
<Array as="points">
<mxPoint x="615" y="240"/>
<mxPoint x="715" y="240"/>
</Array>
<mxPoint x="770" y="210" as="sourcePoint"/>
</mxGeometry>
</mxCell>
<mxCell id="28" value="&lt;p style=&quot;line-height: 310%;&quot;&gt;&lt;br&gt;&lt;/p&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;arcSize=6;" vertex="1" parent="1">
<mxGeometry x="460" y="328" width="310" height="180" as="geometry"/>
</mxCell>
<mxCell id="29" value="&lt;b&gt;&lt;u&gt;&lt;font style=&quot;font-size: 14px;&quot;&gt;Database&lt;/font&gt;&lt;/u&gt;&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontColor=#1A1A1A;" vertex="1" parent="1">
<mxGeometry x="585" y="328" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="31" value="&lt;font color=&quot;#1a1a1a&quot;&gt;services.json&lt;br&gt;&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#b0e3e6;strokeColor=#0e8088;" vertex="1" parent="1">
<mxGeometry x="480" y="360" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="33" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeColor=#474747;fontSize=12;fontColor=#1A1A1A;" edge="1" parent="1" source="23" target="31">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="34" value="&lt;font style=&quot;font-size: 12px;&quot;&gt;&lt;i&gt;manage&lt;/i&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontColor=#1A1A1A;" vertex="1" parent="1">
<mxGeometry x="460" y="325" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="40" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeColor=#474747;fontSize=12;fontColor=#1A1A1A;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="35" target="37">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="715" y="420"/>
<mxPoint x="535" y="420"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="41" style="edgeStyle=none;html=1;entryX=0.75;entryY=0;entryDx=0;entryDy=0;strokeColor=#474747;fontSize=12;fontColor=#1A1A1A;" edge="1" parent="1" source="35" target="39">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="35" value="&lt;font color=&quot;#1a1a1a&quot;&gt;data&lt;br&gt;&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#b0e3e6;strokeColor=#0e8088;glass=0;arcSize=48;" vertex="1" parent="1">
<mxGeometry x="670" y="358" width="90" height="40" as="geometry"/>
</mxCell>
<mxCell id="36" style="edgeStyle=none;html=1;strokeColor=#474747;fontSize=12;fontColor=#1A1A1A;" edge="1" parent="1" source="24" target="35">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="37" value="&lt;font color=&quot;#1a1a1a&quot;&gt;&amp;lt;service&amp;gt;/log.csv&lt;br&gt;&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#b0e3e6;strokeColor=#0e8088;" vertex="1" parent="1">
<mxGeometry x="485" y="438" width="100" height="40" as="geometry"/>
</mxCell>
<mxCell id="39" value="&lt;font color=&quot;#1a1a1a&quot;&gt;static/img/log/service.png&lt;br&gt;&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#b0e3e6;strokeColor=#0e8088;" vertex="1" parent="1">
<mxGeometry x="610" y="438" width="140" height="40" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file added doc/img/sum.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed image.png
Binary file not shown.
Loading

0 comments on commit 3d50015

Please sign in to comment.