Skip to content

Commit

Permalink
Remove global window.$ jQuery definition (#1319)
Browse files Browse the repository at this point in the history
* BT setup

* Add a box partial showing the NP issue

* Update all Bundler dependencies (2024-03-24) (#1378)

* remove duplicate electron import

* remove jquery global definition

---------

Co-authored-by: Adam Pallozzi <[email protected]>
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 29, 2024
1 parent b0334f5 commit c73c9c8
Show file tree
Hide file tree
Showing 20 changed files with 59 additions and 179 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ aliases:
- image: cimg/ruby:3.3.0-browsers
environment:
PGHOST: localhost
PGUSER: untitled_application
PGUSER: np_tester
RAILS_ENV: test
- &postgres_docker_image
- image: cimg/postgres:14.2
environment:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: untitled_application_test
POSTGRES_USER: untitled_application
POSTGRES_DB: np_tester_test
POSTGRES_USER: np_tester
- &wait_for_docker
# We run this because the DB might not be available for a while due to a race condition.
run: dockerize -wait tcp://localhost:5432 -timeout 1m
Expand Down
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .redocly.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
organization: untitled_application
organization: np_tester

extends:
- recommended
Expand Down
30 changes: 0 additions & 30 deletions README.example.md

This file was deleted.

139 changes: 30 additions & 109 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,109 +1,30 @@
# Bullet Train Application Template
If you're new to Bullet Train, start with the [Bullet Train Developer Documentation](https://bullettrain.co/docs) and the [Getting Started](https://bullettrain.co/docs/getting-started) guide. You should also [join the community Discord server](https://discord.gg/bullettrain)!

## Building a New Application with Bullet Train
If you're building a new application with Bullet Train, you don't want to "Fork" the template repository on GitHub. Instead, you should:

1. Clone the template repository:

```
git clone [email protected]:bullet-train-co/bullet_train.git your_new_project_name
```
2. Enter the project directory:
```
cd your_new_project_name
```
3. Run the configuration and setup scripts:
```
bin/configure
bin/setup
```
4. Boot your application:
```
bin/dev
```
5. Visit `http://localhost:3000`.
## Cloud Development with Gitpod
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/bullet-train-co/bullet_train)
Clicking this button will set up a new Bullet Train project for development on [Gitpod](https://gitpod.io).
<br>
<br>
<p align="center">
<strong>Open-source development sponsored by:</strong>
</p>
<p align="center">
<a href="https://www.clickfunnels.com"><img src="https://images.clickfunnel.com/uploads/digital_asset/file/176632/clickfunnels-dark-logo.svg" width="575" /></a>
</p>
<br>
<br>
## Provisioning a Production Environment
You can use this public repository to provision a new application and then push your private application code there later.
### Render
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/bullet-train-co/bullet_train)
Clicking this button will take you to the first step of a process that, when completed, will provision production-grade infrastructure for your Bullet Train application which will cost about **$30/month**.
When you're done deploying to Render, you need to go into "Dashboard" > "web", copy the server URL, and then go into "Env Groups" > "settings" and paste the URL into the value for `BASE_URL`.
### Heroku
[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=http://github.com/bullet-train-co/bullet_train)
Clicking this button will take you to the first step of a process that, when completed, will provision production-grade infrastructure and services for your Bullet Train application which will cost about **$140/month**.
Once that process has completed, be sure to complete the other steps from the [Deploying to Heroku](https://bullettrain.co/docs/heroku) documentation.
## Contribute to Bullet Train
If you're looking contribute to Bullet Train, you should "Fork" this template repository on GitHub, like so:
1. Visit https://github.com/bullet-train-co/bullet_train.
2. Click "Fork" in the top-right corner.
3. Select the account where you want to fork the repository.
4. Click the "Code" button on the new repository and copy the SSH path.
5. Clone your forked repository using the SSH path you copied, like so:
```
git clone [email protected]:your-account/bullet_train.git
cd bullet_train
```
6. Run the setup script:
```
bin/setup
```
7. Start the application:
```
bin/dev
```
> [!NOTE]
> Optional: If you have [ngrok](https://ngrok.com/) installed, uncomment `ngrok: ngrok http 3000` from `Procfile.dev` and run
> `bin/set-ngrok-url` to set `BASE_URL` to a publically accessible domain.
> Run `bin/set-ngrok-url` after restarting `ngrok` to update `BASE_URL` to
> the current public url.
8. Visit http://localhost:3000.
---
This `README.md` file will be replaced with [`README.example.md`](./README.example.md) after running `bin/configure`.
# NP Tester

## Getting Started

1. You must have the following dependencies installed:

- Ruby 3
- See [`.ruby-version`](.ruby-version) for the specific version.
- Node 19
- See [`.nvmrc`](.nvmrc) for the specific version.
- PostgreSQL 14
- Redis 6.2
- [Chrome](https://www.google.com/search?q=chrome) (for headless browser tests)

If you don't have these installed, you can use [rails.new](https://rails.new) to help with the process.

2. Run the `bin/setup` script.
3. Start the application with `bin/dev`.
4. Visit http://localhost:3000.

## Information about Bullet Train
If this is your first time working on a Bullet Train application, be sure to review the [Bullet Train Basic Techniques](https://bullettrain.co/docs/getting-started) and the [Bullet Train Developer Documentation](https://bullettrain.co/docs).

### Render

[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/bullet-train-co/bullet_train)

Clicking this button will take you to the first step of a process that, when completed, will provision production-grade infrastructure for your Bullet Train application which will cost about **$30/month**.

When you're done deploying to Render, you need to go into "Dashboard" > "web", copy the server URL, and then go into "Env Groups" > "settings" and paste the URL into the value for `BASE_URL`.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Untitled Application",
"name": "NP Tester",
"description": "The Ruby on Rails SaaS-in-a-Box",
"repository": "https://github.com/bullet-train-co/bullet_train",
"logo": "https://bullettrain.co/heroku-logo.png",
Expand Down
3 changes: 0 additions & 3 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// includes should be specified at the end of the file, not in this section. This helps avoid merge conflicts in the
// future should the framework defaults change.

import "./support/jquery";
import Rails from "@rails/ujs"
import * as ActiveStorage from "@rails/activestorage"
import "@hotwired/turbo-rails"
Expand All @@ -27,8 +26,6 @@ require("@icon/themify-icons/themify-icons.css")
import { trixEditor } from "@bullet-train/fields"
trixEditor()

import "./electron"

// ✅ YOUR APPLICATION'S INCLUDES
// If you need to customize your application's includes, this is the place to do it. This helps avoid merge
// conflicts in the future when Rails or Bullet Train update their own default includes.
5 changes: 0 additions & 5 deletions app/javascript/electron/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions app/javascript/support/jquery.js

This file was deleted.

4 changes: 3 additions & 1 deletion app/views/account/teams/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

<% p.content_for :body do %>
<%# 🚅 super scaffolding will insert new children above this line. %>


<%= render 'shared/box', title: "Test title" %>
<%= render 'shared/box', title: "Test title" do end %>
<%= render 'account/scaffolding/absolutely_abstract/creative_concepts/index', creative_concepts: @team.scaffolding_absolutely_abstract_creative_concepts, hide_back: true unless scaffolding_things_disabled? %>
<% end %>
<% end %>
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

require_relative "../lib/bullet_train_oauth_scaffolder_support"

module UntitledApplication
module NpTester
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
Expand Down
2 changes: 1 addition & 1 deletion config/cable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test:
production:
adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
channel_prefix: untitled_application_production
channel_prefix: np_tester_production
driver: :ruby
ssl_params:
verify_mode: <%= OpenSSL::SSL::VERIFY_NONE %>
12 changes: 6 additions & 6 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ default: &default

development:
<<: *default
database: untitled_application_development
database: np_tester_development

# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
# the same name as the operating system user that initialized the database.
#username: untitled_application-app
#username: np_tester-app

# The password associated with the postgres role (username).
#password:
Expand Down Expand Up @@ -57,7 +57,7 @@ development:
# Do not set this db to the same as development or production.
test:
<<: *default
database: untitled_application_test
database: np_tester_test

# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
Expand All @@ -80,7 +80,7 @@ test:
#
production:
<<: *default
database: untitled_application_production
username: untitled_application
password: <%= ENV['UNTITLED_APPLICATION_DATABASE_PASSWORD'] %>
database: np_tester_production
username: np_tester
password: <%= ENV['NP_TESTER_DATABASE_PASSWORD'] %>
url: <%= ENV['DATABASE_URL'] %>
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

# Use a real queuing backend for Active Job (and separate queues per environment).
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "untitled_application_production"
# config.active_job.queue_name_prefix = "np_tester_production"

config.action_mailer.perform_caching = false

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file.

Rails.application.config.session_store :cookie_store, key: "_untitled_application_session"
Rails.application.config.session_store :cookie_store, key: "_np_tester_session"
6 changes: 3 additions & 3 deletions config/locales/en/application.en.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
en:
application:
name: Untitled Application
name: NP Tester
owner: Unidentified Developer
description: "You can update this description in `config/locales/en/application.en.yml`."
keywords: untitled application seo keywords
keywords: np tester seo keywords
support_email: change.me@localhost
key: untitled_application
key: np_tester
webhooks/outgoing/endpoints:
fields:
api_version:
Expand Down
10 changes: 5 additions & 5 deletions config/locales/en/user_mailer.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ en:
signature: &SIGNATURE
html:
<p>If you have any questions, please don't hesitate to <a href="mailto:%{support_email}">send us an email</a>.</p>
<p>Thanks,<br>The Untitled Application Team</p>
<p>Thanks,<br>The NP Tester Team</p>
invited:
subject: Invitation to join %{team_name} on Untitled Application!
subject: Invitation to join %{team_name} on NP Tester!
preview: '%{inviter_name} has sent you this invitation.'
heading: You're invited!
body:
html:
<p>
%{inviter_name} has invited you to join %{team_name} on Untitled Application.
%{inviter_name} has invited you to join %{team_name} on NP Tester.
You can join %{team_name} by clicking the button below.
</p>
cta:
label: Join %{team_name}
signature:
<<: *SIGNATURE
welcome:
subject: Welcome to Untitled Application!
subject: Welcome to NP Tester!
preview: This email contains details on how to get started using your account.
heading: Welcome to Untitled Application!
heading: Welcome to NP Tester!
body:
html:
<p>This is the default welcome email! The content of this welcome email can be updated in `config/locales/en/user_mailer.en.yml`.</p>
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"dragula": "^3.7.3",
"esbuild": "^0.20.2",
"glob": "^10.3.10",
"jquery": "^3.7.0",
"jstz": "^2.1.1",
"postcss": "^8.4.38",
"postcss-css-variables": "^0.19.0",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions zapier/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "untitled-application",
"name": "np-tester",
"version": "1.0.0",
"description": "Integrate Zapier with Untitled Application",
"description": "Integrate Zapier with NP Tester",
"main": "index.js",
"scripts": {
"test": "mocha --recursive -t 10000"
Expand Down

0 comments on commit c73c9c8

Please sign in to comment.