{"id":13726849,"url":"https://github.com/pragmalang/pragma","last_synced_at":"2025-10-27T18:30:47.156Z","repository":{"id":39012902,"uuid":"205016943","full_name":"pragmalang/pragma","owner":"pragmalang","description":"Build GraphQL APIs In No Time","archived":false,"fork":false,"pushed_at":"2023-01-06T16:42:53.000Z","size":4723,"stargazers_count":126,"open_issues_count":43,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-08T11:12:13.889Z","etag":null,"topics":["backend","graphql","graphql-server","language","pragma","web"],"latest_commit_sha":null,"homepage":"https://pragmalang.com","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pragmalang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-28T20:24:34.000Z","updated_at":"2024-11-05T00:02:19.000Z","dependencies_parsed_at":"2023-02-06T06:47:08.382Z","dependency_job_id":null,"html_url":"https://github.com/pragmalang/pragma","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/pragmalang/pragma","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pragmalang%2Fpragma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pragmalang%2Fpragma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pragmalang%2Fpragma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pragmalang%2Fpragma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pragmalang","download_url":"https://codeload.github.com/pragmalang/pragma/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pragmalang%2Fpragma/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281319812,"owners_count":26481067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","graphql","graphql-server","language","pragma","web"],"created_at":"2024-08-03T01:03:27.273Z","updated_at":"2025-10-27T18:30:46.753Z","avatar_url":"https://github.com/pragmalang.png","language":"Scala","funding_links":[],"categories":["Scala"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pragmalang.com\" target=\"_blank\"\u003e\n    \u003cimg \n      src=\"https://raw.githubusercontent.com/pragmalang/pragma/master/website/static/img/full-logo.svg\"\n      alt=\"Pragma logo\"\n      width=\"400px\"\n    /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[![Discord](https://img.shields.io/discord/719970258903105558?label=Discord\u0026logo=discord\u0026style=for-the-badge)](https://discord.gg/gbhDnfC)\n[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/pragmalang?style=for-the-badge\u0026logo=Reddit\u0026logoColor=E17334\u0026color=E17334)](https://reddit.com/r/pragmalang)\n![Tests](https://img.shields.io/github/workflow/status/pragmalang/pragma/Test/master?style=for-the-badge\u0026label=tests)\n![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=for-the-badge)\n\n# Table of Contents\n- [Table of Contents](#table-of-contents)\n- [Introduction](#introduction)\n  - [What is Pragma?](#what-is-pragma)\n  - [Who is Pragma for?](#who-is-pragma-for)\n  - [Tell People About This](#tell-people-about-this)\n  - [Documentation](#documentation)\n- [Install Pragma](#install-pragma)\n  - [Linux](#linux)\n  - [macOS](#macos)\n  - [Windows](#windows)\n- [Getting Started](#getting-started)\n- [Community \u0026 Support](#community--support)\n- [Contributing](#contributing)\n\n# Introduction\n\n## What is Pragma?\n\nPragma is a language for building beautiful and extensible GraphQL APIs ***in no time***. Within a single file, you can define your **data models** and **authorization rules (roles and permissions)**, and **import serverless functions** for data validation, transformation, authorization, or any custom logic. With a single command, Pragma generates a fully functional API, ready to be consumed from your front-end application.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://pragmalang.com/img/snippet.png\" width=\"500px\" /\u003e\n\u003c/p\u003e\n\n## Who is Pragma for?\n\nPragma is for developers who want to build, iterate, and ship as fast as possible and focus on user-facing features instead of dealing with resolvers, endpoints, migrations, authentication, authorization, scaling, queries, and all the headache that comes with building and maintaining an API.\n\nPragma is a perfect fit for startups. In fact, the original motivation behind it was testing new ideas in hours or days instead of weeks or months. It is designed to help you move quickly.\n\nPragma helps you focus on your users and primary business/domain logic, deliver a lot faster (10-100x faster than traditional frameworks), iterate and try new ideas with minimal technical cost.\n\nPragma is great for building internal tools too. You don't want to spend too much time building an internal tool, you just want it to work; Pragma is a great fit for such situations.\n\nPragma is for developers who want to materialize their ideas quickly, and share them with the world.\n\nPragma is for builders.\n\n## Tell People About This\n\nHyped? [Tweet about this project](https://twitter.com/intent/tweet?text=Hi%20everyone,%20I%20just%20found%20this%20cool%20project%20called%20@pragmalang.%0a%0a@apollographql\u0026url=https://github.com/pragmalang/pragma\u0026hashtags=GraphQL,code,javascript,react,reactjs,reactnative,apollo) and tell your followers how interesting this is.\n\nYou can also [join our Discord server](https://discord.gg/gbhDnfC) to meet other developers, get community support, and have fun!\n\n[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Hi%20everyone,%20I%20just%20found%20this%20cool%20project%20called%20@pragmalang.%0a%0a@apollographql\u0026url=https://github.com/pragmalang/pragma\u0026hashtags=GraphQL,code,javascript,react,reactjs,reactnative,apollo) [![Discord](https://img.shields.io/discord/719970258903105558?label=Discord\u0026logo=discord\u0026style=social)](https://discord.gg/gbhDnfC)\n\n## Documentation\n\nVisit [the documentation](https://docs.pragmalang.com) to learn Pragma in a few minutes.\n\n# Install Pragma\n\n## Linux\n\n### Requirements\n- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/)\n\nTo make sure you have them and that they work, run:\n```sh\ndocker run hello-world\n```\n```sh\ndocker-compose --help\n```\n\nIf any of the above commands fail, make sure it works before proceeding with the installation of Pragma.\n\n### Installation\n\nTo install Pragma, run:\n```\ncurl https://raw.githubusercontent.com/pragmalang/pragma/master/scripts/install-universal.sh | sh\n```\nThe script will ask for root access, so make sure to enter your password when prompted.\n\nIf you're on Ubuntu/Debian, you can download the `.deb` package from [releases](https://github.com/pragmalang/pragma/releases/latest).\n\n### Run Pragma\n\nOnce Pragma is downloaded and installed, you can see if it works by running the following command:\n```\npragma help\n```\n\n## macOS\n\n### Requirements\n\n- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/)\n- [Java](https://www.oracle.com/java/technologies/javase-jdk15-downloads.html)\n\nTo make sure you have them and that they work, run:\n```sh\ndocker run hello-world\n```\n```sh\ndocker-compose --help\n```\n```sh\njava -version\n```\n\nIf any of the above commands fail, make sure it works before proceeding with the installation of Pragma.\n\n\u003e **Note:** When [installing Java](https://www.oracle.com/java/technologies/javase-jdk15-downloads.html), make sure to use the **macOS Installer**. The macOS version of Pragma is the only one that doesn't come with a bundled Java runtime, due to the latest security features in macOS Catalina+.\n:::\n\n### Run Pragma\n\nOnce Pragma is downloaded and installed, you can see if it works by running the following command from the terminal:\n```\npragma help\n```\n\n## Windows\n\n### Requirements\n\n- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/)\n\nTo make sure you have them and that they work, run:\n```sh\ndocker run hello-world\n```\n```sh\ndocker-compose --help\n```\n\nIf any of the above commands fail, make sure it works before proceeding with the installation of Pragma.\n\n### Installation\n\nFirst, we need to install the Pragma CLI:\n\n- Download the latest MSI (`.msi`) installer from [GitHub releases](https://github.com/pragmalang/pragma/releases/latest)\n- Run the installer and follow the installation wizard\n\n\u003e *Note*: If Microsoft Defender tells you it prevented an unrecognized app from starting, click on \"__More info__\", then click on **\"Run anyway\"**.\n\n### Run Pragma\n\nOnce Pragma is downloaded and installed, you can see if it works by running the following command from PowerShell:\n```\npragma help\n```\n\n# Getting Started\n\nAfter Pragma has been successfully installed, visit [this page of the documentation](https://docs.pragmalang.com/docs/getting-started/basic-todo-app) for a step-by-step tutorial on building a simple Todo application.\n\n# Community \u0026 Support\n\nIf you have any questions or feedback, you can join our [Discord server](https://discord.gg/gbhDnfC) or post to [r/pragmalang](https://www.reddit.com/r/pragmalang/). We would love to hear from you!\n\n# Contributing\n\nPragma is a Scala 2.13 project built using SBT. It's divided into three subprojects:\n* `core`: where the domain abstractions and parsing logic is kept alongside any shared logic between other subprojects. All other subprojects depend on the `core`.\n* `daemon`: where the serving and project management logic lives. It needs instances for Postgres and Openwhisk to be running; it's meant to be running alongside them in the background while using Pragma during development and in production.\n* `cli`: where the communication with the `daemon` and the loading of user files is done.\n\nIt's highly recommended to be familiar with [Cats](https://typelevel.org/cats/) and [Cats Effect](https://typelevel.org/cats-effect/) before starting to work on the daemon. \n\n## Setup\nPragma has been developed using VSCode with the Metals extension on Linux. For it all to work, it requires a JDK, Scala, SBT, and Ammonite for some scripts. Use this script to quickly install them:\n```sh\ncurl -Lo cs https://git.io/coursier-cli-linux \u0026\u0026 chmod +x cs \u0026\u0026 ./cs setup\n```\nDocker and Docker Compose are also used for conveniently running Postgres and Openwhisk locally.\n\n## Testing\nThe recommended way to work on the daemon is to run it using SBT and run Postgres and Openwhisk from `docker-compose`.\n\nTo run Postgres and Openwhisk:\n```sh\ncd daemon/src/main/resources/ \u0026\u0026 docker-compose up\n```\n\u003e Make sure to run this before running `sbt 'daemon/test'`.\n\nRunning the daemon using `sbt 'daemon/run'` requires the following environment variables to be exported:\n```sh\nexport DAEMON_HOSTNAME=localhost \u0026\u0026 \\\nexport DAEMON_PORT=9584 \u0026\u0026 \\\nexport DAEMON_PG_HOST='localhost' \u0026\u0026 \\\nexport DAEMON_PG_PORT=5433 \u0026\u0026 \\\nexport DAEMON_PG_DB_NAME='test' \u0026\u0026 \\\nexport DAEMON_PG_USER='test'  \u0026\u0026 \\\nexport DAEMON_WSK_API_URL='http://localhost:3233'  \u0026\u0026 \\\nexport DAEMON_WSK_AUTH_TOKEN='23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP'  \u0026\u0026 \\\nexport DAEMON_PG_PASSWORD='test'  \u0026\u0026 \\\nexport DAEMON_WSK_API_VERSION=1\n```\n\nYou can run the daemon alongside Postgres and Openwhisk with:\n```sh\n# In the root of the project\ndocker-compose up\n```\n\n\u003e NOTE: If the docker containers cannot be started it's most likely because the port 5433 is already in use. Run `docker ps` and then run `docker kill \u003cpostgres-containe-id\u003e` to kill the Postgres container to fix it.\n\n## Docker Build\nDocker builds are performed using [SBT Native Packager](https://www.scala-sbt.org/sbt-native-packager/formats/docker.html). To build the Pragma daemon Docker image:\n```\nsbt \"daemon/docker:publishLocal\"\n```\n\n## CLI Packaging\n\n\u003e NOTE: Generating the packages for each platform requires running the build on that very platform, in addition to some dependencies installed locally. See the requirements of each platform's plugin.\n\nThese packages should **NOT** require a local JDK installation, or have any dependencies since the [Jlink plugin](https://www.scala-sbt.org/sbt-native-packager/archetypes/jlink_plugin.html) is used.\n\nTo build Linux packages:\n```sh\nsbt 'cli/debian:packageBin; cli/rpm:packageBin'\n```\n\nTo build Windows installer (`.msi`):\n```sh\nsbt 'cli/windows:packageBin'\n```\n\nTo build MacOS `.dmg`:\n```sh\nsbt 'cli/universal:packageOsxDmg'\n```\n\n## Apache Bench benchmark\nRun the ammonite script in `test/benchmark`:\n```\namm PragmaBench.sc\n```\nMake sure the daemon is running before running the benchmark (run `docker-compose up` in the root of the project).\n\n\u003e NOTE: Apache Bench must be installed:\n\u003e```\n\u003esudo apt install apache2-utils\n\u003e```\n\n## Documentation\nThe user documentation lives in `website/docs` and is built using Docusaurus 2. It's hosted on http://docs.pragmalang.com.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpragmalang%2Fpragma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpragmalang%2Fpragma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpragmalang%2Fpragma/lists"}