Skip to content

👀 Feat counting stars (Beta)#9

Merged
pphatdev merged 3 commits intolatestfrom
feat-counting-stars
Feb 23, 2026
Merged

👀 Feat counting stars (Beta)#9
pphatdev merged 3 commits intolatestfrom
feat-counting-stars

Conversation

@pphatdev
Copy link
Copy Markdown
Owner

This pull request introduces a new visitor badge feature to the project, allowing users to embed a dynamic SVG badge in their README that tracks and displays visit counts. It also adds a persistent SQLite-backed database using Drizzle ORM for storing visitor data, updates documentation, and expands theme support to badges. Several new scripts and dependencies are included for database management.

New Visitor Badge Feature:

  • Added the /badge endpoint, which returns a dynamic SVG badge showing the number of visits for a given username. The badge supports themes and customizable colors via query parameters. [1] [2] [3] [4] [5]
  • Created the BadgeRenderer component for generating SVG badges, including theme and color customization logic.
  • Updated the documentation in README.md with usage instructions, endpoint details, and example queries for the visitor badge feature.

Database Integration and Schema:

  • Added SQLite database setup using Drizzle ORM for storing visitor counts, including schema definition and migration scripts. [1] [2] [3]
  • Introduced new scripts in package.json for database generation, migration, and studio access.

Theme System Enhancements:

  • Added badge-specific theme definitions and logic to support consistent styling across various themes for badges. [1] [2] [3] [4]
  • Extended dependencies to include Drizzle ORM and Better SQLite3 for database operations, as well as badge theme utilities.

Documentation and Developer Experience:

  • Improved README.md formatting, added endpoint examples, and clarified setup instructions for development and API usage. [1] [2] [3] [4] [5] [6] [7]

Miscellaneous:

  • Updated table formatting in documentation for better readability. [1] [2]

Let me know if you'd like a deeper dive into any of these changes!

@pphatdev pphatdev requested a review from Copilot February 23, 2026 10:10
@pphatdev pphatdev self-assigned this Feb 23, 2026
@pphatdev pphatdev linked an issue Feb 23, 2026 that may be closed by this pull request
@pphatdev pphatdev merged commit 9632dab into latest Feb 23, 2026
2 checks passed
Copy link
Copy Markdown

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

Adds a new /badge endpoint that returns a dynamic SVG visitor-counter badge, backed by a new SQLite database (Drizzle ORM + better-sqlite3), and extends the theme system with badge-specific themes plus documentation updates.

Changes:

  • Add /badge route + VisitorController that increments a per-username visit counter and returns an SVG badge.
  • Introduce SQLite persistence (schema + db bootstrap) and Drizzle tooling/scripts.
  • Extend theme utilities/types for badge themes and document the new endpoint/usage.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/utils/themes/badge.ts Adds badge theme definitions (label/value colors + backgrounds).
src/utils/themes.ts Exports badge themes and adds getBadgeTheme() alongside existing theme utilities.
src/types.ts Introduces BadgeTheme type used by badge theming.
src/index.ts Registers the new GET /badge route and exposes route docs.
src/db/schema.ts Defines the visitors table schema for Drizzle.
src/db/index.ts Sets up SQLite DB file and exports a Drizzle db instance.
src/controllers/visitor.ts Implements the badge endpoint: increments counter and renders badge SVG.
src/components/badge-renderer.ts Generates the badge SVG with theming/custom colors.
drizzle.config.ts Adds Drizzle Kit configuration for SQLite.
package.json Adds DB scripts and Drizzle/SQLite dependencies.
package-lock.json Locks newly added dependency tree for Drizzle + SQLite.
README.md Documents /badge endpoint and README embed usage; formatting tweaks.
.gitignore Ignores the new data/ directory and common IDE/OS files.

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


### Prerequisites

- Node.js 16+
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

better-sqlite3 v12 requires Node 20+ (per its engines metadata), but the README still lists Node.js 16+ as a prerequisite. Please update the documented Node version (and ideally keep it in sync with package.json/CI) to avoid install/runtime failures.

Suggested change
- Node.js 16+
- Node.js 20+

Copilot uses AI. Check for mistakes.
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.

🌟 Create new Feature Counting stars

2 participants