{"id":18336384,"url":"https://github.com/launchpadlab/launchpad_api","last_synced_at":"2025-04-09T19:55:35.634Z","repository":{"id":54323969,"uuid":"205243421","full_name":"LaunchPadLab/launchpad_api","owner":"LaunchPadLab","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-24T06:48:38.000Z","size":643,"stargazers_count":0,"open_issues_count":6,"forks_count":3,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-09T19:55:25.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LaunchPadLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-29T20:15:26.000Z","updated_at":"2020-08-28T18:24:49.000Z","dependencies_parsed_at":"2022-08-13T12:00:58.194Z","dependency_job_id":null,"html_url":"https://github.com/LaunchPadLab/launchpad_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Flaunchpad_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Flaunchpad_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Flaunchpad_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Flaunchpad_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LaunchPadLab","download_url":"https://codeload.github.com/LaunchPadLab/launchpad_api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103911,"owners_count":21048245,"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","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":[],"created_at":"2024-11-05T20:07:46.029Z","updated_at":"2025-04-09T19:55:35.606Z","avatar_url":"https://github.com/LaunchPadLab.png","language":"Ruby","readme":"The [LaunchPad](https://elements.heroku.com/addons/launchpad) add-on allows Salesforce customers to build and launch integrated web and mobile applications 2x faster. The add-on is used in conjunction with Heroku Connect, which means that a Salesforce customer can generate a REST API based on their existing Salesforce schema, greatly accelerating the process of building a Salesforce-integrated web or mobile solution.\n\nUnlike traditional add-ons, this add-on is only useful when attached to the [LaunchPad API](github.com/launchpadlab/launchpad_api) application that is generated from the [Deploy to Heroku](#1-deploy-launchpad-api-to-heroku) button. The add-on itself simply provides a license key. Without a license key, the installation process will not succeed.\n\n**Key Features:**\n\n- [Ruby on Rails REST API](#ruby-on-rails)\n- [Active Record ORM](#active-record-orm)\n- [Postgres Database](#postgres)\n- [Salesforce Integration](#salesforce-integration)\n- [Security](#security)\n- [Authorization](#authorization)\n- [Authentication](#authentication)\n- [API Documentation](#api-documentation)\n- [Pagination](#pagination)\n- [Serialization](#serialization)\n- [Params Sanitization and Transformation](#params-sanitization-and-transformation)\n\n## Provisioning the add-on\nUnlike other Heroku add-ons that can be attached to an existing Heroku app, the LaunchPad add-on must be attached to the [LaunchPad API](github.com/launchpadlab/launchpad_api). Because of this, the first step is to deploy the LaunchPad API application to Heroku using the Deploy to Heroku button found below.\n\n1. [Deploy LaunchPad API to Heroku](#1-deploy-launchpad-api-to-heroku)\n2. [Configure Heroku Connect](#2-configure-heroku-connect)\n3. [Set up API locally](#3-set-up-api-locally)\n4. [Deploy the API](#4-deploy-the-api)\n\n### 1. Deploy LaunchPad API to Heroku\n\u003ca href=\"https://heroku.com/deploy?template=https://github.com/launchpadlab/launchpad_api\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://www.herokucdn.com/deploy/button.svg\" alt=\"Deploy\"\u003e\n\u003c/a\u003e\n\n### 2. Configure Heroku Connect\n\n\u003enote\n\u003e We highly recommend using a Sandbox Salesforce environment until you are comfortable with how the add-on is performing. Once testing is complete, you can generate a second Heroku app using the Deploy to Heroku button and link that app to your Production Salesforce environment in Heroku Connect.\n\n1. Click **`Manage App`** to go to your app's Heroku dashboard\n2. Click **`Resources`** then \"Heroku Connect\"\n3. Click **`Setup Connection`** then **`Next`**\n4. Authorize your Salesforce account.\n5. Click **`Mappings`** then **`Create Mapping`** (you'll do this for each object you want to sync)\n6. Select the object you want to sync (e.g. \"Account\")\n7. Select **`Accelerate Polling`** for optimal performance\n8. Pick the columns you'd like to sync\n9. Click **`Save`**\n\n### 3. Set up API locally\n\n\u003enote\n\u003e The API is a Ruby on Rails application that requires Ruby to be installed on your machine. Please make sure Ruby v2.5.1 is installed before proceeding.\n\nIn the below commands, replace `APPNAME` with the name of the Heroku app you just deployed:\n\n```term\n$ git clone git@github.com:LaunchPadLab/launchpad_api.git APPNAME\n$ cd APPNAME\n$ bundle install\n$ heroku git:remote -a APPNAME\n$ heroku addons:create launchpad:test\n$ bundle exec rake launchpad:pull\n$ bundle exec rake launchpad:install\n```\n\nFollow the terminal instructions to select the objects you'd like to add to the API. Once that completes, start your server:\n\n\n```\n$ rails s\n```\n\nTo access the Admin Panel:\n\n```\n$ open localhost:3000\n```\n\n\u003enote\n\u003e By default, your email and password for the admin panel is set to `admin@example.com` and `password`, respectively. We'll show you how to change these to something more secure in the next step.\n\nTo visit the API documentation:\n\n```\n$ open localhost:3000/api/docs\n```\n\n### 4. Deploy the API\n\nBefore deploying to Heroku, we highly recommend that you modify the following environment variables in Heroku: `ADMIN_EMAIL` and `ADMIN_PASSWORD`. To do so, execute the following commands after modifying the email and password:\n\n```\n$ heroku config:set ADMIN_EMAIL=admin@example.com\n$ heroku config:set ADMIN_PASSWORD=password\n```\n\nNow you're ready to deploy. Please enter these commands:\n\n```term\ngit add -A\ncommit -m \"first commit\"\ngit push heroku master\nheroku open /api/docs\n```\n\nEnter the following credentials:\n\n```\nusername: launchpad\npassword: \u003cyour LaunchPad License Key found in config/application.yml\u003e\n```\n\n## Using the add-on\n\n- [Ruby on Rails](#ruby-on-rails)\n- [Active Record ORM](#active-record-orm)\n- [Postgres Database](#postgres)\n- [Salesforce Integration](#salesforce-integration)\n- [Security](#security)\n- [Authorization](#authorization)\n- [Authentication](#authentication)\n- [API Documentation](#api-documentation)\n- [Pagination](#pagination)\n- [Serialization](#serialization)\n- [Params Sanitization and Transformation](#params-sanitization-and-transformation)\n\n### Ruby on Rails\nThe LaunchPad API leverages [Ruby on Rails](https://rubyonrails.org/) as the underlying application framework. If you are unsure whether Ruby on Rails is a fit for your project, we highly recommend that you read the [Rails Doctrine](https://rubyonrails.org/doctrine/) to determine if the framework aligns philosophically with your development team. \n\n### Active Record ORM\nEach object generated in the LaunchPad API will have a corresponding Active Record [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping) object which can be found in `app/models/`. \n\nTo learn more about Active Record, please read the [Active Record Basics Guide](https://guides.rubyonrails.org/active_record_basics.html). As described in this guide, Active Record provides the following key mechanisms:\n\n- Represent models and their data.\n- Represent associations between these models.\n- Represent inheritance hierarchies through related models.\n- Validate models before they get persisted to the database.\n- Perform database operations in an object-oriented fashion.\n\n### Postgres\nBy default the LaunchPad API connects directly to your Heroku Postgres database in development mode. You can change this by modifying the `config/database.yml` file or simply changing the `DATABASE_URL` environment variable for a given environment. You can read more about configuring databases [here](https://edgeguides.rubyonrails.org/configuring.html#configuring-a-database) and managing environment variables [here](https://github.com/laserlemon/figaro).\n\n### Salesforce integration\nThe LaunchPad API depends on Heroku Connect for the Salesforce Integration. Each ORM object inherits from `app/models/salesforce_model.rb` to provide one place to manage the integration with Salesforce.\n\n### Security\nRuby on Rails comes with excellent security. We highly recommend you read [this article](https://guides.rubyonrails.org/security.html) to learn more about security in Ruby on Rails.\n\n### Authorization\nThe LaunchPad API comes installed with the popular [CanCanCan Authorization Gem](https://github.com/CanCanCommunity/cancancan). Authorization of objects and their RESTful actions is built into the API by default. To customize authorization behavior, you can simply modify the `app/models/ability.rb` file.\n\nFor example, to prevent users from creating a new `Account`, you could add the following line at the bottom of the `initialize` method.\n\n```ruby\n  cannot :create, Account\n```\n\nTo learn more about configuring Authorization for your application, see the [CanCanCan Wiki](https://github.com/CanCanCommunity/cancancan/wiki).\n\n### Authentication\nThe LaunchPad API leverages [Basic Auth](https://tools.ietf.org/html/rfc7617) for authenticating incoming API requests and web traffic to the API documentation. By default, the username is `launchpad` and the password is your LaunchPad License Key.\n\nAPI requests should be sent with the following header:\n\n```\nKey: Authorization\nValue: Bearer \u003cyour Basic Auth token\u003e\n```\n\nTo get your Basic Auth token, run the following commands:\n\n```term\n$ rails c\n$ Base64.strict_encode64(\"launchpad:#{ENV['LAUNCHPAD_LICENSE_KEY']}\")\n```\n\n### API documentation\nThe API documentation is generated using [RSpec API Doc Generator](https://github.com/zipmark/rspec_api_documentation). You can customize your API Documentation in `spec/acceptance/api/`. Please [read here](https://github.com/zipmark/rspec_api_documentation) to learn more about creating and modifying your API Documentation.\n\n### Pagination\nThe LaunchPad API leverages [Kaminari](https://github.com/kaminari/kaminari) in conjunction with the [API Pagination gem](https://github.com/davidcelis/api-pagination) to provide pagination within your API. This approach follows the proposed [RFC-8288](https://tools.ietf.org/html/rfc8288) standard for Web linking by using headers for pagination instead of the response body.\n\n### Serialization\nSerialization allows the LaunchPad API to define the JSON that is returned for each object in the API. For example, you may only want to respond with certain attributes or adjust how attributes are formatted in the response.\n\nThe LaunchPad API leverages the popular [Active Model Serializers](https://github.com/rails-api/active_model_serializers) for providing this serialization behavior. You can customize this behavior in `app/serializers/`.\n\n\n### Params sanitization and transformation\nOne of the core responsibilities for every REST API is to handle incoming data in a secure and reliable way. There are two core aspects to accomplishing this:\n\n1. Remove all incoming data that is not explicitly whitelisted by the application\n2. Transform incoming data to the format that your database expects.\n\nThe LaunchPad API handles this requirement by leveraging the [Decanter gem](https://github.com/LaunchPadLab/decanter). Every object generated by the API will have a corresponding Decanter object that can be customized in `app/decanters/`.\n\n\n## Removing the add-on\n\nYou can remove launchpad via the CLI:\n\n\u003e warning\n\u003e This will destroy all associated data and cannot be undone!\n\n```term\n$ heroku addons:destroy launchpad:test\n```\n\n## Support\n\nAll launchpad support and runtime issues should be submitted via one of the [Heroku Support channels](support-channels).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchpadlab%2Flaunchpad_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaunchpadlab%2Flaunchpad_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchpadlab%2Flaunchpad_api/lists"}