2020-06-11 21:28:46 +00:00
[![ ](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg )](https://houdini.zulipchat.com)
![Houdini build ](https://github.com/houdiniproject/houdini/workflows/Houdini%20build/badge.svg )
2018-03-25 17:30:42 +00:00
2020-06-03 16:35:39 +00:00
* NOTE: This is the latest version (pre-2.0) of Houdini and
is currently in HEAVY development. You may want
to use
[v1 ](https://github.com/houdiniproject/houdini/tree/1-0-stable )
instead.
2018-03-25 17:30:42 +00:00
The Houdini Project is free and open source fundraising infrastructure. It includes...
- Crowdfunding campaigns
- Donate widget page and generator
- Fundraising events
- Nonprofit Profiles
- Nonprofit payment history and payouts dashboard
- Nonprofit recurring donation management dashboard
- Nonprofit metrics overview / business intelligence dashboard
- Nonprofit supporter relationship management dashboard (CRM)
- Nonprofit org user account management
- Simple donation management for donors
The frontend is written in a few custom frameworks, the largest of which is called Flimflam.
We endeavor to migrate to React as quickly as possible to increase development
comfort and speed.
2020-06-03 16:35:39 +00:00
All new backend code and React components well tested.
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
## Prerequisites
Houdini is designed and tested to run with the following:
* Ruby 2.6
* Node 12
* Yarn
2020-06-10 21:51:58 +00:00
* PostgreSQL 10 or 11
* Ubuntu 18.04, 20.04 or equivalent
2020-06-09 21:55:59 +00:00
2018-03-25 17:30:42 +00:00
## Get involved
2018-03-25 18:00:16 +00:00
Houdini's success depends on you!
2018-03-25 17:30:42 +00:00
2018-03-25 18:00:16 +00:00
### Join our Zulip chat
https://houdini.zulipchat.com
### Help with translations
Visit the Internationalization channel on Houdini Zulip and discuss
2020-06-01 19:14:04 +00:00
2018-03-25 17:30:42 +00:00
## Dev Setup
2020-06-01 19:14:04 +00:00
#### Tips for specific circumstances
* Docker: Docker was previously used for development of Houdini.
See [docker.md ](docs/docker.md ) for more info.
* Mac: Mac dev setup may require some unique configuration.
See [mac_getting_started.md ](docs/mac_getting_started.md ) for more info.
### Installation prep
Houdini requires a few pieces of software be installed, as well as some optional pieces
which make development much easier.
These include:
2020-06-10 21:51:58 +00:00
* PostgreSQL 10 or 11
2020-06-01 19:14:04 +00:00
* NodeJS 12 LTS
2020-06-03 16:35:39 +00:00
* Ruby 2.6.6 (NOTE: the default of Ruby 2.7.1 in Debian should
function but you will receive a ton of deprecation
warnings from Ruby)
There a few optional tools which make working on Houdini
easiter
* Ruby Version Manager (RVM) - RVM makes it simple to switch
between versions of Ruby for different projects. Additionally, you can
use different "gemsets" per version so you can separate the
state of a set of different projects. It will also switch
versions at the console when you change to a directory for
an project prepared for RVM, like Houdini.
* Automatic Version Switching for Node (AVN) - similar to RVM, AVN makes it simple to switch between versions of Node. When
properly configured, it automatically switches version at
the console whe you change to a directory for a project
prepared for AVN, like Houdini.
2020-06-01 19:14:04 +00:00
#### One-time setup
2020-06-10 21:51:58 +00:00
You'll want to run the next commands as root or via sudo (for Ubuntu 18.04 users or anyone running ProgresSQL 10, change "postgresql-11" below to "postgresql-10"). You could do this by typing `sudo /bin/sh` running the commands from there.
2020-06-09 21:55:59 +00:00
2020-06-01 19:14:04 +00:00
```bash
apt update
apt install curl -yy
curl -sL https://deb.nodesource.com/setup_12.x | bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt update
2020-06-03 16:35:39 +00:00
apt install git postgresql-11 libpq-dev libjemalloc-dev libvips42 yarn -yy
2020-06-01 19:14:04 +00:00
```
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
You'll run the next commands as your normal user.
2020-04-30 21:18:44 +00:00
2020-06-01 19:14:04 +00:00
NOTE: in the case of a production instance, this might be
your web server's user.
2020-04-30 21:18:44 +00:00
2020-06-01 19:14:04 +00:00
NOTE 2: We use [RVM ](https://rvm.io ) to have more control over the exact version of Ruby. For development, it's also way easier because you can
use a consistent version of Ruby (and different sets of installed gems) for different projects. You could also use rbenv
or simply build ruby from source.
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
NOTE 3: We don't recommend using Ruby 2.7, the current Ubuntu default at this time. Ruby 2.7 will function but spits out tons
of deprecation warnings when using Rails applications.
2019-07-23 18:38:02 +00:00
2020-06-03 16:35:39 +00:00
NOTE 4: We recommend building Ruby with jemalloc support as we
do in these instructions. In practice, it manages memory far
more efficiently in Rails-based projects.
2020-06-01 19:14:04 +00:00
TIP: To get out of the root shell, run `exit`
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
```bash
# add rvm keys
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
curl -sSL https://get.rvm.io | bash -s stable
source $HOME/.rvm/scripts/rvm
echo 'source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
rvm install 2.6.6 --disable-binary --with-jemalloc
```
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
Run the following command as the `postgres` user and then enter your houdini_user
password at the prompt.
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
NOTE: For development, Houdini expects the password to be 'password'. This would be terrible
for production but for development, it's likely not a huge issue.
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
TIP: To run this, add `sudo -u postgres ` to the beginning of the following command.
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
`createuser houdini_user -s -d -P`
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
Now that we have all of our prerequisites prepared, we need to get the Houdini code.
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
`git clone https://github.com/HoudiniProject/houdini`
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
This will download the latest Houdini code. Change to the
`houdini` directory and we can set the rest of Houdini up.
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
Let's run the Houdini project setup and we'll be ready to go!
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
```bash
bin/setup
```
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
NOTE: The .env file holds your environment variables for development; on production you might
have these set somewhere else other than this file.
2018-03-25 17:30:42 +00:00
2020-06-01 19:14:04 +00:00
TIP: On Heroku, the environment variables are set in your Dashboard.
2018-03-25 17:30:42 +00:00
2020-06-03 16:35:39 +00:00
Also, you should set the STRIPE_API_KEY and STRIPE_API_PUBLIC
environment variables which you'd get from the Stripe
dashboard. On your development environment,
make sure to use test keys. If you don't, you're
2020-06-01 19:14:04 +00:00
going to be charged real money!
2018-03-25 17:30:42 +00:00
2020-06-10 21:51:58 +00:00
#### Testing
To verify everying is set up correctly, you can try running through the test cases:
```bash
./bin/rails spec
```
You should expect to see the output of the test execution,
including messages about pending test cases, and
eventually get the output to the effect of below:
```
Finished in 6 minutes 25 seconds (files took 10.35 seconds to load)
2433 examples, 0 failures, 42 pending
Coverage report generated for RSpec to .../houdini/coverage. 10552 / 12716 LOC (82.98%) covered.
```
The important thing to look for is that the number of
failures is zero.
2020-06-01 19:14:04 +00:00
#### Startup
`bin/rails server`
You can connect to your server at http://localhost:5000
2018-03-25 17:30:42 +00:00
##### Super admin
There is a way to set your user as a super_admin. This role lets you access any of the nonprofits
on your Houdini instance. Additionally, it gives you access to the super admin control panel to search all supporters and
nonprofits, which is located at `/admin` url.
To create the super user, go to the rails console by calling:
2020-06-03 16:35:39 +00:00
`bin/rails console`
2018-03-25 17:30:42 +00:00
In the console, run the following:
```
admin=User.find(1) #or the id of the user you want to add the role
role=Role.create(user:admin,name: "super_admin")
```
2019-08-07 08:40:51 +00:00
## Known Issues
For a list of [how to solve known issues ](docs/KNOWN_ISSUES.MD )
2018-03-25 17:30:42 +00:00
2020-06-03 16:35:39 +00:00
## Run in production
You will likely want to make a few changes in your configuration of Houdini before running in production as you
would for any Rails project. These include:
2018-03-25 17:30:42 +00:00
2020-06-03 16:35:39 +00:00
* Using a [different ActiveJob backend ](https://guides.rubyonrails.org/active_job_basics.html ). NOTE: The Sneakers for RabbitMQ doesn't
work properly. There are
[forks of Sneakers ](https://github.com/veeqo/advanced-sneakers-activejob )
which might work but they haven't been tested. **If you do test
them please let us know!**
* Use a [proper cache store ](https://guides.rubyonrails.org/caching_with_rails.html#cache-stores ). The development uses
`memory_store` which isn't shared between processes or server
and clears every time your server software restarts. Memcached
or Redis are good choices here.
2018-03-29 19:10:27 +00:00
2018-05-31 18:14:46 +00:00
### Providing the complete corresponding source code
**Note: This is not legal advice and provides a suggestion which may be compliant. You should talk with your legal counsel if you have
questions or concerns with how to comply with the various licenses of Houdini**
2019-02-14 19:53:46 +00:00
Providing the complete, corresponding source code (CCS) of your project is a requirement of some of the licenses used by Houdini. There are two methods for doing so right now:
2018-05-31 18:14:46 +00:00
1. Providing a tarball of the current running code
2. Providing a link to Github where the code is pulled from
2018-06-07 16:06:25 +00:00
The easiest method is to provide a tarball. Houdini automatically provides a link on the Terms & Privacy page which generates a tarball for the current running code at runtime.
2018-05-31 18:14:46 +00:00
For this to work though, the following characteristics must be true:
2018-06-07 16:06:25 +00:00
* Your have to have committed any changes you made to the project in `HEAD` in your git repository
2018-05-31 18:14:46 +00:00
* The `.git` folder for your repository must be a direct subfolder of your `$RAILS_ROOT`
2020-06-03 16:35:39 +00:00
* Your web server must be able to run `git archive` .