A React app built with Vite that runs an API for interacting with our data.
Install dependencies:
npm installFrontend development: npm run dev:react
Backend development: npm run dev:server
Fullstack development: npm run dev:all
Test before deploying: npm run start
Everything will be deployed to Vercel, and this is primarily why npm run start runs the Vercel CLI.
- Builds can be done with
npm run build outputDirectory:dist- API route is hosted at
/api
/api supports:
GETfor health checksPOSTfor JSON payload submission
Example:
curl -X POST https://127.0.0.1:3000/api \
-H "Content-Type: application/json" \
-d '{ "yourData": "here" }'The API expects JSON payloads with the following structure:
{
"batteryNumber": 17,
"header": {
"date": {
"year": 1928,
"month": 4,
"day": 12
},
"time": {
"hour": 16,
"minute": 3,
"second": 45
},
"movingTo": "Robot",
"comingFrom": "Blast Charger",
"initialVoltage": 13.192,
"charge": 104.28,
"internalResistance": 0.021
},
"datapoints": {
"0": {
"time": 0,
"voltage": 13.192,
"current": 0.0
},
"1": {
"time": 1,
"voltage": 13.183,
"current": 1.0
}
}
}