Skip to content

chors(schema): Improve Card Model #569

@Harxhit

Description

@Harxhit

Card Schema Enhancement

Background

The current card model is primarily designed to group platform links together:

Card
 ├── title
 └── linkIds[]
 └── analytics[]

While this works for basic card creation, it limits future functionality such as sharing, visibility controls, QR code support and card customization.

To support these features, the card schema needs to be extended with additional metadata and configuration fields.


Proposed Changes

Description

Add an optional description field to allow users to provide additional information about a card.

Example use cases:

  • Portfolio card description
  • Professional bio
  • Social links overview

Slug

Add a unique slug field to provide human-readable URLs.

Benefits:

  • Cleaner URLs
  • Easier sharing
  • Better QR code integration
  • Avoids exposing internal database IDs

Example:

Instead of:

/cards/550e8400-e29b-41d4-a716-446655440000

Use:

/cards/backend-engineer

Visibility

Add support for controlling who can access a card.

PUBLIC

Anyone can access the card.

UNLISTED

The card is only accessible through a direct link and is not intended to be publicly discoverable.

PRIVATE

Only the card owner can access the card.


QR Support

Add a qrEnabled field to control whether QR-based sharing is available for a card.

This provides a foundation for future QR generation and sharing functionality.


View Count

Add a viewCount field to store the total number of views for a card.

This field acts as a cached counter for quick retrieval of engagement statistics.

Detailed analytics will continue to be stored in CardView, while viewCount allows common queries to be served without performing aggregation operations.


Resulting Card Model

Card
 ├── title
 ├── description
 ├── slug
 ├── visibility
 ├── qrEnabled
 ├── cardLinks
 ├── viewCount
 └── analytics

Expected Benefits

  • Support public card sharing.
  • Support custom and human-readable URLs.
  • Enable visibility and access control.
  • Provide a foundation for QR-based sharing.
  • Improve card customization capabilities.
  • Enable efficient retrieval of view statistics.
  • Establish the schema required for future analytics features.

Area

backend

Metadata

Metadata

Assignees

Labels

backendcriticalIncludes schema, architecture, or other critical core functionality changes.

Type

No type
No fields configured for issues without a type.

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions