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

@rothenbergt/backstage-plugin-roadmap-backend

v0.2.0

Published

Backstage Roadmap plugin backend

Readme

Backstage Roadmap Plugin Backend

This is the backend part of the Roadmap Plugin for Backstage, providing API endpoints to manage a public product roadmap with features, voting, and comments.

Architecture

This plugin follows a layered architecture with clear separation of concerns:

1. Database Layer

  • RoadmapDatabaseClient: Handles direct database operations through Knex
  • Uses transactions for all write operations to ensure data consistency
  • Maps database errors to Backstage's error types for consistent error handling

2. Service Layer

  • Implements business logic and validation rules
  • Services include:
    • FeatureService: Feature management and validation
    • CommentService: Comment creation and retrieval
    • VoteService: Vote toggling and counting
    • PermissionService: Authorization and permission checks

3. Route Layer

  • RESTful API endpoints that connect to frontend
  • Routes include:
    • /features: CRUD operations for roadmap items
    • /comments: Add and retrieve comments for features
    • /votes: Toggle votes and get vote counts
    • /permissions: Check user permissions

4. Error Handling

  • Uses Backstage's built-in error types and middleware
  • Errors bubble up through layers and are handled centrally
  • Provides consistent error responses with appropriate HTTP status codes

API Endpoints

Features

  • GET /features: Get all roadmap features
  • POST /features: Create a new feature suggestion
  • GET /features/:id: Get a specific feature
  • PUT /features/:id/status: Update feature status (admin only)

Comments

  • GET /comments?featureId=123: Get comments for a feature
  • POST /comments: Add a comment to a feature

Votes

  • POST /votes/:featureId: Toggle a vote on a feature
  • GET /votes/:featureId/count: Get vote count for a feature
  • GET /votes/counts?ids=123,456: Get vote counts for multiple features
  • GET /votes/:featureId/user: Check if current user has voted

Permissions

  • GET /permissions/check-admin: Check if current user is an admin

Development

Database Schema

The plugin sets up three main tables:

  • features: Roadmap items with title, description, status, etc.
  • comments: User comments on features
  • votes: User votes on features with unique constraint

Permission Model

  • Uses Backstage's permission framework
  • Allows configuration of admin users through app-config.yaml
  • Supports both config-based permissions and Backstage's permission framework

Error Handling Strategy

This plugin follows Backstage's error handling patterns:

  • InputError: For validation failures (400 errors)
  • NotFoundError: When resources don't exist (404 errors)
  • NotAllowedError: For authorization failures (403 errors)
  • ConflictError: For database conflicts (409 errors)

Errors bubble up through layers to be handled by Backstage's middleware.