--- /dev/null +++ b/AUTHORS @@ -1 +1,7 @@ +Sweet Web is an idea by Dr. T.B Dinesh. +See [here]() for more details about SWeeT Web. + +The authors of swtstore application are: + +- Anon Ray --- /dev/null +++ b/LICENSE @@ -1 +1,24 @@ +Copyright (c) 2014, swtstore authors. See AUTHORS file. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- /dev/null +++ b/README.md @@ -1 +1,120 @@ +swtstore (Sweet Store) +====================== + +---- + + +Introduction +------------ + +This is the sweet store application. + +The store for the decentralized, semantic, social web tweets a.k.a SWeeTs! + +This application acts as the repository store for all the SWeeTs that are +generated from the clients registered with the sweet store. It also provides +query APIs to query the SWeeTs. + +Sweet store provides the following APIs: + + - [GET] /api/sweets/: Get a specific SWeeT by its id. + + - [POST] /api/sweets : Post a SWeeT to this swtstore with the data in the + body of the request. Only registered applications can sweet to sweet store. + + - [POST] /api/context : Create a new context on the swtstore. + + +Any client side application can communicate with the sweet store using these +APIs. + + +Installing +---------- + +The swtstore application is written in Python and uses a relational database. + +Hence, the dependencies of this application is Python and any relational database +supported by SQLAlchemy. + +Most common RDBMS supported by SQLAlchemy are MySQL, Postgresql. + +For more information on supported databases see +[here](http://docs.sqlalchemy.org/en/rel_0_9/dialects/index.html). + +_Important:_ +__So once you are sure you have Python and a relational database (like +MySQL/Postgresql etc.) installed. You can go ahead and follow these steps:__ + +* Clone the repository from [https://git.pantoto.org/sweet-web/sweet-web-engine] + (https://git.pantoto.org/sweet-web/sweet-web-engine) OR you can download the + code from the same link. + +* Initialize a python virtual environment using virtualenv in the same place + where you cloned the reposiory in the above step. Now, activate the + environment ``$ source /bin/activate `` + + See + [http://www.virtualenv.org/en/latest/virtualenv.html] + (http://www.virtualenv.org/en/latest/virtualenv.html) for more details. + +* Run the setup.py script to install `` python setup.py install `` + +You're done installing swtstore. Now you need to configure it to run. + + +Configure swtstore +------------------ + +* Copy the contents of ``sample_config.py`` inside the ``swtstore`` directory + into ``config.py`` inside ``swtstore`` directory itself. + + Assuming you are using a Unix based system, and you are in the root directory + of the codebase, + + `` $ cp swtstore/sample_config.py swtstore/config.py`` + +* Edit the config.py file, and change the values accordingly. + + + +Running the server locally +-------------------------- + +Run the runserver.py script to run the server locally, + +`` python runserver.py `` + +This runs the application locally, on port 5001 + + + +Deploying the application +------------------------- + +The wsgi script to deploy the application is present. +Point your webserver like Apache, or Nginx to point to the swtstore.wsgi +script. + +See Apache WSGI configuration here: +[http://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIScriptAlias.html] +(http://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIScriptAlias.html) + + +Help / Feedback +--------------- + +If you need any help, or have any questions, comments or feedback, you can contact at +rayanon or arvind or bhanu @servelots.com + +You can also join channel #servelots on freenode network, using your favourite +IRC client. We usually hang out at #servelots. + + +License +------- + +BSD Licensed. + +See LICENSE for more details. --- /dev/null +++ b/setup.py @@ -1 +1,52 @@ +# -*- coding: utf-8 -*- +""" + setup.py + ~~~~~~~~ + + :copyright: (c) 2014, swtstore authors. see AUTHORS file for more details. + :license: BSD License, see LICENSE for more details. +""" + +""" +swtstore +-------- + +The sweet store for decentralized, semantic, social web tweets a.k.a SWeeTs!! + +""" +from setuptools import setup + +requires = [ + 'Flask', + 'Flask-SQLAlchemy', + 'sqlalchemy' +] + + +setup( + name='swtstore', + version='0.1 - alpha', + url='https://git.pantoto.org/sweet-web', + license='BSD', + author='Halwai', + author_email='rayanon@servelots.com', + description='Server-side store for decentralized, semantic, social, web\ + tweets', + long_description=__doc__, + packages=['swtstore'], + zip_safe=False, + platforms='any', + install_requires=requires, + include_package_data=True, + classifiers=[ + 'Development Status :: 1 - Alpha', + 'Environment :: Web Environment', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Topic :: Internet', + 'Topic :: Internet :: WWW/HTTP :: Social :: Semantic :: Decentralized', + ] +) --- a/swtstore/application.py +++ b/swtstore/application.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ __init__.py - :copyright: (c) 2014 by Anon Ray. - :license: BSD, see LICENSE for details """ from flask import Flask, request, jsonify, render_template, make_response, g --- a/swtstore/classes/__init__.py +++ b/swtstore/classes/__init__.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ __init__.py - :copyright: (c) 2014 by Anon Ray. - :license: BSD, see LICENSE for details """ from database import db import models --- a/swtstore/classes/database.py +++ b/swtstore/classes/database.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ classes/database.py - :copyright: (c) 2014 by Anon Ray. - :license: BSD, see LICENSE for details """ from flask.ext.sqlalchemy import SQLAlchemy --- a/swtstore/classes/utils/__init__.py +++ b/swtstore/classes/utils/__init__.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ __init__.py - :copyright: (c) 2014 by Anon Ray. - :license: BSD, see LICENSE for details """ from urlnorm import urlnorm