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

@comake/solid-on-rails

v0.10.0

Published

Runs a Node.js server using componentsjs preset with configurations for working with Solid.

Downloads

273

Readme


Solid on Rails was created to make it easy for developers to get up an running with SKL and Solid. Taking inspiration from the success of Ruby on Rails, it comes pre-configured with everything needed to create an application that can:

  • Store application data in a database (relational or key-value)
  • Expose an API (REST, GraphQL, etc.)
  • Run asyncronous workloads in the background
  • (Coming Soon) Store user data in a Solid pod
  • (Coming Soon) Authenticate users with Solid OIDC

Features

Dependency Injection

The Solid on Rails framework is designed to be flexible such that people can easily run different configurations. To do so, Solid on Rails uses the dependency injection framework Components.js.

Components.js allows components to be instantiated and wired together declaratively using semantic configuration files. Solid on Rails also uses Components-Generator.js to automatically generate the necessary description configurations of all classes. Components are configured in JSON files, which makes it so that changing the configuration does not require any changes to the code.

Get started configuring your application

Storage

Solid on Rails utilizes the Data Mapper Pattern to separate an application's domain logic and it's usage of databases to store data. This means that you can create applications that are loosely coupled, and thus hightly scalable and maintainable.

The Data Mapper Pattern is implemented using TypeORM. It includes a system to run migrations on data in the database.

Learn more about Storage

Routes

Like Rails, routes to connect URLs to code for the application's API or web pages are defined in a configuration file. Each route matches a URL pattern and HTTP method to a specific handler (or a chain of handlers). These handlers are defined in JSON using the dependency injection framework Components.js.

Learn more about Routes

Background Jobs

Solid on Rails comes with a built in system for scheduling background jobs to be executed outside of the main process. Background job queues can solve many different problems, from smoothing out processing peaks to creating robust communication channels between microservices or offloading heavy work from one server to many smaller workers, etc.

A variety of queuing backends can be used but the default configuration uses Bull.

Learn more about Background Jobs

Requirements

Please ensure your operating system has the following software installed:

{% hint style="info" %} If your application doesn't need background job processing, you don't need to run Redis (See How to remove Background Jobs). {% endhint %}

{% hint style="info" %} If your application doesn't need to store applicaton data, you don't need to run a database (See How to remove application data storage). {% endhint %}

Quick Start

Create a Node.js application (if you haven't already):

mkdir my-application
cd my-application
npm init

Install the latest server version from the npm package repository:

npm install --save @comake/solid-on-rails

Add the start command to scripts in your package.json

"scripts": {
  "start": "npx solid-on-rails"
}

Start the server! 🚀

npm run start

Continue to the Getting Started guide to learn how to create your own Components.js configuration to customize your application with your own routes, plugins, background jobs, and more.


TODO

  • [ ] Break up BaseHttpServerFactory createServer function
  • [ ] UiEnabledConverter?
  • [ ] Add integration tests for Storage Accessor
  • [ ] Add migration documentation
  • [ ] Add CLI documentation

Note

There's a bug with typeorm and componentsjs-generator You have to add "./package.json": "./package.json", to the exports of node_modules/typeorm/package.json. See:

  • https://github.com/typeorm/typeorm/issues/9178
  • https://github.com/LinkedSoftwareDependencies/Components-Generator.js/issues/83