{"id":13416427,"url":"https://github.com/thredded/thredded_create_app","last_synced_at":"2025-05-01T18:31:25.803Z","repository":{"id":12458919,"uuid":"71875154","full_name":"thredded/thredded_create_app","owner":"thredded","description":"Creates a Thredded Rails app","archived":false,"fork":false,"pushed_at":"2022-06-05T14:54:33.000Z","size":224,"stargazers_count":13,"open_issues_count":4,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-14T08:55:13.938Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thredded.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-25T08:20:25.000Z","updated_at":"2022-06-05T14:45:29.000Z","dependencies_parsed_at":"2022-08-26T10:30:35.028Z","dependency_job_id":null,"html_url":"https://github.com/thredded/thredded_create_app","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thredded%2Fthredded_create_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thredded%2Fthredded_create_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thredded%2Fthredded_create_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thredded%2Fthredded_create_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thredded","download_url":"https://codeload.github.com/thredded/thredded_create_app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251924745,"owners_count":21666033,"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-07-30T21:00:58.663Z","updated_at":"2025-05-01T18:31:25.436Z","avatar_url":"https://github.com/thredded.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# ThreddedCreateApp [![Build Status](https://travis-ci.org/thredded/thredded_create_app.svg?branch=master)](https://travis-ci.org/thredded/thredded_create_app) [![Test Coverage](https://codeclimate.com/github/thredded/thredded_create_app/badges/coverage.svg)](https://codeclimate.com/github/thredded/thredded_create_app/coverage)\n\nGenerates a Rails app with the [Thredded](https://github.com/thredded/thredded) forums engine installed.\n\nSee below for more information on the generated app.\n\nExample screenshots of the generated app:\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg alt=\"Home\" src=\"https://cloud.githubusercontent.com/assets/216339/19858280/23072dd8-9f3e-11e6-8d71-e977a4a67f0f.png\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg alt=\"Sign Up\" src=\"https://cloud.githubusercontent.com/assets/216339/19858282/231bb06e-9f3e-11e6-8e51-a293523b7034.png\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg alt=\"Messageboard\" src=\"https://cloud.githubusercontent.com/assets/216339/19858469/c592413c-9f3e-11e6-827d-b530f3ee2850.png\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg alt=\"Topic\" src=\"https://cloud.githubusercontent.com/assets/216339/19858284/232107e4-9f3e-11e6-8c5f-8a8f927f2922.png\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Pre-requisites\n\n1. Git.\n2. A supported database: PostgreSQL (recommended), MySQL v5.7+, or SQLite.\n3. Ruby 2.3+.\n\nYou may also need some packages to compile Thredded dependencies.\nOn Ubuntu, you can install all the required packages by running:\n\n```bash\nsudo apt-get install autoconf automake bison build-essential gawk git \\\n  libffi-dev libgdbm-dev libgmp-dev libncurses5-dev libpq-dev libreadline6-dev \\\n  libsqlite3-dev libtool libyaml-dev nodejs pkg-config ruby sqlite3\n```\n\n## Usage\n\nInstall the gem and create your app:\n\n```bash\ngem install thredded_create_app\n```\n\n#### Installing the gem using system Ruby\n\nWhen using the *system* Ruby on Mac or Linux (as opposed to RVM or rbenv),\nthe command above will fail because only root can install gems system-wide.\n\nInstead, install `thredded_create_app` with the `--user` flag:\n\n```bash\ngem install --user thredded_create_app\n```\n\nThe above will install the gem to the `~/.gem/` directory.\n\nThen, [add the user gems `bin` directory to `PATH`](http://guides.rubygems.org/faqs/#user-install).\n\n### Create your app\n\n```\nthredded_create_app myapp\n```\n\nBy default, PostgreSQL will be used as the database.\nAlternatively, you can pass `--database sqlite3` for SQLite,\nor `--datase mysql2` for MySQL.\n\nRun `thredded_create_app --help` for more information about the available\noptions.\n\n### App generation\n\nThe app generator will do the steps below for you.\n\nFirst, the rubygems package is updated and the latest versions of\n[Rails] and [Bundler] are installed.\n\nThen, a Rails app is generated for use with the selected database.\n\nThen, a [git] repository is initialized in the app directory. From here onwards,\nthe app generator will commit the changes at each step.\n\n[RSpec] is used as the testing framework, and some basic acceptance tests\nusing [capybara] are added.\n\n[Devise] is used as the authentication framework. Its default views are\ncustomized to add a user name field (`display_name`) to the registration form.\nThe [simple_form] gem is used for the customized Devise views by default.\n\nA basic responsive app layout with top bar navigation is added.\nA user profile page that displays some basic information about the user and\ntheir recent forum posts is also added.\n\nThe app comes with basic styles (~10KiB gzipped, including Thredded styles)\nthat are written using [Sass].\n\nThe app's JavaScript code is loaded asynchronously in production mode via the\n[`async`] attribute on the script tag. In development, the individual script\nfiles are not concatenated. With `async` they would load out-of-order, so\n[`defer`] is used instead.\n\n**NB:** While loading scripts via `async` provides the best possible speed,\na lot of JavaScript libraries do not support it.\n**If** you plan on adding JavaScript code, you might want to\n**remove the `async` attribute** from the `javascript_include_tag` in\n`app/views/layouts/application.html.erb`.\n\nA [Dockerfile] and [docker-compose.yml] is generated for development.\nThis is so that other engineers can spin up a development environment with\na single command (`docker-compose up`).\n\nA production configuration file for the [puma] Ruby web server is created.\nA `Procfile` process description file is also created. This file can be used by\nthe [Heroku] hosting platform or the [foreman] app runner.\n\nLastly, the `$APP` database user is created and given rights to the app's\ndevelopment and test databases. Then, the database is created, the migrations\nare run, and the database is seeded with an admin user and a messageboard.\n\nFinally, the tests are run, and the development web server is started at\n\u003chttp://localhost:3000\u003e. To start the server yourself afterwards with:\n\n```bash\nbin/rails s\n```\n\n[`async`]: https://developer.mozilla.org/en/docs/Web/HTML/Element/script\n[`defer`]: https://developer.mozilla.org/en/docs/Web/HTML/Element/script\n[Bundler]: http://bundler.io/\n[capybara]: https://github.com/jnicklas/capybara\n[Devise]: https://github.com/plataformatec/devise\n[docker-compose.yml]: https://docs.docker.com/compose/\n[Dockerfile]: https://docs.docker.com/engine/reference/builder/\n[foreman]: https://ddollar.github.io/foreman/\n[git]: https://git-scm.com/\n[Heroku]: https://www.heroku.com/\n[puma]: https://github.com/puma/puma\n[Rails]: http://rubyonrails.org/\n[RSpec]: http://rspec.info/\n[Sass]: http://sass-lang.com/\n[simple_form]: https://github.com/plataformatec/simple_form\n\n### Next steps\n\nTo learn about customizing the forums, see the [Thredded Readme].\n\nTo learn about customizing the authentication system, e.g. to require email\nconfirmation or to add an OAuth login, see the [Devise Readme].\n\nTo change the homepage, edit the view file at `app/views/home/show.html.erb`.\n\nTo change the app's styles, see the files in `app/assets/stylesheets`.\nThe app is generated with a randomly selected primary theme color that you may\nwant to change. You can find it in `app/assets/stylesheets/_variables.scss`.\n\nYou can contact the Thredded team via the [Thredded chat room].\nOnce you've deployed your app, please let us know that you are using Thredded\nby tweeting [@thredded]!\n\n[@thredded]: https://twitter.com/thredded\n[Devise Readme]: https://github.com/plataformatec/devise/blob/master/README.md\n[Thredded chat room]: https://gitter.im/thredded/thredded\n[Thredded Readme]: https://github.com/thredded/thredded/blob/master/README.md\n\n## Deploying to Heroku\n\nTo deploy your app to Heroku, run:\n\n```bash\ngem install heroku # --user if using system ruby\n# Create a heroku app and set the necessary environment variables\nheroku create\nheroku config:set RACK_ENV=production RAILS_ENV=production \\\n  SECRET_KEY_BASE=\"$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)\"\n# Deploy to heroku\ngit push heroku master\n# Set up the database and some seed data (an admin user and a messageboard)\nheroku run rake db:migrate db:seed\n# Open the website in your default browser\nheroku open\n```\n\nYou can log in as the admin user with email `admin@\u003capp name\u003e.com`, password\n`123456`.\n\n### E-mails\n\nThe app is now deployed, but you'll also need to set up emailing.\n\nThe easiest way to do this is via the Mailgun Heroku add-on.\n\n1. Set the `APP_HOST` environment variable on Heroku so that the app knows its\n   domain.\n\n   ```bash\n   heroku config:set APP_HOST='e.g. myapp.herokuapp.com'\n   ```\n\n2. Enable the Mailgun add-on:\n\n   ```bash\n   heroku addons:create mailgun:starter # Enable Mailgun with the free plan\n   ```\n\n3. Copy the following snippet into `config/environments/production.rb`:\n\n   ```ruby\n   config.action_mailer.perform_deliveries = true\n   config.action_mailer.raise_delivery_errors = true\n   config.action_mailer.delivery_method = :smtp\n   config.action_mailer.smtp_settings = {\n       domain: Settings.hostname,\n       port: ENV['MAILGUN_SMTP_PORT'],\n       address: ENV['MAILGUN_SMTP_SERVER'],\n       user_name: ENV['MAILGUN_SMTP_LOGIN'],\n       password: ENV['MAILGUN_SMTP_PASSWORD'],\n       authentication: :plain,\n   }\n   ```\n\n   Set the `domain` in the snippet above to your domain.\n\n4. Commit and push to Heroku.\n\nBy default, emails are send from `no-reply@`. You can configure this in\n`config/settings.yml`.\n\n### Performance\n\nYou may also want to set the Ruby GC variables for maximum performance.\nYou can either do so by profiling the app with the\n[TuneMyGC Heroku add-on](https://elements.heroku.com/addons/tunemygc), or set\nthese values obtained from profiling the Thredded Demo App:\n\n```bash\n# https://tunemygc.com/configs/e2cb38dac2fd4ff9fd9f32036e5e2688\nheroku config:set \\\n  RUBY_GC_HEAP_INIT_SLOTS=308851 \\\n  RUBY_GC_HEAP_FREE_SLOTS=1382037 \\\n  RUBY_GC_HEAP_GROWTH_FACTOR=1.03 \\\n  RUBY_GC_HEAP_GROWTH_MAX_SLOTS=44771 \\\n  RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.2 \\\n  RUBY_GC_MALLOC_LIMIT=29939911 \\\n  RUBY_GC_MALLOC_LIMIT_MAX=53891840 \\\n  RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR=1.32 \\\n  RUBY_GC_OLDMALLOC_LIMIT=24159191 \\\n  RUBY_GC_OLDMALLOC_LIMIT_MAX=43486544 \\\n  RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR=1.2\n```\n\nIn production, an app created with vanilla thredded_create_app will use around\n~220 MiB of RAM per puma worker under load.\n\n## Deploying to a VPS or a bare-metal Ubuntu 16.04 server\n\nSee: https://github.com/thredded/thredded-ansible.\n\n## Development\n\nThe instructions below are for developing and contributing to\nthe Thredded app generator itself, not for using it.\n\nAfter checking out the repo, run `bin/setup` to install dependencies.\nThen, run `rake spec` to run the tests.\nYou can also run `bin/console` for an interactive prompt that will allow you\nto experiment.\n\nTo generate an app with `thredded_create_app` at `tmp/myapp`, run:\n\n```sh\nbundle exec bin/create-tmp-myapp\n```\n\nThis command will clean up the previously generated app before creating\na new one.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\nTo release a new version, update the version number in `version.rb`, and then\nrun `bundle exec rake release`, which will create a git tag for the version,\npush git commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/thredded/thredded_create_app.\nThis project is intended to be a safe, welcoming space for collaboration,\nand contributors are expected to adhere to the\n[Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the\n[MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthredded%2Fthredded_create_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthredded%2Fthredded_create_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthredded%2Fthredded_create_app/lists"}