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

cosva-api

v2.3.0

Published

A full-fledged Apollo Server with Apollo Client starter project with React and Express. [Read more about it in this tutorial to build it yourself](https://www.robinwieruch.de/graphql-apollo-server-tutorial/).

Readme

Cosva-api

A full-fledged Apollo Server with Apollo Client starter project with React and Express. Read more about it in this tutorial to build it yourself.

Family of universal fullstack repositories:

Server Applications:

Client Applications:

Features of Client + Server

  • React (create-react-app) with Apollo Client
    • Queries, Mutations, Subscriptions
  • Node.js with Express and Apollo Server
    • cursor-based Pagination
  • PostgreSQL Database with Sequelize
    • Entities:
      • users
      • user_photos
      • messages
      • comments
      • farms
      • farm_users
      • farm_photos
      • categories
      • farm_categories
      • category_groups
      • farm_category_groups
      • permissions
      • roles
      • role_permissions
      • user_roles
      • user_role_permissions
      • bovines
      • bovine_extra_data
      • bovine_purpose_types
      • bovine_purpose_type_genders
      • bovine_purposes
      • animal_genders
      • milk_production_dates
      • bovine_milk_productivities
      • bovine_reproductive_controls
      • bovine_reproductive_states
      • animal_breeds
      • animal_breed_tags
      • animal_development_stages
      • token_reset_passwords
      • bovine_reproductive_state_configuration_defaults
      • bovine_reproductive_state_configurations
      • bovine_genealogies
  • Authentication
    • powered by JWT and local storage
    • Sign Up, Sign In, Sign Out
  • Authorization
    • protected endpoint (e.g. verify valid session)
    • protected resolvers (e.g. e.g. session-based, role-based)
    • protected routes (e.g. session-based, role-based)
  • performance optimizations
    • example of using Facebook's dataloader
  • E2E testing

Installation

  • git clone [email protected]:EduardMcfly/cosva-api.git
  • cd cosva-api
  • touch .env
  • npm install
  • fill out .env file (see below)
  • Start your PostgreSQL database by running the appropriate command or by using docker compose up -d if you have a Docker configuration.
  • npx prisma generate
  • npx prisma db push
  • npx prisma db seed
  • npm run dev
  • visit http://localhost:8000 for GraphQL playground

.env file

Since this boilerplate project is using PostgreSQL, you have to install it for your machine and get a database up and running. You find everything for the set up over here: Setup PostgreSQL with Sequelize in Express Tutorial. After you have created a database and a database user, you can fill out the environment variables in the .env file.

SECRET_KEY=asdlplplfwfwefwekwself.2342.dawasdq
FILES_URL_API = files.cosva.app
APP_NAME = 'Cosva'
APP_URL = 'https://cosva.app'
MAIL_HOST = -------
MAIL_USERNAME = -------
MAIL_PASSWORD = -------

The SECRET_KEY is just a random string for your authentication. Keep all these information secure by adding the .env file to your .gitignore file. No third-party should have access to this information.

Testing

  • adjust test:run-server npm script with TEST_DATABASE environment variable in package.json to match your testing database name
    • to match it from package.json: createdb mytestdatabase with psql
  • one terminal: npm run test:run-server
  • second terminal: npm run test:execute-test

Want to learn more about React + GraphQL + Apollo?

Run migrations in production

Is important to have the ssh tunnel open to run the migrations

ssh -N -L 4200:$db:5432 ec2-user@$ec2 -i prisma.pem -v

The file .env must have the following variables

DATABASE_URL = postgresql://$user:$password@localhost:4200/$DB

npm run ssh:connect

npx prisma db seed