Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature/context page #7

Merged
merged 50 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f6028ce
add data to db
EvanHughes-dev Sep 29, 2024
24317bb
removed id display fields
EvanHughes-dev Sep 29, 2024
1e9a2ac
naming update
EvanHughes-dev Sep 30, 2024
932b842
git ignore update
EvanHughes-dev Sep 30, 2024
9c569bc
python backend framework done for reading configs
EvanHughes-dev Sep 30, 2024
de75e6e
css and design rework. Added section headers
EvanHughes-dev Sep 30, 2024
d0ef046
CSS and select formating
EvanHughes-dev Sep 30, 2024
f24c509
Switched to restful api
EvanHughes-dev Oct 1, 2024
08841ef
Comments and submit logic fixes
EvanHughes-dev Oct 4, 2024
0a2c4d0
Update to backend logic and removed useless code
EvanHughes-dev Oct 5, 2024
2a41413
readme update
EvanHughes-dev Oct 7, 2024
c267f8c
readme update
EvanHughes-dev Oct 7, 2024
6e88486
readme update (i'm the big dumb)
EvanHughes-dev Oct 7, 2024
69c4e66
.env readme update
EvanHughes-dev Oct 7, 2024
107d368
.env readme update
EvanHughes-dev Oct 7, 2024
2b09e80
small change
EvanHughes-dev Oct 8, 2024
65db305
removed checkboxes
EvanHughes-dev Oct 9, 2024
7ea95b0
update to rest api and fetch logic
EvanHughes-dev Oct 10, 2024
135ed1f
switch to browser router
EvanHughes-dev Oct 10, 2024
de03274
pull commit
EvanHughes-dev Oct 10, 2024
6c0b969
merge conflict
EvanHughes-dev Oct 10, 2024
1bcdd67
merge conflict
EvanHughes-dev Oct 10, 2024
8718f06
fixed submitting and added bike names
EvanHughes-dev Oct 11, 2024
2baf3f9
update to logic
EvanHughes-dev Oct 12, 2024
ca65e92
git ignore update
EvanHughes-dev Oct 12, 2024
7e8f730
git ignore update
EvanHughes-dev Oct 12, 2024
4527798
Delete .vscode directory
EvanHughes-dev Oct 12, 2024
db08421
git ignore update and removed pycache
EvanHughes-dev Oct 17, 2024
06d9e6f
favicon.ico update
EvanHughes-dev Oct 17, 2024
15bb3eb
change to credentials.env location
EvanHughes-dev Oct 17, 2024
6821bb2
removed garbage code
EvanHughes-dev Oct 17, 2024
6e2455c
readme update
EvanHughes-dev Oct 17, 2024
3058f04
removed error handeling
EvanHughes-dev Oct 18, 2024
d952525
non-fatal error fixes
EvanHughes-dev Oct 18, 2024
8ac6749
removed TODOs
EvanHughes-dev Oct 18, 2024
1eabf6f
removed TODOs
EvanHughes-dev Oct 18, 2024
51729dd
comment update
EvanHughes-dev Oct 18, 2024
5eab532
removed files
EvanHughes-dev Oct 18, 2024
c47f0f8
comment resloves
EvanHughes-dev Oct 18, 2024
6188cfe
switch to post call
EvanHughes-dev Oct 19, 2024
1309fdd
Update README.md
EvanHughes-dev Oct 24, 2024
2eb2c10
Update README.md
EvanHughes-dev Oct 24, 2024
8baca4d
Update README.md
EvanHughes-dev Oct 24, 2024
5774231
pull request fixes
EvanHughes-dev Oct 24, 2024
851f99f
pull request fixes
EvanHughes-dev Oct 24, 2024
c837560
updates from feedback
EvanHughes-dev Oct 25, 2024
ff8fffc
updates to readme and removed an sql injection
EvanHughes-dev Oct 25, 2024
f381f78
removed sql injections and update to required
EvanHughes-dev Oct 29, 2024
9dddba5
Update to f string and comments
EvanHughes-dev Nov 3, 2024
62eb836
removed print statments
EvanHughes-dev Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
.idea/
*.env
*.cpython-312.pyc
*.vscode
/.vscode
__pycache__/
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,66 @@ The script which is responsible for streaming the raw CAN data into the database
Currently to use the script run main and when prompted input the path to the .mf4 file you want to have uploaded.<br>

As we do not have means to collect context data yet, we use a dummy context with an id of 1. This is gross and bad. We will be removing that as soon as we have a way to query the user for context data.<br>

## Web UI

This react-strap based website is responsible for gathering all context and data relating to the bikes and all events<br>
EvanHughes-dev marked this conversation as resolved.
Show resolved Hide resolved

Ideally, mechies will just download the files and run it on their computer. This includes running both the website and backend api that goes along with it.<br>
EvanHughes-dev marked this conversation as resolved.
Show resolved Hide resolved

In the future, I hope to host at least the backend restful api, and eventually the website itself, on a web server, but that is not going to happen for a long time. To anyone that works on this in the future, if this message is still here, that means I never went back and fixed the mess I made, and for that I sincerely apologize for. This was meant to be quick and dirty, but I attempted to follow best practices and self document the code where I could. <br>

## RESTful API

The RESTful API is built off python using Flask. <br>
EvanHughes-dev marked this conversation as resolved.
Show resolved Hide resolved

Someday, this will be hosted on a central server, but for now it runs locally. To run this application, see directions below under **Running the Server**. <br>

For any future developers, standard practices should be followed when building this API. This includes separating calls into different classes and using the `GET`, `PUT`, `POST`, and `DELETE` calls correctly. Additionally, any changes to the url path for a call should be updated in the ServerPath.json file.

### Download Instructions


#### Node JS
The first step is to install Node JS if you do not already have it installed.<br>
EvanHughes-dev marked this conversation as resolved.
Show resolved Hide resolved

1. Follow the download instructions found here [Node JS](https://nodejs.org/en/download/package-manager)
2. Verify download by running `npm --version` or `node -v`<br>

After Node JS has been installed, clone this repo onto your computer. If you have installed, open the project in VS Code. If you don't have in installed, just follow along in the command window. <br>
EvanHughes-dev marked this conversation as resolved.
Show resolved Hide resolved

Also run `npm install react` and `npm install reactstrap`

tmb7852 marked this conversation as resolved.
Show resolved Hide resolved
#### **Running the Website**

In the terminal, `cd` into the `~...\Telemetry-Database\TelemetrySite\client` folder and run the command `npm install`. <br>

Once that has finished running, run the command `npm start`. <br>
If your website didn't start, check that you are in the correct folder and you installed Node JS. <br>
EvanHughes-dev marked this conversation as resolved.
Show resolved Hide resolved

After your sever is online, make sure you keep that terminal open. **Closing that terminal for any reason will kill your website**.<br>

#### **Running the Server**

Open a new terminal and `cd` into the `~...\Telemetry-Database` folder. <br>
Run the command `pip instal -r requirements.txt`. <br>
EvanHughes-dev marked this conversation as resolved.
Show resolved Hide resolved

If `pip` isn't being recognized, run `python -V`. If python isn't recognized, download the installer here [Python](https://www.python.org/downloads/). Python should add itself as environmental variable automatically, but you may need to click **Add As Environmental Variable** on the last page before you close the installer.<br>

In your terminal `cd` into the `~...\Telemetry-Database\TelemetrySite\server` folder and run `python .\server.py`

#### **.env File**

In order to connect to the database, you must contact one of the database leads for the .env file.<br>

Once they have sent it to you, place it in the `~...\Telemetry-Database` folder in a file names **credentials.env**.

> **WARNING**

>**.env files should never be shared or the contents sent anywhere without the Firmware Team's permission**
EvanHughes-dev marked this conversation as resolved.
Show resolved Hide resolved






EvanHughes-dev marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion TelemetrySite/client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn-error.log*
70 changes: 0 additions & 70 deletions TelemetrySite/client/README.md

This file was deleted.

Loading