Skip to content

refactor: add modular structure & cli enhancements - #2

Merged
devsargam merged 9 commits into
mainfrom
refactor/api-and-cli
Jun 22, 2025
Merged

refactor: add modular structure & cli enhancements#2
devsargam merged 9 commits into
mainfrom
refactor/api-and-cli

Conversation

@geekyharsh05

@geekyharsh05 geekyharsh05 commented Jun 22, 2025

Copy link
Copy Markdown
Collaborator

Improvements

  • Modular architecture with separated concerns
  • Added login command with authentication and auth check to list command!
  • Worker deployed and fully functional!

@geekyharsh05 geekyharsh05 changed the title feat: add authentication and file management routes refactor: add modular structure & cli improvements Jun 22, 2025
@geekyharsh05 geekyharsh05 changed the title refactor: add modular structure & cli improvements refactor: add modular structure & cli enhancements Jun 22, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds authentication flows and R2-based file management to the API, modularizes routes, and centralizes environment configuration.

  • Introduce typed environment validation using @t3-oss/env-core and Zod
  • Refactor email service to use Resend via a central config
  • Add R2 client helpers and modular Hono routers for auth and file operations

Reviewed Changes

Copilot reviewed 19 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/types/email.ts Define SendConfirmationMailParams interface
src/types/app.ts Add AppBindings and AppEnv types
src/services/resend/send-mail.ts Update imports and remove inline interface
src/services/resend/resend-service.ts Use central config for API key and from-address
src/services/R2/R2-service.ts Implement R2 client, presigned URL, list/delete APIs
src/routes/files.route.ts Modularize file routes with JWT middleware
src/routes/auth.route.ts Modularize auth routes
src/middleware/index.ts Create JWT middleware via factory
src/lib/factory.ts Initialize Hono factory for typed environment
src/lib/env.ts Validate and expose server-side env variables
src/lib/config.ts Map validated env into runtime config
src/index.ts Wire up auth and file routers to the app
src/controllers/files.controller.ts Handlers for presigned URL, listing, deleting files
src/controllers/auth.controller.ts Handlers for email confirmation and verification
src/config.ts Remove hardcoded config
package.json Add env-core, Zod; remove unused email-render deps
.dev.vars.example Document new env vars for JWT, Resend, and R2
cli/src/index.ts Add login command and require auth for list
cli/src/config.ts Update CLI endpoints to new /auth and /files paths

Comment thread upload-api/src/services/resend/resend-service.ts Outdated
Comment thread upload-api/src/types/app.ts
Comment thread upload-api/src/lib/config.ts Outdated
@geekyharsh05 geekyharsh05 self-assigned this Jun 22, 2025
@devsargam

Copy link
Copy Markdown
Owner

nice work

@devsargam
devsargam merged commit 35473a8 into main Jun 22, 2025
@devsargam
devsargam deleted the refactor/api-and-cli branch June 22, 2025 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants