Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harshithpabbati/daily-metrics
https://github.com/harshithpabbati/daily-metrics
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/harshithpabbati/daily-metrics
- Owner: harshithpabbati
- Created: 2021-08-25T19:30:30.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-01T23:59:22.000Z (about 3 years ago)
- Last Synced: 2024-10-11T13:32:19.808Z (27 days ago)
- Language: TypeScript
- Homepage: https://dailymetrics.vercel.app
- Size: 468 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Daily Metrics
### Steps for installation
1. Clone this project
```sh
git clone https://github.com/harshithpabbati/daily-metrics.git
```2. Change into the directory and install the dependencies
```sh
cd daily-metricsnpm install
```3. Create a project in supabase, and use the below sql command to create table.
```
CREATE TABLE metrics (
id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
inserted_at timestamp with time zone DEFAULT timezone('utc'::text, now()) NOT NULL,
data jsonb,
call_data jsonb,
user_id uuid references auth.users not null
);
```and postgresql functions
```
CREATE OR REPLACE FUNCTION room_metrics(roomname text)
returns table (
roomID bigint,
roomData jsonb,
roomMeetingData jsonb,
insertedAt timestamptz,
userId uuid,
name text
) LANGUAGE PLPGSQL
AS $$
BEGIN
RETURN query
SELECT
id as roomID,
data as roomData,
call_data as roomMeetingData,
inserted_at as insertedAt,
user_id as userId,
room as name
FROM
metrics
WHERE
room = roomName
GROUP BY user_id, id;
END
$$
```4. Create a file named __.env.local__ and update it with the values from your Supabase project and Daily API:
```
NEXT_PUBLIC_SUPABASE_URL=https://app-id.supabase.co
NEXT_PUBLIC_SUPABASE_KEY=your-public-api-key
DAILY_API_KEY=daily-public-key
```![Image URLs](https://user-images.githubusercontent.com/43822585/130856654-ddbb99ed-2807-4ae6-9ffe-0375312d0192.png)
5. Run the server
```sh
npm run dev
```