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

starfleet-command

v0.1.4

Published

Instantly generates GraphQL services from your MongoDB/mongoose schemas and Apollo server for testing, with the ability to deploy them to docker containers

Downloads

9

Readme

Starfleet

Package on npm

With one command, enable your MongoDB project to utilize the high-performance GraphQL API! Interested in trying out GraphQL? Quickly convert all your mongoose schemas to viewable and editable GraphQL pieces.

Starfleet is a command line tool that lets you easily harness the flexibility of MongoDB with the declarative power of GraphQL.

GraphQL is a popular and rapidly growing data query and manipulation language for APIs, eliminating issues that often come with RESTful API services such as over- and under-fetching data. GraphQL is language agnostic and incorporates strong data types. It even has built in introspection - what more is there to love?

MongoDB is one of the most popular NoSQL database management systems out there. Its document-oriented structure lends itself to high horizontal scalability and the enforcement of strong data integrity. It is also open-sourced and has a great community!

GraphQL requires a lot of boilerplate code just to get started, whether you're starting from scratch or have an existing codebase. Starfleet gives you a powerful and convenient way to onboard GraphQL. You can access Starfleet via the CLI, with both the ability to create and test any project that utilizes MongoDB & Mongoose ODM with GraphQL. You can even use Starfleet to spin up your project in a docker container! Sound good? Let's get started!

Prerequisites

You should have your file(s) containing the mongoose models you'd like converted in one folder (default: /models). Starfleet will generate a '/graphqlsrc' file directory containing all the boilerplate GraphQL pieces from the files in the provided folder.

If you want to deploy your project using docker, you must set up docker beforehand (https://docs.docker.com/get-started/).

CLI

To get started, install Starfleet globally or locally:

npm install -g starfleet-command

Then, navigate into your project directory and run:

starfleet init

The /graphqlsrc folder will be created in your current working directory:

-graphqlsrc
  -models
    -starfleet-SDL.graphql
  -resolvers
    -starfleet-resolvers.graphql

Additionally, a '/starfleet-server.js' file will be created in your current working directory. The SDL file and resolvers file (with default CRUD operations) are automatically imported to starfleet-server.js file and used to initialize an Apollo Server. (If you don't already know about Apollo Server, it is a very powerful library for GraphQL that helps you connect a GraphQL schema to an HTTP server in Node.js. It comes with powerful tools such as caching and performance monitoring. Visit Apollo's website for more information!)

If you want to try out your converted mongoose schemas with GraphQL, install Apollo Server by running

npm install apollo-server graphql

modify your package.json file, and then run npm start to test it out in a GraphQL playground!

Deployment

Starfleet lets you test your GraphQL project in a docker container. Once you have docker installed and running on your local machine, just run:

starfleet deploy --docker

A 'Dockerfile' and 'docker-compose-starfleet.yml' will be created in your current working directory and then immediately used to deploy your application to docker at the same port specified in the starfleet-server.js file. To terminate the created docker container, just run:

starfleet land --docker

Additional

All possible commands and flags and additional information can be viewed in the CLI by running:

starfleet --help

If at any time you'd like to delete the generated files, enter:

starfleet cleanup

We are actively welcoming pull requests or any feedback/requests.

Built With

Contributors

  • Andrew Shin - (https://github.com/andrewsnapz)
  • Jason Yu - (https://github.com/json-yu)
  • Justin Jang - (https://github.com/justin1j)
  • Mychal Estalilla - (https://github.com/mychaI)

License

This project is licensed under the MIT License - see the LICENSE.md file for details