Run Servers Locally on OS X - acani/Chats GitHub Wiki
Servers
-
Install Homebrew
-
Install Ruby
brew install ruby gem update --system gem update gem clean
-
Install Foreman
gem install foreman
Database Server
-
Install PostgreSQL
brew install postgresql
-
Start PostgreSQL
In a separate Terminal window, run:
postgres -D /usr/local/var/postgres
Note: Pressing Command-. stops PostgreSQL.
Minimize the window.
-
(Re)initialize the local
acani_chats_development
&acani_chats_test
databasesNote: This causes changes made to any of the
.sql
files to take effect.Warning: This deletes all data stored in both local databases.
Start PostgreSQL. Or, if PostgreSQL is already running, close all client connections to both databases, or just stop and restart PostgreSQL.
To (re)creates the local databases and their extensions, tables, and functions, run:
cd Servers/Database make # resets both databases make development # resets just the development database make test # resets just the test database
Note: running
psql acani_chats_development
connects you to the local development database.
REST Server
-
Set up the server
cd Servers/REST cp .env.example .env bundle install
-
Run the tests
make test
-
Start the server
foreman start
Chat Server
-
Install Node.js
brew install node
-
Set up the chat server
cd Servers/Chats npm install
-
Run the chat server
foreman start
Clients
To configure clients to talk to the local REST server, uncomment any lines in the client code containing the word localhost
and restart.
iPhone
Drag & drop the self-signed SSL certificate file located at Servers/REST/config/ssl/server.crt
onto the running iPhone Simulator window.