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 🙏

© 2024 – Pkg Stats / Ryan Hefner

repair-quoter

v5.4.0

Published

repair-quoter a complete cellphone and electronics repair industry leads generating widget.

Downloads

9

Readme

repair-quoter

Description

repair-quoter a complete cellphone and electronics repair industry leads generating widget.

It is capable of collecting, storing, replying to, and tracking website leads via quoting for device repairs.

Project development begain in November of 2022 and is ongoing.

Features

  • Automatic email responses with templates.
  • Includes frontend example to use on an existing website.
  • Includes employee followup tracking with user management.
  • Automatically removes users not verified via email.
  • Customizable to suit your brand.
  • Lightweight and can run on anything javascript can run on.

Prerequisites

  • An SMTP mail host to send quote emails.
  • A MongoDB database to store the repair pricelist and leads.
  • Properly configured environment variables. *see below

Install

repair-quoter is hosted on NPMJS.org

npm install repair-quoter

Setup

Constants

The api/constants.js file contains a simple template to configure the api for your company.

You should never place any sensitive or private information in this file!

Environment Variables

repair-quoter uses dotenv as a dev-dependency.

repair-quoter uses the following environment variables to connect to your database and to send emails through your smtp host.

Your Environment variables could look something like this:

PORT = 4200 // this is the port for the development server
TESTEMAIL = "[email protected]" /* this is the email address test emails are sent to */
MONGO_URI = "mongodb+srv://<user>:<password>@cluster0.exampleURI.mongodb.net/?retryWrites=true&w=majority"
EMAIL_HOST = "smtp.emailhost.com"
EMAIL_PORT = 587
EMAIL_USER = "[email protected]"
EMAIL_PASS = "userPassword"
JWT_SECRET = < secret string for JSON web tokens >

Usage

Start API

npm run serve:api

Start Client

npm run serve:client

Client

client/widget.html contains a simple working frontend for the api. This file MUST be served via an http server. Otherwise, you will experience a CORS error. repair-quoter uses serve to run a simple client serving the quote form.

API Endpoints

Any errors will be returned as {error:< err >}

/

Request: ANY

Response:

OK

/login

Request: POST

{
  username: < username >,
  password: < password >
}

Response:

{id:< user._id >,token:< JSON web token >}

/register

Request: POST

{
  username: < username >,
  password: < password >,
  password2: < verified password >
}

Response:

{id:< user._id >,registered:true}

/devices

Request: GET

/devices?id=< id > 
or 
/devices?page=< page number or pageless > *default page:1

Response:

{
    docs: < deviceObjectArray >,
    totalDocs: < totalDevices >,
    offset: 0,
    limit: 10,
    totalPages: < totalPages >,
    page: < currentPage >,
    pagingCounter: 1,
    hasPrevPage: < true/false >,
    hasNextPage: < true/false >,
    prevPage: < # >,
    nextPage: < # >             
  }

Request: POST

{
  type:'phone',
  make:'Apple',
  model:'iPhone X'
}

Response:

{
  _id: new ObjectId("637c128d2359c98abccc6bc3"),
    type: 'phone',
    make: 'Apple',
    model: 'iPhone X',
    fusedDisplay: false,
    __v: 0
}

Request: PUT

 {
  repairs: {
    screenGlass: < updates >,
    lcd: < updates >,
    battery: < updates >,
    chargePort: < updates >,
    frontCamera: < updates >,
    rearCamera: < updates >,
    earSpeaker: < updates >,
    loudSpeaker: < updates >,
    rearGlass: < updates >,
    liquidDamage: < updates >
  },
  _id: new ObjectId("637c128d2359c98abccc6bc3"),
  type: < updates >,
  make: < updates >,
  model: < updates >,
  fusedDisplay: < updates >,
  __v: 0
}

Response:

 {
  repairs: {
    screenGlass: < updates >,
    lcd: < updates >,
    battery: < updates >,
    chargePort: < updates >,
    frontCamera: < updates >,
    rearCamera: < updates >,
    earSpeaker: < updates >,
    loudSpeaker: < updates >,
    rearGlass: < updates >,
    liquidDamage: < updates >
  },
  _id: new ObjectId("637c128d2359c98abccc6bc3"),
  type: < updates >,
  make: < updates >,
  model: < updates >,
  fusedDisplay: < updates >,
  __v: 0
}

Request: DELETE

/devices?id=< id >

Response:

 false

/leads

Request: GET

/leads?id=< id >
or
/leads?page=< page number or pageless >  * default page:1

Response:

{
  docs: < leadsObjectArray >,
  totalDocs: < totalLeads >,
  offset: 0,
  limit: 10,
  totalPages: < totalPages >,
  page: < currentPage >,
  pagingCounter: 1,
  hasPrevPage: < true/false >,
  hasNextPage: < true/false >,
  prevPage: < # >,
  nextPage: < # >             
  }

Request: POST

{
  firstName: 'Testy',
  lastName: 'McTesterson',
  location: 'Test',
  email: '[email protected]',
  phone: '918',
  make: 'Apple',
  model: 'iPhone X',
  issue: 'rearGlass'
}

Response:

{
  firstName: 'Testy',
  lastName: 'McTesterson',
  location: 'Test',
  email: '[email protected]',
  phone: '918',
  make: 'Apple',
  model: 'iPhone X',
  issue: 'rearGlass',
  convertedUser: '',
  respondedUser: '',
  date: 2022-11-22T00:06:37.467Z,
  modified: 2022-11-22T00:06:37.467Z,
  emailed: true,
  responded: false,
  converted: false,
  duplicate: false,
  hidden: false,
  _id: new ObjectId("637c128f2359c98abccc6bc8"),
  __v: 0
}

Request: PUT

{
  price: < updates >,
  responded: < updates >,
  converted: < updates >,
  duplicate: < updates >,
  hidden: < updates >,
  _id: new ObjectId("637c128f2359c98abccc6bc8"),
  __v: 0
}

Response:

{
  firstName: 'Testy',
  lastName: 'McTesterson',
  location: 'Test',
  email: '[email protected]',
  phone: '918',
  make: 'Apple',
  model: 'iPhone X',
  issue: 'rearGlass',
  price: < updates >,
  convertedUser: '',
  respondedUser: '',
  date: 2022-11-22T00:06:37.467Z,
  modified: 2022-11-22T00:06:37.467Z,
  emailed: true,
  responded: < updates >,
  converted: < updates >,
  duplicate: < updates >,
  hidden: < updates >,
  _id: new ObjectId("637c128f2359c98abccc6bc8"),
  __v: 0
}

Request: DELETE

/leads?id=< id >

Response:

 false

License

GNU GPLv3