-
-
Notifications
You must be signed in to change notification settings - Fork 76
Setup Instructions
Notebook.ai is a complex platform that's built to be somewhat modular, allowing you to set up just the features you want to use. For these setup instructions, I'll break down the setup into two separate paths:
- Minimal setup (no third-party integrations, just Notebook.ai running locally)
- Full setup (all integrations and configuration, to match https://www.notebook.ai)
-
Make sure you have Ruby installed. Make sure your Ruby version matches the version specified in
.ruby-version
.Tip: Using a Ruby version manager like RVM makes it easy to install, manage, and flip between specific Ruby versions.
-
Install the necessary native libraries for your system. These are the libraries I use on Ubuntu; you may use a different package manager or have different package names on other systems.
sudo apt install imagemagick libmagickwand-dev libpq-dev
- Clone the
notebook
repo and thencd
into it.
git clone [email protected]:indentlabs/notebook.git
cd notebook
- Install the gems. This will also install Rails.
bundle install
-
[Placeholder for manually installing/configuring Postgres once we've switched from SQLite in dev environments]
-
Create and prepare your database
rake db:create
rake db:migrate
rake billing_plans:initialize_defaults
rake data_migrations:create_default_billing_plans
rake db:seed
- You can now run the server with the following command:
bundle exec rails server
All of the above, plus...
- To enable background jobs (saving document revisions, linking content together, etc), you'll want to install and make sure you're running sidekiq. This will process all queues by default. You can also see a list of all queues in
config/sidekiq.yml
and run specific ones with the-q <queue_name>
flag.
bundle exec sidekiq -C config/sidekiq.yml
-
To enable document analysis, you'll need an IBM Watson account with billing set up. Add your IBM API key to the environment variable
WATSON_API_KEY
. Billing will scale based on the number of document words analyzed. You will also need sidekiq running for analysis jobs to process. -
To enable image uploads, you'll need an AWS account with S3 set up and configured for read/write access to a bucket. Provide your credentials via the following environment variables:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: your-access-key-id-here
AWS_SECRET_ACCESS_KEY: your-secret-access-key-here
S3_BUCKET_NAME: your-bucket-name-here
You can specify alternative storage providers in config/storage.yml
, but they may need some extra configuration to work as expected.
-
To enable (redis), set up an accessible redis instance and set the
REDIS_URL
environment variable to its connection string. -
To enable email sending (password resets, collaboration invites, etc), you'll want to set up a billable SendGrid account and provide authentication information through the following environment variables:
SENDGRID_DOMAIN: your-sendgrid-domain
SENDGRID_USERNAME: your-sendgrid-username
SENDGRID_PASSWORD: your-sendgrid-password
You'll need to specify your authorized SendGrid senders in config/initializers/devise.rb
(for password resets) and each of the mailers in app/mailers
(for functional emails).
- To enable Paypal payments, you'll want to provide your Paypal API credentials in the following environment variables:
PAYPAL_CLIENT_ID: your-paypal-client-id
PAYPAL_SECRET: your-paypal-secret-key
- To enable Stripe payments, you'll want to provide your live Stripe API credentials in the following environment variables:
STRIPE_API_KEY: your-stripe-secret-key
STRIPE_PUBLISHABLE_KEY: your-stripe-public-key
-
To enable New Relic & error reporting, provide your license key in the
NEW_RELIC_LICENSE_KEY
environment variable. You can optionally specify a log destination (such asstdout
) in the environment variableNEW_RELIC_LOG
. -
To enable database snapshots, recovery, and fallback,
-
To enable Slack integration,
-
To scale, I use the following architecture (set as ENV variables):
WEB_CONCURRENCY=2
RAILS_MAX_THREADS=16
MALLOC_ARENA_MAX=2
DB_POOL=25
RUBY_GC_HEAP_GROWTH_FACTOR=1.03