Skip to content

assembleco/assemble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assemble

We want to make it easy for anyone to create an app – whether you know how to code or not.

Choose from thousands of community-made building blocks, and string them together to create the app you’ve always wanted.

Documentation

Docs and usage information are currently stored in the team's Notion project. When we open the application up for alpha users, we'll release the documentation more publicly.

Development

After you have cloned this repo, run this setup script to set up your machine with the necessary dependencies to run and test this app:

% ./bin/setup

It assumes you have a machine equipped with Ruby, Postgres, etc. If not, set up your machine with this script.

After setting up, you can run the application using Heroku Local:

% heroku local

API documentation

Our application uses GraphQL to define the API. GraphQL has a number of advantages over RESTful JSON endpoints. Notably,

  • Each client request can fetch exactly the data it needs and no more.
  • We get more granular control over what data can be accessed, with a simpler and less redundant API than JSON serializers.
  • Our API is self-documenting, and automatically works with a wide range of tools like GraphiQL.

Once you have the project set up and running in development mode, you can visit the /graphiql route for the interactive API interface.

Testing Assemble on your local machine

In order for Assemble to use your development machine as the server, you'll need to use a tool like ngrok to create a public tunnel to your local application. When you have a public-facing URL, update the APPLICATION_HOST environment variable in .env to point to the public URL.

Configure Assemble on Your Local Development Environment

  1. After cloning the repository, run the setup script

    ./bin/setup

  2. Make sure that postgres, and redis, are both installed and running locally.

  3. Log into your GitHub account and go to your developer application settings.

  4. Under the Developer applications panel - Click on "Register new application" and fill in the details:

    • Application Name: Assemble Development
    • Homepage URL: http://localhost:3000
    • Authorization Callback URL: http://localhost:3000
  5. On the confirmation screen, copy the Client ID and Client Secret to GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET in the .env.local file.

  6. Run foreman start. Foreman will start the web server and the resque background job queue. NOTE: rails server will not load the appropriate environment variables and you'll get a "Missing secret_key_base for 'development' environment" error. Similarly, heroku local and forego start will fail to properly load .env.local.

  7. Open localhost:3000 in a browser.

Setup Ngrok to Allow Webhooks

Ngrok allows Assemble to receive webhooks from GitHub. If you'd like to develop or test a feature involving GitHub sending a pull request notification to your local Assemble server you'll need to have ngrok or something similar set up.

To get started with ngrok, sign up for an ngrok account and configure ngrok locally by installing ngrok and running:

`ngrok authtoken <your-token>`
  1. Launch ngrok on port 3000 (we recommend running ngrok with a custom subdomain for easy and persistent configuration, but this requires a paid ngrok account. You can still run Assemble with a free ngrok account, but it will require keeping the GitHub developer application configuration and your .env.local files up to date if your ngrok subdomain changes).
  • If you're using a custom subdomain:

    ngrok http -subdomain=<your-initials>-assemble 3000

  • If you're using a free ngrok plan:

    ngrok http 3000

  1. Set the HOST variable in your .env.local to your ngrok host, e.g. <your-subdomain>.ngrok.io.

  2. Change ENABLE_HTTPS to 'yes' in the .env.local file.

  3. Log into your GitHub account and go to your developer application settings.

  4. Under the Developer applications panel - Click on "Register new application" and fill in the details:

    • Application Name: Assemble Development
    • Homepage URL: https://<your-subdomain>.ngrok.io
    • Authorization Callback URL: https://<your-subdomain>.ngrok.io
  5. On the confirmation screen, copy the Client ID and Client Secret to GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET in the .env.local file.

  6. Run foreman start. Foreman will start the web server and the resque background job queue. NOTE: rails server will not load the appropriate environment variables and you'll get a "Missing secret_key_base for 'development' environment" error. Similarly, heroku local and forego start will fail to properly load .env.local.

  7. Open https://<your-subdomain>.ngrok.io in a browser.

Guidelines

Use the following guides for getting things done, programming well, and programming in style.

Deploying

If you have previously run the ./bin/setup script, you can deploy to staging and production with:

$ ./bin/deploy staging
$ ./bin/deploy production