Skip to content
Draft
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ It is designed as a complete end to end IoT product, from embedded firmware to c
| Firmware | C · Zephyr RTOS · nRF Connect SDK |
| Protocols | BLE 5.0 · I2C |
| Mobile | React Native · TypeScript · Kotlin (native modules) |
| Backend | NestJS · PostgreSQL · InfluxDB · Redis |
| Backend | NestJS · PostgreSQL · InfluxDB |
| Infrastructure | Fly.io · GitHub Actions · Cloudflare |

---
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/src/readings/readings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ export class ReadingsService {
deviceId: deviceId,
createdAt: Between(new Date(from), new Date(to)),
},
take: limit,
...(limit ? { take: limit } : {}),
});
} else {
deviceReadings = await this.readingsRepository.find({
where: {
deviceId: deviceId,
},
take: limit,
...(limit ? { take: limit } : {}),
});
}

Expand Down
215 changes: 215 additions & 0 deletions apps/mobile/package-lock.json

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

2 changes: 2 additions & 0 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"react-native": "0.81.5",
"react-native-ble-plx": "^3.5.1",
"react-native-gesture-handler": "~2.28.0",
"react-native-gifted-charts": "^1.4.77",
"react-native-linear-gradient": "^2.8.3",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/api/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from "axios";
import { authStore } from "../stores/authStore";

export const instance = axios.create({
baseURL: "http://192.168.1.71:3000/",
baseURL: "http://192.168.1.74:3000/",
timeout: 10000,
});

Expand Down
22 changes: 22 additions & 0 deletions apps/mobile/src/api/readingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,25 @@ export const postReading = async (
console.log(error);
}
};

export const getReadings = async (
deviceId: string,
from: string,
to: string,
) => {
try {
console.log("device id", deviceId);

const response = await instance.get("readings", {
params: {
deviceId: deviceId,
from: from,
to: to,
},
});
console.log("responses", response.data);
return response.data;
} catch (error) {
console.log(error);
}
};
Loading