Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions remote_dashboard/backend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"typescript",
"prettier"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
}
}
130 changes: 130 additions & 0 deletions remote_dashboard/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
7 changes: 7 additions & 0 deletions remote_dashboard/backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 150,
"tabWidth": 2,
"trailingComma": "all"
}
21 changes: 21 additions & 0 deletions remote_dashboard/backend/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Queen's Racing

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
85 changes: 85 additions & 0 deletions remote_dashboard/backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# QFSAE Remote Dashboard Server

This project is a simple TypeScript-based server designed to communicate with an ESP32 microcontroller to receive live data from a car. The received data is then stored in a MySQL database.

## Getting Started

These instructions will help you set up and run the project on your local machine.

### Prerequisites

Before running the server, make sure you have the following installed:

- [Node.js](https://nodejs.org/)
- [MySQL Server](https://dev.mysql.com/downloads/mysql/)
- [MySQL Workbench](https://www.mysql.com/products/workbench/)

### MySQL Workbench Setup

1. Open MySQL Workbench and create a new connection.

2. Under connection name, put QFSAE. Put `root` as the Username.

3. Under `Password`, click on `Store in Vault` and enter the password you will use for the database. Keep this handy for later

4. Click on `Test Connection`. You should see a success message pop up on screen

5. Click `OK` to proceed


### Database Setup

1. Execute the following SQL script to create the `measurements` table:

```sql
CREATE DATABASE IF NOT EXISTS qfsae_remote;
USE qfsae_remote;

CREATE TABLE `measurements` (
`time` datetime NOT NULL,
`rpm` float DEFAULT NULL,
`drive_status` varchar(45) DEFAULT NULL,
`vbatt_voltage` float DEFAULT NULL,
`motor_power` float DEFAULT NULL,
`coolant_temp` float DEFAULT NULL,
PRIMARY KEY (`time`)
);

### Server Setup

1. Clone the repository:

```bash
git clone https://github.com/qfsae/telemetry_backend.git
2. Install dependencies:

```bash
yarn install
3. Create a .env file in the root directory and add your MYSQL database connection details:

```env
MYSQL_PASSWORD=your_database_password
MYSQL_DB_NAME=your_database_name
### Usage

1. Start the server:
```bash
yarn start
The server will be running at http://localhost:3000/

### Documentation

All documentation of the server can be found in the `docs` folder. To generate new documentation run

yarn build:docs

The new documentation will be generated in the `docs` folder


### Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

### License

This project is licensed under the MIT License - see the LICENSE file for details.
1 change: 1 addition & 0 deletions remote_dashboard/backend/docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
57 changes: 57 additions & 0 deletions remote_dashboard/backend/docs/assets/highlight.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
:root {
--light-hl-0: #000000;
--dark-hl-0: #D4D4D4;
--light-hl-1: #0000FF;
--dark-hl-1: #569CD6;
--light-hl-2: #795E26;
--dark-hl-2: #DCDCAA;
--light-hl-3: #A31515;
--dark-hl-3: #CE9178;
--light-hl-4: #098658;
--dark-hl-4: #B5CEA8;
--light-code-background: #FFFFFF;
--dark-code-background: #1E1E1E;
}

@media (prefers-color-scheme: light) { :root {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--code-background: var(--light-code-background);
} }

@media (prefers-color-scheme: dark) { :root {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--code-background: var(--dark-code-background);
} }

:root[data-theme='light'] {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--code-background: var(--light-code-background);
}

:root[data-theme='dark'] {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--code-background: var(--dark-code-background);
}

.hl-0 { color: var(--hl-0); }
.hl-1 { color: var(--hl-1); }
.hl-2 { color: var(--hl-2); }
.hl-3 { color: var(--hl-3); }
.hl-4 { color: var(--hl-4); }
pre, code { background: var(--code-background); }
59 changes: 59 additions & 0 deletions remote_dashboard/backend/docs/assets/main.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions remote_dashboard/backend/docs/assets/navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACouOBQApu0wNAgAAAA=="
1 change: 1 addition & 0 deletions remote_dashboard/backend/docs/assets/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading