Skip to content

Commit

Permalink
feat: data api (#57)
Browse files Browse the repository at this point in the history
* feat: github data api

* wip: point at production for metrics queries (REVERT BEFORE MERGE)

* feat: use live data

* chore: backfill script wip

* chore: move metric prefixes to metrics repository

* fix: eslint config

* feat: backfill script

* chore: tweak ui

---------

Co-authored-by: Zack Pollard <[email protected]>
  • Loading branch information
jrasm91 and zackpollard authored Jan 13, 2025
1 parent a3fe960 commit 2befad4
Show file tree
Hide file tree
Showing 35 changed files with 1,126 additions and 141 deletions.
6 changes: 6 additions & 0 deletions backend/.env.backfill
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export VMETRICS_DATA_WRITE_TOKEN="op://tf_$ENVIRONMENT/vmetrics_data_write_token/token"
export VMETRICS_DATA_ADMIN_TOKEN="op://tf_$ENVIRONMENT/vmetrics_data_admin_token/token"
export VMETRICS_DATA_API_URL="https://data.immich.cloud"
export GITHUB_INSTALLATION_ID="op://tf/github_app_immich_read_only/installation_id"
export GITHUB_APP_ID="op://tf/github_app_immich_read_only/app_id"
export GITHUB_PEM_FILE="op://tf/github_app_immich_read_only/pkcs8"
19 changes: 0 additions & 19 deletions backend/.eslintrc.cjs

This file was deleted.

78 changes: 78 additions & 0 deletions backend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: ['eslint.config.mjs'],
},
...compat.extends(
'plugin:@typescript-eslint/recommended',
),
{
plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
globals: {
...globals.node,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: 'module',

parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
},
},

rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'unicorn/prevent-abbreviations': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prefer-event-target': 'off',
'unicorn/no-thenable': 'off',
'unicorn/import-style': 'off',
'unicorn/prefer-structured-clone': 'off',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
curly: 2,
'object-shorthand': ['error', 'always'],

'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['.*'],
message: 'Relative imports are not allowed.',
},
],
},
],
},
},
];
26 changes: 22 additions & 4 deletions backend/package-lock.json

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

7 changes: 5 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "worker",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"deploy": "wrangler deploy",
"dev": "wrangler dev",
Expand All @@ -10,7 +11,7 @@
"test": "vitest",
"test:cov": "vitest --coverage",
"cf-typegen": "wrangler types",
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" --max-warnings 0",
"lint": "eslint \"src/**/*.ts\" --max-warnings 0",
"lint:fix": "npm run lint -- --fix",
"format": "prettier --check .",
"format:fix": "prettier --write .",
Expand All @@ -22,6 +23,7 @@
"@octokit/types": "^13.6.2",
"@octokit/webhooks-types": "^7.6.1",
"@types/express": "^4.17.21",
"@types/luxon": "^3.4.2",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@vitest/coverage-istanbul": "^2.1.1",
Expand All @@ -43,7 +45,8 @@
"fetch-retry": "^6.0.0",
"fflate": "^0.8.2",
"itty-router": "^5.0.18",
"p-limit": "^6.1.0"
"luxon": "^3.5.0",
"p-limit": "^6.2.0"
},
"volta": {
"node": "22.12.0"
Expand Down
Loading

0 comments on commit 2befad4

Please sign in to comment.