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

@darshan022/baas-platform

v1.0.3

Published

Backend-as-a-Service platform with Authentication, Database, and Storage APIs

Readme

BAAS Platform

Cloud-Native Backend-as-a-Service - Zero setup, instant backend APIs. No servers, no databases, no configuration required!

🚀 Quick Start

1. Get Your API Key

Visit your-dashboard.com to:

  • Create a project
  • Generate your API key
  • Get your Project ID

2. Install & Use

npm install baas-platform

3. Basic Usage

const BAAS = require("baas-platform");

const baas = new BAAS({
  apiKey: "pk_live_your_api_key_here",
  projectId: "your_project_id",
  port: 3000, // Optional: defaults to 3000
});

baas.start();

That's it! 🎉 Your backend is ready with Auth, Database, and Storage APIs.

Using CLI Tool

# Install globally
npm install -g baas-platform

# Initialize a new project
baas init my-project
cd my-project
npm install
npm start

⚙️ Configuration

Required Configuration

const baas = new BAAS({
  apiKey: "pk_live_your_api_key_here", // Required: Get from dashboard
  projectId: "your_project_id", // Required: Get from dashboard
});

Optional Configuration

const baas = new BAAS({
  apiKey: "pk_live_your_api_key_here",
  projectId: "your_project_id",
  port: 3000, // Optional: Server port (default: 3000)
  baseUrl: "https://hack-cbs-project-backend-1.vercel.app", // Optional: Custom API endpoint
  corsOrigins: ["http://..."], // Optional: Allowed CORS origins
  rateLimit: 300, // Optional: Rate limit per 15 minutes
  trackingEnabled: true, // Optional: Enable usage tracking (default: true)
});

Environment Variables

Create a .env file:

BAAS_API_KEY=pk_live_your_api_key_here
BAAS_PROJECT_ID=your_project_id
BAAS_BASE_URL=https://hack-cbs-project-backend-1.vercel.app
PORT=3000
NODE_ENV=production

🌐 How It Works

Cloud-Native Architecture

The BAAS NPM package acts as a smart proxy that:

  1. Receives requests on your local server (port 3000)
  2. Validates API key and project ID automatically
  3. Forwards requests to the cloud backend
  4. Tracks usage for analytics and billing
  5. Returns responses to your application

Zero Setup Required

  • No MongoDB setup - Cloud database handles everything
  • No server configuration - Just run and go
  • No environment setup - Only API key needed
  • No scaling concerns - Cloud handles all traffic
  • Instant backend - Auth, Database, Storage ready

📊 Usage Tracking & Analytics

Every API call is automatically tracked for:

What's Tracked:

  • API endpoint usage - Which endpoints are called
  • Response times - Performance metrics
  • Success/failure rates - Error tracking
  • Request volume - Usage patterns
  • Project analytics - Per-project insights

Privacy & Security:

  • API key validation - Secure authentication
  • Project isolation - Data separated by project
  • No personal data - Only technical metrics
  • Opt-out available - Set trackingEnabled: false

View Analytics:

Visit your dashboard at your-dashboard.com to see:

  • Real-time usage metrics
  • Performance analytics
  • Error monitoring
  • Usage billing

📚 Available APIs

Authentication APIs

  • POST /api/auth/signup - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout

Database APIs

  • GET /api/db/query - Query records
  • POST /api/db/insert - Insert records
  • PUT /api/db/update - Update records
  • DELETE /api/db/delete - Delete records

Storage APIs

  • POST /api/storage/upload - Upload files
  • GET /api/storage/download - Download files
  • DELETE /api/storage/delete - Delete files

Management APIs

  • GET /api/keys - List API keys
  • POST /api/keys - Create API key
  • DELETE /api/keys/:id - Delete API key
  • GET /api/usage/stats/:projectId - Usage statistics

🔑 API Key Management

Generate API Key

// Generate API key
const apiKey = await baas.generateApiKey({
  name: "My App Key",
  permissions: ["auth", "database", "storage"],
});

console.log(apiKey); // pk_live_...

Using API Keys

// Make authenticated requests
fetch("/api/auth/signup", {
  method: "POST",
  headers: {
    "x-api-key": "pk_live_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    email: "[email protected]",
    password: "password123",
  }),
});

🐳 Docker Deployment

Dockerfile

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

Docker Compose

version: "3.8"
services:
  baas:
    build: .
    ports:
      - "3000:3000"
    environment:
      - MONGODB_URI=mongodb://mongo:27017/baas
      - JWT_SECRET=your-secret-key
    depends_on:
      - mongo

  mongo:
    image: mongo:latest
    ports:
      - "27017:27017"
    volumes:
      - mongo_data:/data/db

volumes:
  mongo_data:

Run with Docker

docker run -p 3000:3000 \
  -e MONGODB_URI=mongodb://your-db:27017/app \
  -e JWT_SECRET=your-secret \
  baas-platform:latest

🌐 Cloud Deployment

Vercel

{
  "version": 2,
  "builds": [
    {
      "src": "server.js",
      "use": "@vercel/node"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "server.js"
    }
  ]
}

Railway

[build]
builder = "NIXPACKS"

[deploy]
healthcheckPath = "/health"
restartPolicyType = "ON_FAILURE"

📊 Usage Analytics

The platform includes built-in usage tracking:

  • API call counts
  • Response times
  • Error rates
  • Endpoint usage statistics

Access analytics at: GET /api/usage/stats/:projectId

🛠 Development

Local Development

# Clone the repository
git clone https://github.com/yourusername/baas-platform.git
cd baas-platform

# Install dependencies
npm install

# Start development server
npm run dev

Testing

npm test

📝 License

MIT License - see LICENSE file for details.

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

📞 Support

  • 📧 Email: [email protected]
  • 📖 Documentation: https://docs.yourcompany.com
  • 🐛 Issues: https://github.com/yourusername/baas-platform/issues