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

activeql

v1.0.2

Published

Domain Driven GrapqhQL API Development for NodeJS

Downloads

3

Readme

ActiveQL

A framework for building domain driven GraphQL APIs with an oppionated approach and convention over configuration and DRY in mind. Based on a simple domain configuration (mainly entities with attributes and their relationships) it

  • generates a full GraphQL schema with aspects like searching, sorting, paging, permission access etc.
  • provides a full fledged GraphQL API with resolvers - powered by Apollo and MongoDB (other Databases can be supported as well)
  • provides an Admin UI for basic CRUD applications
  • allows to be extended for any non-convention requirement with custom code

You can find the documentation here

Use ActiveQL

To develop applications with ActiveQL you do not need this package - you can start with one of the following

Application Generator

The easiest way to start is the ActiveQL application generator at https://github.com/betterobjects/activeql-generator

You can create a new ActiveQL application in the folder my-activeql (or any other name) with the following command:

npx betterobjects/activeql-generator my-activeql

Starter-Application

If you can't use npx you can also fork and clone the ActiveQL-Starter-Application at https://github.com/betterobjects/activeql-starter

git clone https://github.com/betterobjects/activeql-starter

Install dependencies

Please call npm install in the folders

./express
./angular

You can safely delete the angular folder and skip all Angular related steps if you do not want to use the Admin UI but just the GraphQL API.

Start developing

In the folder ./express/activeql/domain-configuration create a YAML file, e.g. car.yml with the following content:

entity:
  Car: 
    attributes: 
      licence: Key
      brand: String!
      mileage: Int

Start the server

cd express
npm run server

This will start a GraphqlAPI endpoint at http://localhost:3000/graphql

If you point your browser to this address you will find full fledged GraphQL API whith many queries and mutations you can interact with. For reading / storing data an embedded MongoDB-like database NeDB is used per default. You can change the used database of course.

To create a car you could call the mutation:

mutation {
  createCar( car: { licence: "HH AQ 2021" brand: "Mercedes", mileage: 10000 } ){
    car{ id licence brand mileage }
  }
}

with the answer from your GraphQL API

{
  "data": {
    "createCar": {
      "car": {
        "id": "GjgoJZ9RNHPQ1Pij",
        "licence": "HH AQ 2021",
        "brand": "Mercedes",
        "mileage": 10000
      }
    }
  }
}

To run the Angular Admin UI together with the server you can run

cd express
npm run start

You can of course run the Angular application seperately with

cd ./angular
ng serve

The Admin UI will be served at http://localhost:4200

Custom configuration of the UI is done in the file

./angular/src/app/config/admin.config.ts

Please check out the Documentation for more.