Skip to content

[Feature] Environment-based API URL configuration and Chart.js settings extraction for maintainability #97

@haerim-kweon

Description

@haerim-kweon

Feature Request

TODO

  • Create .env.development and .env.production files with appropriate environment variables.
  • Update Vite config and code to dynamically load the base URL depending on the environment.
  • Test that API requests use the correct base URL in both development and production modes.
  • Extract hardcoded values such as colors, background colors, and tension from Chart.js settings into a separate config file.
  • Structure chart configuration and styling for better reusability and maintainability.

Describe Solution

  • Use Vite’s loadEnv to load environment variables based on the current mode.
  • Manage API base URL through environment variables to avoid hardcoding.
  • Extract visual settings from Chart.js (colors, backgrounds, line tension, etc.) into constants stored in a config file.
  • Use the separated config consistently across components and modules to ensure maintainability.

Additional Info

  • Reference: https://vitejs.dev/guide/env-and-mode.html

  • Related commit examples:

    • chore: Setup .env files for dev and prod environments
    • chore: Extract Chart.js config and styling into constants for better maintainability

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions