Skip to content

Conversation

@lukasabbe
Copy link
Member

@lukasabbe lukasabbe commented Apr 26, 2025

  • Remade all models that are still in use
  • Removed old models that are not getting used
  • Fixed the rest of the code so it works with the new models
  • Rewrote the frame generation
  • Also removed API routes that were unnecessary

Data from the old database gets moved after everything works as it should. The best way to do this is with a script on the side, I think :)

@lukasabbe lukasabbe added the enhancement New feature or request label Apr 26, 2025
@lukasabbe lukasabbe requested a review from Copilot April 26, 2025 18:29
@lukasabbe lukasabbe self-assigned this Apr 26, 2025
@lukasabbe lukasabbe changed the title Started on new database models. This is a rough start New database models. Apr 26, 2025
@lukasabbe lukasabbe requested a review from LittleFoxCode April 26, 2025 18:29
Copy link

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 database models and updates the routing structure for user, guild, config, and public API endpoints while removing outdated API endpoints. Key changes include renaming model fields and variables to camelCase, updating error messages and routes accordingly, and removing obsolete files.

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/routes/user.ts Introduces new endpoints and updated user model field naming
src/routes/index.ts Updates route imports to use new naming conventions
src/routes/guild.ts Implements the new guild config model with updated structure
src/routes/config.ts Adjusts config endpoint to integrate with the new model schema
src/public_api/user.ts Adjusts public user data output to match updated model naming
src/public_api/frame.ts Refactors frame generation endpoint with new parameters and error messages
src/models/user_schema.ts Updates user model fields and creation logic with camelCase field names
src/models/token_schema.ts Renames token id field to camelCase
src/models/guild_schema.ts Updates guild config structure and field naming
src/models/config_schema.ts Refactors config schema including new level system and frame caching logic
src/helpers/generateFrame.ts Adjusts parameter naming in frame generation function
(Several api/* files) Deprecated legacy API endpoints were removed
Files not reviewed (1)
  • .env.example: Language not supported
Comments suppressed due to low confidence (2)

src/models/config_schema.ts:27

  • Property 'extraobjects' is inconsistently named; consider renaming it to 'extraObjects' for consistency with other parts of the codebase.
extraobjects: { type: Map, of: Object },

src/public_api/frame.ts:43

  • The 'fs' module is used but not imported. Consider adding 'import fs from "fs"' at the top of the file.
if (!fs.existsSync(cachePath)) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant