feat: auth pkg and file proxy scaffold

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2025-10-19 17:05:15 +00:00
parent c0f852ad35
commit e58caa6b16
14 changed files with 306 additions and 0 deletions

34
apps/file-proxy/.gitignore vendored Normal file
View File

@@ -0,0 +1,34 @@
# dependencies (bun install)
node_modules
# output
out
dist
*.tgz
# code coverage
coverage
*.lcov
# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# caches
.eslintcache
.cache
*.tsbuildinfo
# IntelliJ based IDEs
.idea
# Finder (MacOS) folder config
.DS_Store

15
apps/file-proxy/README.md Normal file
View File

@@ -0,0 +1,15 @@
# drive-file-proxy
To install dependencies:
```bash
bun install
```
To run:
```bash
bun run index.ts
```
This project was created using `bun init` in bun v1.3.0. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.

View File

12
apps/file-proxy/files.ts Normal file
View File

@@ -0,0 +1,12 @@
import { Hono } from "hono"
const h = new Hono().basePath("/files")
h.get("/:fileId", async (c) => {
const fileId = c.req.param("fileId")
if (!fileId) {
return c.json({ error: "File ID is required" }, 400)
}
})
export { h as files }

10
apps/file-proxy/index.ts Normal file
View File

@@ -0,0 +1,10 @@
import { Hono } from "hono"
import { handleFileRequest } from "./files"
Bun.serve({
routes: {
"/files/:fileId": {
GET: handleFileRequest,
},
},
})

View File

@@ -0,0 +1,17 @@
{
"name": "@drexa/file-proxy",
"module": "index.ts",
"type": "module",
"private": true,
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {
"@fileone/convex": "workspace:*",
"convex": "^1.28.0",
"hono": "^4.10.1"
}
}

View File

@@ -0,0 +1,7 @@
import type { RouterTypes } from "bun"
function router<
R extends { [K in keyof R]: RouterTypes.RouteValue<Extract<K, string>> },
>(routes: R): R {
return routes
}

View File

@@ -0,0 +1,29 @@
{
"compilerOptions": {
// Environment setup & latest features
"lib": ["ESNext"],
"target": "ESNext",
"module": "Preserve",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}