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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@manniedev/tap2werk

v0.0.8

Published

Type definition for Tap2werk

Downloads

40

Readme

Tap2Werk Type Definition Backend

Overview

This project contains the complete TypeScript type definitions and backend API structure for Tap2Werk, a SaaS-style platform connecting clients with artisans for jobs. The app handles job posting, offers, invoicing, payments, reviews, and media management. It includes a fully designed data model, enums, and API route constants.


Features

  • User Management
    • Clients, Artisans, Admins
    • Profiles and settings
    • Notifications
  • Artisan Management
    • Skills, rating, verification
    • Offers and reviews
  • Jobs
    • Posting, editing, recurring jobs
    • Media attachments
  • Offers
    • Accept/reject workflows
  • Invoices & Payments
    • Issue invoices
    • Handle in-app and offline payments
    • Attach media files
  • Categories
    • Job categories with optional media
  • Reviews
    • Rate and comment on completed jobs
  • Media
    • Images, PDFs, Word docs, and other attachments
    • Supports S3 metadata storage
  • Admin Panel
    • Full management of users, artisans, jobs, offers, invoices, payments, reviews, notifications, settings, and media
  • Authentication
    • Register, login, logout
    • Password reset

Technology Stack

  • Backend: Node.js + TypeScript
  • Database: PostgreSQL (with PostGIS support for location data)
  • ORM: TypeORM (using classes and enums)
  • File Storage: AWS S3
  • API Documentation: JSDoc for endpoints

Installation

# Install dependencies
npm install

# Compile TypeScript
npm run build

Usage

  1. Define the database schema using the provided classes in TypeORM.
  2. Sync enums in PostgreSQL for all workflow and status values.
  3. Use API constants to implement routes in Express or another backend framework.
  4. Media handling: Upload images, PDFs, and Word documents to S3 and store metadata in the Media table.

Type Definitions

The app includes the following main classes (all extending BaseRecord with id, created_at, and updated_at):

  • User – Users of the system (client, artisan, admin)
  • UserProfile – Personal profile info including phone, address, bio, and profile media
  • Artisan – Artisan-specific data (skills, rating, verification)
  • Job – Job posting with recurrence, status, and optional media
  • Offer – Artisan offer for a job with status
  • Invoice – Invoice linked to job, client, and artisan
  • Payment – Payment info for invoices
  • Category – Job categories with optional media
  • Review – Ratings and comments for jobs and artisans
  • Notification – User notifications with read/unread status
  • Setting – User-specific or global settings
  • Media – Storage of images, PDFs, and other file metadata (S3)

Enums

The following enums are defined for stricter type safety:

  • UserRole: client | artisan | admin
  • UserStatus: active | inactive | banned
  • JobRecurrence: one_time | recurring
  • JobStatus: open | in_progress | completed | cancelled
  • OfferStatus: pending | accepted | rejected
  • InvoiceStatus: pending | paid | overdue
  • PaymentMethod: app | offline
  • PaymentStatus: pending | completed | failed
  • MediaType: profile | job | category | invoice | document | other

Database Schema

The database uses PostgreSQL with the following tables:

  • users, user_profiles, artisans, jobs, offers, invoices, payments, categories, reviews, notifications, settings, media
  • Foreign key relationships between users, jobs, offers, invoices, categories, reviews, and media
  • Enums used for status fields to enforce valid workflow states

Full dbdiagram.io schema is included in /db/schema.dbml


API Endpoints

Base API

export const API_BASE = \"/api\";

User

export const USER_ROUTE = API_BASE + \"/user\";
export const USER_PROFILE_ROUTE = USER_ROUTE + \"/profile\";
export const USER_PROFILE_IMAGE_ROUTE = USER_PROFILE_ROUTE + \"/media\";
export const USER_SETTINGS_ROUTE = USER_ROUTE + \"/settings\";
export const USER_NOTIFICATIONS_ROUTE = USER_ROUTE + \"/notifications\";

Artisan

export const ARTISAN_ROUTE = API_BASE + \"/artisan\";
export const ARTISAN_OFFERS_ROUTE = ARTISAN_ROUTE + \"/offers\";
export const ARTISAN_REVIEWS_ROUTE = ARTISAN_ROUTE + \"/reviews\";
export const ARTISAN_INVOICES_ROUTE = ARTISAN_ROUTE + \"/invoices\";

Job

export const JOB_ROUTE = API_BASE + \"/job\";
export const JOB_MEDIA_ROUTE = JOB_ROUTE + \"/media\";
export const JOB_OFFERS_ROUTE = JOB_ROUTE + \"/offers\";
export const JOB_INVOICES_ROUTE = JOB_ROUTE + \"/invoices\";
export const JOB_REVIEWS_ROUTE = JOB_ROUTE + \"/reviews\";

Offer

export const OFFER_ROUTE = API_BASE + \"/offer\";
export const OFFER_ACCEPT_ROUTE = OFFER_ROUTE + \"/accept\";
export const OFFER_REJECT_ROUTE = OFFER_ROUTE + \"/reject\";

Invoice & Payment

export const INVOICE_ROUTE = API_BASE + \"/invoice\";
export const INVOICE_PAYMENT_ROUTE = INVOICE_ROUTE + \"/payment\";
export const INVOICE_ATTACHMENTS_ROUTE = INVOICE_ROUTE + \"/media\";
export const PAYMENT_ROUTE = API_BASE + \"/payment\";

Category

export const CATEGORY_ROUTE = API_BASE + \"/category\";
export const CATEGORY_MEDIA_ROUTE = CATEGORY_ROUTE + \"/media\";

Review

export const REVIEW_ROUTE = API_BASE + \"/review\";

Notification

export const NOTIFICATION_ROUTE = API_BASE + \"/notification\";
export const NOTIFICATION_READ_ROUTE = NOTIFICATION_ROUTE + \"/read\";

Setting

export const SETTING_ROUTE = API_BASE + \"/setting\";

Media

export const MEDIA_ROUTE = API_BASE + \"/media\";
export const MEDIA_UPLOAD_ROUTE = MEDIA_ROUTE + \"/upload\";
export const MEDIA_DELETE_ROUTE = MEDIA_ROUTE + \"/delete\";

Authentication

export const AUTH_ROUTE = API_BASE + \"/auth\";
export const AUTH_LOGIN_ROUTE = AUTH_ROUTE + \"/login\";
export const AUTH_REGISTER_ROUTE = AUTH_ROUTE + \"/register\";
export const AUTH_LOGOUT_ROUTE = AUTH_ROUTE + \"/logout\";
export const AUTH_FORGOT_PASSWORD_ROUTE = AUTH_ROUTE + \"/forgot-password\";
export const AUTH_RESET_PASSWORD_ROUTE = AUTH_ROUTE + \"/reset-password\";

Admin

export const ADMIN_ROUTE = API_BASE + \"/admin\";
export const ADMIN_USERS_ROUTE = ADMIN_ROUTE + \"/users\";
export const ADMIN_ARTISANS_ROUTE = ADMIN_ROUTE + \"/artisans\";
export const ADMIN_JOBS_ROUTE = ADMIN_ROUTE + \"/jobs\";
export const ADMIN_OFFERS_ROUTE = ADMIN_ROUTE + \"/offers\";
export const ADMIN_INVOICES_ROUTE = ADMIN_ROUTE + \"/invoices\";
export const ADMIN_PAYMENTS_ROUTE = ADMIN_ROUTE + \"/payments\";
export const ADMIN_REVIEWS_ROUTE = ADMIN_ROUTE + \"/reviews\";
export const ADMIN_NOTIFICATIONS_ROUTE = ADMIN_ROUTE + \"/notifications\";
export const ADMIN_SETTINGS_ROUTE = ADMIN_ROUTE + \"/settings\";
export const ADMIN_MEDIA_ROUTE = ADMIN_ROUTE + \"/media\";

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Open a Pull Request

License

MIT License © [Your Name or Company]


Notes

  • All classes extend BaseRecord for consistency (id, created_at, updated_at)
  • Media handles all file types, not just images
  • Enums ensure type safety for status and workflow fields
  • API constants allow a centralized routing system