Rucksack is a repository of web components and a tool to create and collect them. This is the API.
Available at /users.
Return a list of all users.
Example:
[
{
"created": 1398900632,
"email": "user@email.com",
"id": 1,
"username": "user"
},
...
]
Create a new user.
Request body:
{
"username": <username>,
"email": <email address>
}
Available at /web_components
Return a list of all web components.
Example:
[
{
"created": 1398901345,
"description": "This is a test component.",
"id": 1,
"name": "Test Component",
"owner": {
"created": 1398900632,
"email": "user@email.com",
"id": 1,
"username": "user"
},
"repository_url": "https://github.com/username/test_component",
"tags": []
},
...
]
Create a new web component.
Request body:
{
"name": <name>,
"description": <description>,
"owner": <username of existant user>,
"repository_url": <relevant url>
}
Available at /web_components/:id/tags.
Returns a list of all tags for the web component.
Example:
[
{
"created": 1398901909,
"id": 1,
"name": "Test Tag"
},
...
]
Add a tag to the web component.
Request body:
{
"name": "Test Tag"
}
Download Postgres.app and run it from https://github.com/PostgresApp/PostgresApp/releases.
Add the Postgres.app utilities to your path:
echo 'export PATH="/Applications/Postgres.app/Contents/Versions/9.3/bin:$PATH"' >> ~/.bash_profile
Install the latest version of Python using Homebrew.
brew update && brew install python
Ensure you are using Homebrew's latest Python and not the OS X version.
echo 'export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH' >> ~/.bash_profile
source ~/.bash_profile
Update Setuptools and Pip:
pip install --upgrade setuptools
pip install --upgrade pip
Install and set up virtualenv:
pip install virtualenv virtualenvwrapper
echo 'export WORKON_HOME=~/.virtualenvs/' >> ~/.bash_profile
echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bash_profile
source ~/.bash_profile
mkdir -p $WORKON_HOME
mkvirtualenv rucksack-api
Now, to switch to your new environment you can do workon rucksack-api
.
Clone the repository:
git clone git@github.com:nrempel/rucksack-api.git && cd rucksack-api
Install the dependencies:
pip install -r requirements.txt
Initalize the database:
fab shell
>>> db.create_all()
fab run
e.g., fab run
Runs the webserver.
e.g., fab shell:local
Runs a Python interactive shell in the given context.