Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

desolid

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

desolid

🤖 Desolid: Single file self hosted backend as a service

  • 0.2.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

🤖 Desolid: Single file BaaS

Downloads Version License License

Open source, single file, self hosted, Backend as a service.

Documentation: https://desolid.netlify.app/

Blog: TODO

Features

  • GraphQL API: CRUDs
  • Authentication & Authorization: inline definition
  • File storage: Local and S3 support
  • Database agnostic: SQLite, MariaDB, PostgreSQL, MS SQL Server

Quick start

Let's create an api for a blog service:

  1. Install NodeJS

  2. Create a desolid schema file: schema.graphql

    extend enum UserGroup {
        Editor
        Author
    }
    
    type Post
        @model
        @authorization(
            READ: [Admin, Editor, "{{published}} || $user.id == {{author.id}}"]
            CREATE: [Admin, Editor, "$user.group == 'Author' && !$input.published"]
            UPDATE: [Admin, Editor, "$user.id == {{author.id}} && !$input.published"]
            DELETE: [Admin, Editor, "!{{published}} && $user.id == {{author.id}}"] #
        ) {
        id: ID!
        createdAt: DateTime!
        updatedAt: DateTime!
        author: User!
        title: String!
        content: String!
        published: Boolean!
        categories: [Category]
    }
    
    type Category
        @model
        @authorization(
            CREATE: [Admin, Editor]
            UPDATE: [Admin, Editor]
            DELETE: [Admin, Editor] #
        ) {
        id: ID!
        createdAt: DateTime!
        updatedAt: DateTime!
        name: String!
        posts: [Post]
    }
    
  3. Run this command on your terminal

    npx desolid
    
    • Compiles the schema and creates CRUDs
    • Creates and uses by default a SQLite database on the root ./database.sqlite
    • Stores files under ./upload directory
    • Logs errors and warnings on ./desolid.log file
  4. Open http://localhost:3000/ on your browser.

Acknowledgement

This project is based On these cool stuffs:

Keywords

FAQs

Package last updated on 18 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc