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

autosync_backend2

v1.2.52

Published

A comprehensive business management system built with **Elysia** (TypeScript web framework) and **Bun** runtime. The system provides CRM, inventory management, warehouse operations, fleet management, and company management capabilities.

Readme

Autosync v2

A comprehensive business management system built with Elysia (TypeScript web framework) and Bun runtime. The system provides CRM, inventory management, warehouse operations, fleet management, and company management capabilities.

🚀 Quick Start

Prerequisites

  • Bun runtime (latest version)
  • PostgreSQL database
  • Redis (for caching and sessions)
  • AWS S3 account (for file storage)
  • SMTP credentials (for email)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd autosync-v2
  2. Install dependencies

    bun install
  3. Set up environment variables

    Create a .env file with the following variables:

    NODE_ENV=development
    PORT=3000
    BETTER_AUTH_SECRET=your-secret-key
    DATABASE_URL=postgresql://user:password@localhost:5432/autosync
    UPSTASH_REDIS_REST_URL=your-redis-url
    UPSTASH_REDIS_REST_TOKEN=your-redis-token
    SMTP_USER=your-smtp-user
    SMTP_PASSWORD=your-smtp-password
    ATUT_TOKEN=your-atut-token
    AWS_ACCESS_KEY=your-aws-key
    AWS_SECRET_KEY=your-aws-secret
  4. Run database migrations

    bun run db:migrate
  5. Start the development server

    bun run dev
  6. Access the application

📚 Documentation

🛠️ Development

Available Commands

# Development
bun run dev              # Start development server with auto-reload
bun run build            # Compile TypeScript and generate declarations

# Database
bun run db:generate      # Generate migration files from schema changes
bun run db:migrate       # Apply database migrations

# Code Quality
bun run biome:check      # Format and lint with auto-fix

# Email Development
bun run email            # Start email template development server

# Testing
bun test                 # Run test suite
bun test:watch           # Run tests in watch mode

Code Standards

  • Indentation: Tabs
  • Quotes: Double quotes
  • Validation: TypeBox (not Zod)
  • Database Naming: Snake_case
  • TypeScript Naming: camelCase

🏗️ Architecture

The application follows a domain-driven architecture with the following main domains:

  • Company Management - Multi-tenant company management with branches, employees, and service packages
  • CRM - Customer relationship management with orders, payments, and service packages
  • Fleet Management - Fleet and machine management with preventive maintenance and inspections
  • Warehouse Management - Inventory and warehouse operations
  • Technical Documentation - Technical documentation for suppliers and vehicle specifications
  • User & Permissions - User authentication and role-based access control

Each domain follows a consistent pattern:

  • index.ts - Route definitions and middleware
  • model.ts - TypeBox validation schemas
  • logic.ts - Business logic and database operations

🗄️ Database

The system uses PostgreSQL with Drizzle ORM and a multi-schema design:

  • public - Core application tables (auth, permissions)
  • crm - Customer relationship management
  • company - Organization management
  • warehouse - Inventory and warehouse operations
  • techdoc - Technical documentation
  • fleet - Fleet management

🔐 Authentication & Authorization

  • Authentication: Better-auth library
  • Authorization: Granular permission system with Redis caching
  • User Kinds: ADMIN, COMPANY_ADMIN, CUSTOMER, EMPLOYEE

📦 Key Technologies

  • Runtime: Bun
  • Framework: Elysia
  • Database: PostgreSQL with Drizzle ORM
  • Authentication: Better-auth
  • Validation: TypeBox
  • Email: React Email
  • Storage: AWS S3
  • Caching: Redis (Upstash)
  • Code Quality: Biome

🐳 Docker

Build and Deploy

# Build and push to ECR
make build

# Build production image
make build_prod

📝 Баазийн бүтэц

🤝 Contributing

  1. Follow the code standards and patterns
  2. Update documentation when making changes
  3. Write tests for new features
  4. Use TypeBox for validation
  5. Follow the domain-driven structure

📄 License

[Add your license information here]


For detailed documentation, see the docs directory.