Updated documentation

Updated Termfile
1.0
Fernando Blat 13 years ago
parent 71a2c8cca7
commit a9586ace86

@ -2,20 +2,35 @@
## Introduction ##
[CartoDB](https://github.com/Vizzuality/cartodb) is a HTTP wrapper for a PostgreSQL + PostGIS database. It is composed of different components:
[CartoDB](https://github.com/Vizzuality/cartodb) is a HTTP wrapper for a PostgreSQL + PostGIS user dedicated database. Each database / user instance is owned by a user, and is composed of different components:
- PostgreSQL + PostGIS database: a dedicated postgresql database with geospatial functionalities
- User Interface: allows the user to create and manage tables, and their data, import new ones, or export them to files
- Pure SQL API endpoint: JSON API which allow users to run SQL queries and get their response in JSON format
## Architecture ##
_(under development)_
The architecture behind CartoDB is a Central Server + users instances, which are user dedicated Amazon EC2 instances running CartoDB.
### Central server
The purposes of Central Server are:
- manage user accounts: activation, manage payments...
- manage user instances: check the status, monit the services...
- (maybe) CartoDB documentation
## Components ##
### User instances
Every user instance runs in a subdomain of `cartodb.com`, i.e.: `vizzuality.cartodb.com` and is **totally** isolated from other users. These instances run the next three different components.
### PostgreSQL + PostGIS database ###
#### PostgreSQL + PostGIS database ####
Each CartoDB user has his own postgresql database, totally isolated from the other users databases, which extra geospatial functionalities provided by PostGIS. The users can, basically, do what they want in his database, there are no limitations.
### User Interface ###
#### User Interface ####
The UI is a front-end layer on the top of the database which helps the users to create new tables, and to manage the data from those tables. Also, the users can get the OAuth tokens to use the API from the interface.
@ -25,7 +40,7 @@ Also, all the import/export functionality has been externalized to a Ruby gem na
Both, UI and REST API, are implemented using Ruby on Rails.
### Pure SQL API ###
#### Pure SQL API ####
SQL API allows the users to use their databases via HTTP requests and get a response in JSON format.
@ -38,50 +53,36 @@ This component runs in Node.JS.
- Install Ruby 1.9.2
- Install Node.JS and Npm, following these steps: <https://github.com/joyent/node/wiki/Installation>
- Install Node.JS and Npm, following these steps: <https://github.com/joyent/node/wiki/Installation> (alternatively you can use `brew instrall node``, but npm has to be installed following the wiki instructions`)
- Install PostgreSQL, PostGIS, GDAL, and Geo.
- Install Redis from <http://redis.io/download> or using Homebrew.
- Install Redis from <http://redis.io/download> or using `brew install redis`.
- Python dependencies:
- Python dependencies:
- Python setup tools, install from <http://pypi.python.org/pypi/setuptools>
- Python GDAL, install from <http://pypi.python.org/pypi/GDAL/>
- Python Chardet: install from <http://chardet.feedparser.org/download/>
- Python ArgParse: install from <http://code.google.com/p/argparse/>
- Brewery:
$ git clone git://github.com/Stiivi/brewery.git
$ python setup.py install
- Alternatively we can use pip installer to install them all with:
easy_install pip
pip install -r python_requirements.txt
easy_install pip # in MacOs X
pip install -r python_requirements.txt
Note: If compilation fails (it did for gdal module raising a Broken pipe error) try doing "export ARCHFLAGS='-arch i386 -arch x86_64'" first
- Setup new hosts in `/etc/hosts`:
# CartoDB
127.0.0.1 api.localhost.lan developers.localhost.lan localhost.lan
127.0.0.1 testhost.lan api.testhost.lan developers.testhost.lan
127.0.0.1 vizzuality.localhost.lan vizzuality.testhost.lan
# # # # #
The reason to use `vizzuality` as a subdomain is that the user in development and test environment is `vizzuality`
- Clone the [Node SQL API](https://github.com/tokumine/cartodb-sql-api) in your projects folder:
git clone git@github.com:tokumine/cartodb-sql-api.git
git clone git@github.com:Vizzuality/CartoDB-SQL-API.git
- Clone the main repository in your projects folder:
git clone git@github.com:Vizzuality/cartodb.git
- Change to cartdb/ folder and `rvm` will require to create a new gemset. Say **yes**. If not, you must create a gemset for Ruby 1.9.2:
- Change to cartdb/ folder and `rvm` will require to create a new gemset. Say **yes**. If not, you must create a `gemset` for Ruby 1.9.2:
rvm use 1.9.2@cartodb --create
@ -94,7 +95,7 @@ This component runs in Node.JS.
cd /tmp
redis-server
- Run `rake cartodb:db:setup`
- Run `bin/rake cartodb:db:setup` in cartodb folder
### Every day usage ###
@ -102,15 +103,13 @@ This component runs in Node.JS.
- Change to CartoDB directory
- Run `rake db:reset` if you want to reset your data and load the databa from `seeds.rb` file
- Run `bin/rake db:reset` if you want to reset your data and load the database from `seeds.rb` file
- Run a Rails server in port 3000: `rails s`
- In a separate tab run a Rails server in port 3001 for REST API: `rails s -p 3001`
- In a separate tab change to Node SQL API folder and run node.js: `node app.js developement`
- In a separate tab change to Node SQL API folder and run node.js: `node cluster developement`
- Open your browser and go to `http://localhost.lan:3000`
- Open your browser and go to `http://vizzuality.localhost.lan:3000`
- Enjoy

@ -19,14 +19,6 @@ tab "cartodb app server" do
run "rails s"
end
tab "cartodb api server" do
run "echo 'Hello developer, this is cartodb api server'"
run "cd $CARTODB_PATH"
run "echo 'Waiting 30 secs, you can wank meanwhile'"
run "sleep 30"
run "rails s -p 3001"
end
tab "cartodb resque server" do
run "cd $CARTODB_PATH"
run "sleep 30"
@ -36,4 +28,9 @@ end
tab "cartodb textmate" do
run "cd $CARTODB_PATH"
run "mate ."
end
tab "cartodb sql api" do
run "cd $CARTODB_SQL_PATH"
run "node cluster development"
end
Loading…
Cancel
Save