Skip to content

Conversation

@thesleepyniko
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

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 refactors the API structure by migrating from an api/ namespace to a versioned v1/ namespace, adopting RESTful HTTP methods, and improving module organization with explicit __init__.py files.

Key Changes:

  • Migrates all API modules from api/* to v1/* for versioned API architecture
  • Updates HTTP methods from POST to PATCH for updates and DELETE for deletions, following REST conventions
  • Introduces path parameters for resource identification (e.g., /api/projects/{project_id} instead of project_id in request body)

Reviewed changes

Copilot reviewed 5 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
v1/users/main.py Updates imports to v1 namespace; changes endpoints to RESTful patterns (PATCH /api/users/me, DELETE /api/users/me)
v1/users/init.py Adds explicit module exports with all for public API surface
v1/projects/main.py Updates imports to v1 namespace; refactors update endpoint to use path parameter; changes to RESTful endpoints
v1/projects/init.py Adds explicit module exports with all for public API surface
v1/models/user.py Moves user models to v1 namespace with SQLAlchemy 2.0 style type annotations
v1/models/init.py Empty init file for models package
v1/lib/hackatime.py Adds new Hackatime API integration library to v1 namespace
v1/db/main.py Moves database connection management to v1 namespace
v1/db/init.py Adds explicit exports for database utilities
v1/auth/openapi.yaml Adds OpenAPI specification for authentication endpoints
v1/auth/main.py Updates imports to v1 namespace
v1/auth/init.py Adds explicit module exports with all for auth utilities
v1/admin/main.py Adds new admin routes module (stub implementation)
v1/admin/init.py Adds explicit exports for admin module
v1/init.py Creates top-level v1 package with submodule exports
main.py Updates all imports to use v1 namespace instead of api namespace
Dockerfile Adds PYTHONPATH environment variable for proper module resolution
Comments suppressed due to low confidence (1)

v1/projects/main.py:35

  • The commented-out project_id field creates confusion. Since project_id is now a path parameter (line 96, 101), it should be completely removed from the request model rather than commented out. Keeping commented code in production reduces clarity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@ImShyMike ImShyMike left a comment

Choose a reason for hiding this comment

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

lgtm

@ImShyMike ImShyMike merged commit b746845 into main Dec 6, 2025
1 check passed
@ImShyMike ImShyMike deleted the refactoring-api branch December 7, 2025 21:45
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