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

@glowlabs-org/crm-bindings

v0.1.0-alpha.34

Published

A library containing all API bindings for the Elysia App

Downloads

188

Readme

GCA CRM Backend

Stack

  1. Elysia
    • A typesafe API Client
    • The types are bundled into an npm module and reused across projects to guarantee typesafe requests and responses
    • NPM Publishing is handled in CI
  2. Postgres
  3. Drizzle ORM
  4. Redis
    • Used for caching and potentially rate limiting in future
  5. Viem / Ethers

Getting Started

For API Consumers

You can download the npm module by running

bun install @glowlabs-org/crm-bindings [email protected] @elysiajs/[email protected]

You can then go to this example to get a quickstart into consuming the API.

Swagger docs are also available here

For Contributors

  1. Set up your environment
DATABASE_URL="postgresql://postgres:<password>@<host>:<port>/<database>?sslmode=disable"
REDIS_URL=<YOUR_REDIS_URL>
MAINNET_RPC=<YOUR_MAINNET_RPC>

Install dependencies bun install

Run the dev server bun run dev 2. Get somewhat familiar with the repository structure

| Index | Folder/File | Description | | ----- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | index.ts | Kickoff function that initiates the server. | | 2 | constants folder | Contains all constants that are reused through the application | | 3 | routers folder | Contains each individual microservice. Routers are grouped by group relavance. For example, all routes regarding rewards go in the rewards router. The prefix for a controller can be found in its respective entrypoint file. Utility functions scoped only to the router should be included in this folder. | | 5 | db folder | Contains the schema and ORM object for the database | | 6. | lib folder | Includes all utils and helpers that are reused the project. Includes reusable utils for redis, using web3 functions, etc. | | 7. | crons folder | Includes all low level code implementation for each respective cron Job. Crons are initialized at the top level in index.ts. |

  1. Understand the database structure

Understanding the database structure

  • If adding or removing columns from the database schemas, make sure to first get familiar with src/db/schema.ts. This file contains a list of rules to adhere to when making changes to database schemas.
  • Generally speaking, keep in mind where decimals are being manipulated and where they are not. For example, usdg rewards and glow rewards are stored with 2 decimals of precision as sql bigints due to sql size limitations. This pattern is adhered to throughout the codebase.
  • Also make sure that before running a database schema change, you run bun run test. Some mutations are raw sql for performance and they rely on manually coding the sql fields. An example in src/crons/update-user-rewards/update-user-rewards-for-week.ts
  • You should generally try to avoid writing raw SQL and use the ORM. If you are writing raw SQL for optimization purposes, make sure to add unit tests that would cause the testing pipeline to break if your mutation would break from the schema change.

When To Cache

TODO: Write this section;