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

chore: history cleanup, to use conventional commits #26

Closed
wants to merge 109 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
a439c7f
refactor:change userId to string
0xbrayo Feb 27, 2024
28fab77
feat:Update Leaderboard to format time in hours and minutes
0xbrayo Feb 27, 2024
aa65c14
feat:implement getLeaderboard
0xbrayo Feb 29, 2024
d42b5d4
chore:minor edit
0xbrayo Mar 5, 2024
7b3f3dc
chore:prettier formatted
0xbrayo Mar 2, 2024
578fff2
refactor:data types updates
0xbrayo Mar 2, 2024
d8d15bc
feat:create screentime store
0xbrayo Mar 5, 2024
e930be9
refactor:getScreenTimeData function to use a userCollection
0xbrayo Mar 5, 2024
f59e51b
feat:add ChartData types
0xbrayo Mar 5, 2024
a3d0396
feat:add Chartjs
0xbrayo Mar 5, 2024
9b7d0d6
feat:switch to <script setup>
0xbrayo Mar 5, 2024
bbcccbd
feat:add stacked barchart
0xbrayo Mar 5, 2024
803ee3e
feat:add chartjs
0xbrayo Mar 6, 2024
0db378c
refactor:switch to node 20
0xbrayo Mar 14, 2024
2d003b5
feat:add pinia-sync-plugin
0xbrayo Mar 14, 2024
5aee47e
chore:code clean-up
0xbrayo Mar 14, 2024
0a4e428
feat:reactivity improvements
0xbrayo Mar 15, 2024
27d0516
chore:add pinia-firestore-sync
0xbrayo Mar 15, 2024
a07f5a1
chore:fix typo
0xbrayo Mar 15, 2024
94acd9d
chore:switch to autocolors
0xbrayo Mar 15, 2024
0a993bc
feat:extract Stacked bar chart
0xbrayo Mar 16, 2024
657a39b
chore:clean-up packages
0xbrayo Mar 16, 2024
97f4319
chore:remove unused import
0xbrayo Mar 18, 2024
0c86007
feat:add Piechart
0xbrayo Mar 18, 2024
88c455f
chore:prettier formatted
0xbrayo Mar 18, 2024
919b81e
chore:typechecking fix
0xbrayo Mar 19, 2024
fc1f666
chore:type casting
0xbrayo Mar 19, 2024
fe88e43
fix:reactivity fix
0xbrayo Mar 19, 2024
f27c139
fix:type fix
0xbrayo Mar 19, 2024
cd91b3d
feat:add leaderboard store
0xFrama Mar 21, 2024
7619277
feat:reset Leaderboard storeon log out
0xbrayo Mar 22, 2024
5df6000
chore:change labels to weekdays
0xbrayo Mar 22, 2024
cb16cfa
chore:prettier formatting
0xbrayo Mar 22, 2024
8a6e9b7
chore:prettier formatted
0xbrayo Mar 22, 2024
1049fc8
chore:minor update
0xbrayo Mar 22, 2024
b57cb0e
chore:delete counter store
0xbrayo Mar 22, 2024
bbe2293
refactor:categoryTotals to camelCase
0xbrayo Mar 23, 2024
54feb06
refactor:rename all category_totals to camelCase
0xbrayo Mar 23, 2024
3911135
feat:add querying support
0xbrayo Mar 26, 2024
0111fa7
feat:redirect to login page if not authenticated
0xbrayo Mar 28, 2024
395f9c8
feat:add write and update triggers, create getApiKey
0xbrayo Apr 2, 2024
d3d884f
chore:update package.json and add new types and functions
0xbrayo Apr 5, 2024
0faeb06
refactor: improve performance and readability
0xbrayo Apr 5, 2024
d4a48bb
chore:delete firebase rules
0xbrayo Apr 5, 2024
23dfae5
chore:update and symlink rules
0xbrayo Apr 5, 2024
be81da9
remove volar from the README.md deprecated
0xbrayo Apr 5, 2024
8dbb23d
Update types.ts to include new interfaces and defaultCategories
0xbrayo Apr 7, 2024
e1304ea
docs: added links to previous attempts, wrapped original readme in <d…
ErikBjare Apr 12, 2024
cf55470
feat: add apikey store
0xbrayo Jun 19, 2024
5184330
feat: remove unnecessary JSON parsing
0xbrayo Jun 19, 2024
f337241
feat: use the predefined user categories
0xbrayo Jun 20, 2024
5edcb5b
feat: remove redundant logged in message
0xbrayo Jun 21, 2024
1dbcda3
fix: remove unused imports
0xbrayo Jun 24, 2024
d006a8d
feat: add an apikey component
0xbrayo Jun 24, 2024
3813f2e
feat: add category to Event type
0xbrayo Jun 24, 2024
194a20e
fix: syntax fixes
0xbrayo Jun 24, 2024
851f118
chore: prettier formatted
0xbrayo Jun 24, 2024
84d32d4
feat: reactivity improvements
0xbrayo Jun 24, 2024
6795643
chore: add TODOs
0xbrayo Jun 26, 2024
c10b39f
chore: Minor updates
0xbrayo Jul 2, 2024
904bdfb
feat: add resetStore function
0xbrayo Jul 5, 2024
d9ca7bd
fix: reactivity of Pie and Bar charts
0xbrayo Jul 10, 2024
60c7769
feat: add onMounted hook to display an initial chart
0xbrayo Jul 10, 2024
a5a2d17
chore: remove unnecessary async keywords
0xbrayo Jul 16, 2024
54c5913
chore: remove unused import
0xbrayo Jul 16, 2024
75ffae1
chore: update info logs to debug logs
0xbrayo Jul 16, 2024
1d70eb9
chore: convert leaderboard.vue to composition api
0xbrayo Jul 16, 2024
c9b6905
chore: remove commented out code
0xbrayo Jul 16, 2024
61c8e6f
chore: add TODOs
0xbrayo Jul 17, 2024
26a8cf6
feat:update 'UpdateLeaderboardData' function
0xbrayo Jul 17, 2024
9f38b92
chore: eslint formatting
0xbrayo Jul 18, 2024
77efd76
chore: eslint formatting
0xbrayo Jul 18, 2024
d635828
chore: minor readability fix
0xbrayo Jul 18, 2024
3fb9bf1
feat: create dataToSummary function
0xbrayo Jul 18, 2024
04d52db
feat: rework UpdateLeaderboardData
0xbrayo Jul 18, 2024
564cd50
chore: ignore "require-jsdoc" eslint
0xbrayo Jul 18, 2024
e183225
chore: update footer
0xbrayo Jul 22, 2024
19c0c5e
fix: input to formatTime as seconds
0xbrayo Jul 22, 2024
0fdfa4c
feat: update firestore rules to read-only client side
0xbrayo Jul 25, 2024
9aa3171
feat: remove fetchSummary and reset functions from screentime store. …
0xbrayo Jul 25, 2024
2ebb8e8
chore: Add vue-material-design-icons and create a types.d.ts for icons
0xbrayo Jul 25, 2024
0798883
feat: add copy to clipboard functionality and display a snackbar pop up
0xbrayo Jul 25, 2024
d6fb1ae
feat: add persistence to apikey store and prevent updating the store …
0xbrayo Jul 25, 2024
2868aca
feat: replace logout button with LogOut Material UI icon
0xbrayo Jul 25, 2024
d6e31a5
chore: ignore eslint multi-word-component-names, whitespace formatting
0xbrayo Jul 25, 2024
2649fe3
fix: update rotateKey to reference correct collection
0xbrayo Jul 26, 2024
570f500
chore: add firebase-functions dependency
0xbrayo Jul 26, 2024
4d25c7a
feat: add rotateKey functionality
0xbrayo Jul 31, 2024
47622ff
chore: add a TODO, to reduce cold start times
0xbrayo Aug 1, 2024
e39eaa5
feat: query a specified period using the since parameter
0xbrayo Aug 1, 2024
3249ddd
chore: prettier formatted
0xbrayo Aug 1, 2024
f42c47d
chore: symlink storage and firestore rules, also firestore.indexes.json
0xbrayo Aug 2, 2024
9294e87
feat: change SnackBar component to composition API
0xbrayo Aug 3, 2024
b1673db
feat: add reset snackbar message for subsequent snackbar displays
0xbrayo Aug 3, 2024
bbded99
feat: create ScreenTimeSummaryRanked type
0xbrayo Aug 16, 2024
f5f1550
feat: refactor updateLeaderboard function to use batched writes and i…
0xbrayo Aug 14, 2024
3ca6b77
chore: bump firebase-functions to ^5.0.1
0xbrayo Aug 14, 2024
e95b194
chore: prettier formatted
0xbrayo Aug 19, 2024
5c24042
chore: reorder functions for better readability
0xbrayo Aug 20, 2024
a6f52ee
feat: add paging while fetching leaderboard
0xbrayo Aug 20, 2024
bec8a5e
chore: remove all semicolons :)
0xbrayo Aug 22, 2024
35944a6
docs: document the firestore data model
0xbrayo Aug 22, 2024
1d419ba
feat: update getApiKey to use the callable function defined in the "f…
0xbrayo Aug 23, 2024
3ad7e0b
feat: reactivity fix for Leaderboard component
0xbrayo Aug 28, 2024
ad165db
feat: speed up updateLeaderboardData via concurrency
0xbrayo Aug 29, 2024
af312a5
feat: update leaderboard store to use offsets
0xbrayo Sep 3, 2024
73e3448
fix: no longer reusing events variable in onUploadData
0xbrayo Feb 25, 2025
ac87c70
refactor: cast RawEvent as Array instead of tuple
0xbrayo Feb 25, 2025
ec3a8d3
chore: proper capitalization in snackbar message
0xbrayo Feb 25, 2025
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
10 changes: 3 additions & 7 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
'extends': [
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
overrides: [
{
files: [
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}'
],
'extends': [
'plugin:cypress/recommended'
]
files: ['cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}'],
extends: ['plugin:cypress/recommended']
}
],
parserOptions: {
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
}
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,42 @@

[![Test](https://github.com/ActivityWatch/aw-leaderboard-firebase/actions/workflows/test.yml/badge.svg)](https://github.com/ActivityWatch/aw-leaderboard-firebase/actions/workflows/test.yml)

Hosted at https://aw-leaderboard.web.app/ (WIP!)
Hosted at <https://aw-leaderboard.web.app/> (WIP!)

A prototype of a public leaderboard for screentime data collected by ActivityWatch.

It uses Vue 3, Firebase (for auth/storage), and Bootstrap.

The goal was to make a leaderboard app that complements the local-first nature of ActivityWatch with basic social features like public leaderboards or sharing specific screentime data privately with a group.

---

The below was automatically generated on repo initialization.
Previous experiments/attempts were made in:

## Recommended IDE Setup
- [aw-leaderboard-rust](https://github.com/activitywatch/aw-leaderboard-rust).
- [aw-supabase](https://github.com/ActivityWatch/aw-supabase)

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support for `.vue` Imports in TS
---

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
<details>
<summary>Click to expand the initial README</summary>

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
## Recommended IDE Setup

1. Disable the built-in TypeScript Extension
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
[VSCode](https://code.visualstudio.com/) + [TypeScript Vue Plugin](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

### Clone the Repo and its submodules

```sh
git clone --recurse-submodules https://github.com/ActivityWatch/aw-leaderboard-firebase
```

### Install the dependencies

```sh
npm install
```
Expand Down Expand Up @@ -83,3 +81,5 @@ npm run test:e2e
```sh
npm run lint
```

</details>
Binary file added bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
}
],
"firestore": {
"rules": "src/firebase/firestore.rules",
"indexes": "src/firebase/firestore.indexes.json"
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"hosting": {
"public": "dist",
Expand Down
6 changes: 2 additions & 4 deletions functions/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ module.exports = {
ignorePatterns: [
"/lib/**/*", // Ignore built files.
],
plugins: [
"@typescript-eslint",
"import",
],
plugins: ["@typescript-eslint", "import"],
rules: {
"quotes": ["error", "double"],
"import/no-unresolved": 0,
"indent": ["error", 2],
"require-jsdoc": 0,
},
};
19 changes: 19 additions & 0 deletions functions/firestore.indexes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"indexes": [
{
"collectionGroup": "O2TIwM6QoIhCBbcCCUggf0c7xMJ3",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "public",
"order": "ASCENDING"
},
{
"fieldPath": "date",
"order": "ASCENDING"
}
]
}
],
"fieldOverrides": []
}
15 changes: 15 additions & 0 deletions functions/firestore.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rules_version = '2';

service cloud.firestore {
match /databases/{database}/documents {
match /screentime/{userId}/{document=**} {
allow read: if request.auth.uid == userId;
}
match /leaderboard/{document=**} {
allow read: if true;
}
match /users/{userId}/{document=**} {
allow read: if request.auth.uid == userId;
}
}
}
Loading