Commit 4913e156c570e7f77467a03c51d713a9c6150781
Few packaging changes
- Add a setup.py script for easy installation of the application.
- Add LICENSE and README.md and AUTHORS file.
- Remove unnecessary copyright notices, and moved them to appropriate places.
| | | | | | 1 | Sweet Web is an idea by Dr. T.B Dinesh. |
---|
| | 2 | See [here]() for more details about SWeeT Web. |
---|
| | 3 | |
---|
| | 4 | The authors of swtstore application are: |
---|
| | 5 | |
---|
| | 6 | - Anon Ray <rayanon004@gmail.com> |
---|
| | | | | | 1 | Copyright (c) 2014, swtstore authors. See AUTHORS file. |
---|
| | 2 | All rights reserved. |
---|
| | 3 | |
---|
| | 4 | Redistribution and use in source and binary forms, with or without |
---|
| | 5 | modification, are permitted provided that the following conditions are met: |
---|
| | 6 | |
---|
| | 7 | 1. Redistributions of source code must retain the above copyright notice, this |
---|
| | 8 | list of conditions and the following disclaimer. |
---|
| | 9 | |
---|
| | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, |
---|
| | 11 | this list of conditions and the following disclaimer in the documentation |
---|
| | 12 | and/or other materials provided with the distribution. |
---|
| | 13 | |
---|
| | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
---|
| | 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
---|
| | 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
---|
| | 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
---|
| | 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
| | 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
---|
| | 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
---|
| | 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
---|
| | 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
---|
| | 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| | | | | | 1 | swtstore (Sweet Store) |
---|
| | 2 | ====================== |
---|
| | 3 | |
---|
| | 4 | ---- |
---|
| | 5 | |
---|
| | 6 | |
---|
| | 7 | Introduction |
---|
| | 8 | ------------ |
---|
| | 9 | |
---|
| | 10 | This is the sweet store application. |
---|
| | 11 | |
---|
| | 12 | The store for the decentralized, semantic, social web tweets a.k.a SWeeTs! |
---|
| | 13 | |
---|
| | 14 | This application acts as the repository store for all the SWeeTs that are |
---|
| | 15 | generated from the clients registered with the sweet store. It also provides |
---|
| | 16 | query APIs to query the SWeeTs. |
---|
| | 17 | |
---|
| | 18 | Sweet store provides the following APIs: |
---|
| | 19 | |
---|
| | 20 | - [GET] /api/sweets/<id>: Get a specific SWeeT by its id. |
---|
| | 21 | |
---|
| | 22 | - [POST] /api/sweets : Post a SWeeT to this swtstore with the data in the |
---|
| | 23 | body of the request. Only registered applications can sweet to sweet store. |
---|
| | 24 | |
---|
| | 25 | - [POST] /api/context : Create a new context on the swtstore. |
---|
| | 26 | |
---|
| | 27 | |
---|
| | 28 | Any client side application can communicate with the sweet store using these |
---|
| | 29 | APIs. |
---|
| | 30 | |
---|
| | 31 | |
---|
| | 32 | Installing |
---|
| | 33 | ---------- |
---|
| | 34 | |
---|
| | 35 | The swtstore application is written in Python and uses a relational database. |
---|
| | 36 | |
---|
| | 37 | Hence, the dependencies of this application is Python and any relational database |
---|
| | 38 | supported by SQLAlchemy. |
---|
| | 39 | |
---|
| | 40 | Most common RDBMS supported by SQLAlchemy are MySQL, Postgresql. |
---|
| | 41 | |
---|
| | 42 | For more information on supported databases see |
---|
| | 43 | [here](http://docs.sqlalchemy.org/en/rel_0_9/dialects/index.html). |
---|
| | 44 | |
---|
| | 45 | _Important:_ |
---|
| | 46 | __So once you are sure you have Python and a relational database (like |
---|
| | 47 | MySQL/Postgresql etc.) installed. You can go ahead and follow these steps:__ |
---|
| | 48 | |
---|
| | 49 | * Clone the repository from [https://git.pantoto.org/sweet-web/sweet-web-engine] |
---|
| | 50 | (https://git.pantoto.org/sweet-web/sweet-web-engine) OR you can download the |
---|
| | 51 | code from the same link. |
---|
| | 52 | |
---|
| | 53 | * Initialize a python virtual environment using virtualenv in the same place |
---|
| | 54 | where you cloned the reposiory in the above step. Now, activate the |
---|
| | 55 | environment ``$ source <path/to/your/current-virtual-env>/bin/activate `` |
---|
| | 56 | |
---|
| | 57 | See |
---|
| | 58 | [http://www.virtualenv.org/en/latest/virtualenv.html] |
---|
| | 59 | (http://www.virtualenv.org/en/latest/virtualenv.html) for more details. |
---|
| | 60 | |
---|
| | 61 | * Run the setup.py script to install `` python setup.py install `` |
---|
| | 62 | |
---|
| | 63 | You're done installing swtstore. Now you need to configure it to run. |
---|
| | 64 | |
---|
| | 65 | |
---|
| | 66 | Configure swtstore |
---|
| | 67 | ------------------ |
---|
| | 68 | |
---|
| | 69 | * Copy the contents of ``sample_config.py`` inside the ``swtstore`` directory |
---|
| | 70 | into ``config.py`` inside ``swtstore`` directory itself. |
---|
| | 71 | |
---|
| | 72 | Assuming you are using a Unix based system, and you are in the root directory |
---|
| | 73 | of the codebase, |
---|
| | 74 | |
---|
| | 75 | `` $ cp swtstore/sample_config.py swtstore/config.py`` |
---|
| | 76 | |
---|
| | 77 | * Edit the config.py file, and change the values accordingly. |
---|
| | 78 | |
---|
| | 79 | |
---|
| | 80 | |
---|
| | 81 | Running the server locally |
---|
| | 82 | -------------------------- |
---|
| | 83 | |
---|
| | 84 | Run the runserver.py script to run the server locally, |
---|
| | 85 | |
---|
| | 86 | `` python runserver.py `` |
---|
| | 87 | |
---|
| | 88 | This runs the application locally, on port 5001 |
---|
| | 89 | |
---|
| | 90 | |
---|
| | 91 | |
---|
| | 92 | Deploying the application |
---|
| | 93 | ------------------------- |
---|
| | 94 | |
---|
| | 95 | The wsgi script to deploy the application is present. |
---|
| | 96 | Point your webserver like Apache, or Nginx to point to the swtstore.wsgi |
---|
| | 97 | script. |
---|
| | 98 | |
---|
| | 99 | See Apache WSGI configuration here: |
---|
| | 100 | [http://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIScriptAlias.html] |
---|
| | 101 | (http://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIScriptAlias.html) |
---|
| | 102 | |
---|
| | 103 | |
---|
| | 104 | Help / Feedback |
---|
| | 105 | --------------- |
---|
| | 106 | |
---|
| | 107 | If you need any help, or have any questions, comments or feedback, you can contact at |
---|
| | 108 | rayanon or arvind or bhanu @servelots.com |
---|
| | 109 | |
---|
| | 110 | You can also join channel #servelots on freenode network, using your favourite |
---|
| | 111 | IRC client. We usually hang out at #servelots. |
---|
| | 112 | |
---|
| | 113 | |
---|
| | 114 | License |
---|
| | 115 | ------- |
---|
| | 116 | |
---|
| | 117 | BSD Licensed. |
---|
| | 118 | |
---|
| | 119 | See LICENSE for more details. |
---|
| | | | | | 1 | # -*- coding: utf-8 -*- |
---|
| | 2 | """ |
---|
| | 3 | setup.py |
---|
| | 4 | ~~~~~~~~ |
---|
| | 5 | |
---|
| | 6 | :copyright: (c) 2014, swtstore authors. see AUTHORS file for more details. |
---|
| | 7 | :license: BSD License, see LICENSE for more details. |
---|
| | 8 | """ |
---|
| | 9 | |
---|
| | 10 | """ |
---|
| | 11 | swtstore |
---|
| | 12 | -------- |
---|
| | 13 | |
---|
| | 14 | The sweet store for decentralized, semantic, social web tweets a.k.a SWeeTs!! |
---|
| | 15 | |
---|
| | 16 | """ |
---|
| | 17 | from setuptools import setup |
---|
| | 18 | |
---|
| | 19 | requires = [ |
---|
| | 20 | 'Flask', |
---|
| | 21 | 'Flask-SQLAlchemy', |
---|
| | 22 | 'sqlalchemy' |
---|
| | 23 | ] |
---|
| | 24 | |
---|
| | 25 | |
---|
| | 26 | setup( |
---|
| | 27 | name='swtstore', |
---|
| | 28 | version='0.1 - alpha', |
---|
| | 29 | url='https://git.pantoto.org/sweet-web', |
---|
| | 30 | license='BSD', |
---|
| | 31 | author='Halwai', |
---|
| | 32 | author_email='rayanon@servelots.com', |
---|
| | 33 | description='Server-side store for decentralized, semantic, social, web\ |
---|
| | 34 | tweets', |
---|
| | 35 | long_description=__doc__, |
---|
| | 36 | packages=['swtstore'], |
---|
| | 37 | zip_safe=False, |
---|
| | 38 | platforms='any', |
---|
| | 39 | install_requires=requires, |
---|
| | 40 | include_package_data=True, |
---|
| | 41 | classifiers=[ |
---|
| | 42 | 'Development Status :: 1 - Alpha', |
---|
| | 43 | 'Environment :: Web Environment', |
---|
| | 44 | 'Intended Audience :: Developers', |
---|
| | 45 | 'License :: OSI Approved :: BSD License', |
---|
| | 46 | 'Operating System :: OS Independent', |
---|
| | 47 | 'Programming Language :: Python', |
---|
| | 48 | 'Topic :: Internet', |
---|
| | 49 | 'Topic :: Internet :: WWW/HTTP :: Social :: Semantic :: Decentralized', |
---|
| | 50 | ] |
---|
| | 51 | ) |
---|
| | | | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
---|
2 | """ | 2 | """ |
---|
3 | __init__.py | 3 | __init__.py |
---|
4 | :copyright: (c) 2014 by Anon Ray. | | :copyright: (c) 2014 by Anon Ray. |
---|
5 | :license: BSD, see LICENSE for details | | :license: BSD, see LICENSE for details |
---|
6 | """ | 4 | """ |
---|
7 | | 5 | |
---|
8 | from flask import Flask, request, jsonify, render_template, make_response, g | 6 | from flask import Flask, request, jsonify, render_template, make_response, g |
---|
| | | | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
---|
2 | """ | 2 | """ |
---|
3 | __init__.py | 3 | __init__.py |
---|
4 | :copyright: (c) 2014 by Anon Ray. | | :copyright: (c) 2014 by Anon Ray. |
---|
5 | :license: BSD, see LICENSE for details | | :license: BSD, see LICENSE for details |
---|
6 | """ | 4 | """ |
---|
7 | from database import db | 5 | from database import db |
---|
8 | import models | 6 | import models |
---|
| | | | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
---|
2 | """ | 2 | """ |
---|
3 | classes/database.py | 3 | classes/database.py |
---|
4 | :copyright: (c) 2014 by Anon Ray. | | :copyright: (c) 2014 by Anon Ray. |
---|
5 | :license: BSD, see LICENSE for details | | :license: BSD, see LICENSE for details |
---|
6 | """ | 4 | """ |
---|
7 | | 5 | |
---|
8 | from flask.ext.sqlalchemy import SQLAlchemy | 6 | from flask.ext.sqlalchemy import SQLAlchemy |
---|
| | | | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
---|
2 | """ | 2 | """ |
---|
3 | __init__.py | 3 | __init__.py |
---|
4 | :copyright: (c) 2014 by Anon Ray. | | :copyright: (c) 2014 by Anon Ray. |
---|
5 | :license: BSD, see LICENSE for details | | :license: BSD, see LICENSE for details |
---|
6 | """ | 4 | """ |
---|
7 | from urlnorm import urlnorm | 5 | from urlnorm import urlnorm |
---|