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

updates #19

Merged
merged 10 commits into from
Jun 18, 2024
Merged
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,26 @@ 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.

Previous experiments/attempts were made in:
- [aw-leaderboard-rust](https://github.com/activitywatch/aw-leaderboard-rust).
- [aw-supabase](https://github.com/ActivityWatch/aw-supabase)

---

The below was automatically generated on repo initialization.
<details>
<summary>Click to expand the initial README</summary>

## Recommended IDE Setup

[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.

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:

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
Expand Down Expand Up @@ -83,3 +79,5 @@ npm run test:e2e
```sh
npm run lint
```

</details>
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": []
}
16 changes: 16 additions & 0 deletions functions/firestore.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rules_version = '2';

service cloud.firestore {
match /databases/{database}/documents {
match /screentime/{userId}/{document=**} {
allow read, write: if request.auth.uid == userId;
}
match /leaderboard/{document=**} {
allow read: if true;
allow write: if false;
}
match /users/{userId}/{document=**} {
allow read, write: if request.auth.uid == userId;
}
}
}
75 changes: 73 additions & 2 deletions functions/package-lock.json

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

5 changes: 3 additions & 2 deletions functions/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "functions",
"scripts": {
"lint": "eslint --ext .js,.ts .",
"lint": "eslint --fix --ext .js,.ts .",
"build": "tsc",
"build:watch": "tsc --watch",
"serve": "npm run build && firebase emulators:start --only functions",
Expand All @@ -16,7 +16,8 @@
"main": "lib/index.js",
"dependencies": {
"firebase-admin": "^11.8.0",
"firebase-functions": "^4.3.1"
"firebase-functions": "^4.3.1",
"generate-api-key": "^1.0.2"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.12.0",
Expand Down
Loading
Loading