npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

cca-entities

v0.2.24

Published

Entities

Readme

Below is a short Markdown documentation that outlines the entities and their relationships:


Entities Documentation

This documentation provides a brief overview of the TypeORM entities used in this project. Each entity extends a common BaseEntity and uses decorators from TypeORM and AutoMapper for mapping and database configuration.


AuthEntity

  • Table Name: auth
  • Purpose: Stores authentication-related data.
  • Key Fields:
    • email: A unique email address.
    • password: User password (not selected by default).
    • refreshToken: Token used for refreshing authentication (not selected by default).
    • role: Enum value from UserRole (default: GUEST).
  • Relations:
    • user: One-to-one relation with UserEntity (eagerly loaded, cascades on delete).

UserEntity

  • Table Name: users
  • Purpose: Represents user profiles.
  • Key Fields:
    • email: Unique email address (indexed).
    • name: User’s name.
    • role: Enum value from UserRole (default: GUEST).
    • profileImageUrl: Optional URL for the profile image.
    • isActive: Indicates if the user is active.
    • lastLoginAt: Timestamp of the last login (not selected by default).
  • Relations:
    • auth: One-to-one relation with AuthEntity.
    • posts: One-to-many relation with PostEntity.
    • images: One-to-many relation with ImageEntity.

CategoryEntity

  • Table Name: categories
  • Purpose: Represents content categories.
  • Key Fields:
    • name: Unique category name.
    • slug: URL-friendly unique identifier.
    • description: Optional text describing the category.
    • featuredImage: Optional image for the category.
    • level: Indicates the category level.
  • Tree Structure:
    • parent: Self-referencing parent category (closure-table tree).
    • children: Self-referencing child categories.
  • Relations:
    • image: One-to-one relation with ImageEntity.
    • posts: Many-to-many relation with PostEntity.

PostEntity

  • Table Name: posts
  • Purpose: Represents blog posts or articles.
  • Key Fields:
    • title: Title of the post.
    • slug: Unique URL-friendly identifier.
    • content: Main content of the post.
    • excerpt: Short excerpt from the content.
    • published: Boolean flag indicating if the post is published.
    • featuredImage: Optional image URL.
    • publishedAt: Timestamp when the post was published.
  • Relations:
    • author: Many-to-one relation with UserEntity (author details).
    • images: One-to-many relation with ImageEntity.
    • categories: Many-to-many relation with CategoryEntity.

ImageEntity

  • Table Name: images
  • Purpose: Stores image data associated with posts, users, or categories.
  • Key Fields:
    • title: Title of the image.
    • description: Optional description.
    • originalUrl, thumbUrl, smUrl, mdUrl, lgUrl, xlUrl: URLs for various image sizes.
    • imageId: Unique identifier for the image.
  • Relations:
    • author: Many-to-one relation with UserEntity.
    • category: One-to-one relation with CategoryEntity (if applicable).
    • post: Many-to-one relation with PostEntity.

UserRole Enum

  • Values:
    • ADMIN
    • USER
    • GUEST

This enum is used across several entities to define the user’s access level and role.


This brief documentation provides a high-level overview of the key entities, their main fields, and relationships. For more detailed information on field types, configurations, or relationships, please refer to the inline comments and TypeORM documentation.