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

platformservice

v41.16.0

Published

A simple platform allowing folks to connect w. their communities.

Downloads

11

Readme

PlatformService

Codeship Status for wherebyus/platformservice codecov

PlatformService is a Lumen app that facilitates a bunch of features for our service Letterhead. It is largely responsible for the management of newsletters, and acts as an API gateway for additional services that handle roles, permissions, users, link resolution, pixel tracking, and so on.

Installation

Using Docker and docker-compose

Let's assume that the user already have docker installed, if not please refer to: https://docs.docker.com/engine/ and https://docs.docker.com/compose/

- Navigate to the project root direcotry.
- Be sure you have a .env file already configured.
- Change the DB_HOST variable into the .env as shown:
    DB_HOST=db-platformservice
- Add the following the the .env file:
    NGINX_HOST=<host_name_you_want>
    Examle:  NGINX_HOST=platformservice.com
- Add the <host_name_you_want> to the host file on your OS.
- Run the following command:
    * docker-compose build dev
    * docker-compose up -d
    * docker-compose exec app composer install
    * docker-compose exec php artisan migrate

That's it! Now visit <host_name_you_want>:8080 Ex: http://platformservice.com:8080

If you want to browse the database, connect to: Host: 127.0.0.1 Port: 3305 Username: The user configured on .env Password: The pass configured on .env

Deploy

DigitalOcean

We can deploy PlatformService on DigitalOcean's App Platform. A template "app spec" lives in the .do/ directory. Treat it like a .env.example. It's a little more verbose, but the principle is the same. Rename the service, and swap {VALUE} with the appropriate values in a file named how you like. You can then deploy it using DigitalOcean's doctl CLI with

doctl apps create --spec path/to/spec

If you have doctl installed, your YAML is valid, and you have the appropriate privileges, this will deploy PlatformService to the app platform at a new url, which you can retrieve from doctl or through the browser by logging into DigitalOcean.

On an Ubuntu server

Scheduled tasks and queues

PlatformService relies on a variety of scheduled tasks (or cron jobs) and queues to perform functions behind the scenes. You'll need to be familiar with Lumen and Laravel. The documentation on Queues, Jobs, Tasks, and the like, is really quite good.

Supervisor

In a live environment you'll find that we rely on Supervisor, which runs in the background on an Ubuntu server and manages processes (like queues!) for us. You can find PlatformService's Supervisor configuration file at the root of this repo :) called lumen-queue-platformservice.conf.

  1. Place this in /etc/supervisor/conf.d/
  2. supervisorctl reread
  3. supervisorctl update
  4. supervisorcl restart all
Cron

Our tasks and recurring jobs are found in app/console/Kernel.php. In a live environment, to have the server run these you will need to edit your cron sudo crontab -e and add

* * * * * cd /path/to/platformservice && php artisan schedule:run >> /dev/null 2>&1

Small test