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.
  • Diff rendering mode:
  • inline
  • side by side

AUTHORS

1Sweet Web is an idea by Dr. T.B Dinesh.
2See [here]() for more details about SWeeT Web.
3
4The authors of swtstore application are:
5
6- Anon Ray <rayanon004@gmail.com>

LICENSE

1Copyright (c) 2014, swtstore authors. See AUTHORS file.
2All rights reserved.
3
4Redistribution and use in source and binary forms, with or without
5modification, are permitted provided that the following conditions are met:
6
71. Redistributions of source code must retain the above copyright notice, this
8list of conditions and the following disclaimer.
9
102. Redistributions in binary form must reproduce the above copyright notice,
11this list of conditions and the following disclaimer in the documentation
12and/or other materials provided with the distribution.
13
14THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

1swtstore (Sweet Store)
2======================
3
4----
5
6
7Introduction
8------------
9
10This is the sweet store application.
11
12The store for the decentralized, semantic, social web tweets a.k.a SWeeTs!
13
14This application acts as the repository store for all the SWeeTs that are
15generated from the clients registered with the sweet store. It also provides
16query APIs to query the SWeeTs.
17
18Sweet 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
28Any client side application can communicate with the sweet store using these
29APIs.
30
31
32Installing
33----------
34
35The swtstore application is written in Python and uses a relational database.
36
37Hence, the dependencies of this application is Python and any relational database
38supported by SQLAlchemy.
39
40Most common RDBMS supported by SQLAlchemy are MySQL, Postgresql.
41
42For 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
47MySQL/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
63You're done installing swtstore. Now you need to configure it to run.
64
65
66Configure 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
81Running the server locally
82--------------------------
83
84Run the runserver.py script to run the server locally,
85
86`` python runserver.py ``
87
88This runs the application locally, on port 5001
89
90
91
92Deploying the application
93-------------------------
94
95The wsgi script to deploy the application is present.
96Point your webserver like Apache, or Nginx to point to the swtstore.wsgi
97script.
98
99See 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
104Help / Feedback
105---------------
106
107If you need any help, or have any questions, comments or feedback, you can contact at
108rayanon or arvind or bhanu @servelots.com
109
110You can also join channel #servelots on freenode network, using your favourite
111IRC client. We usually hang out at #servelots.
112
113
114License
115-------
116
117BSD Licensed.
118
119See LICENSE for more details.

setup.py

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"""
11swtstore
12--------
13
14The sweet store for decentralized, semantic, social web tweets a.k.a SWeeTs!!
15
16"""
17from setuptools import setup
18
19requires = [
20 'Flask',
21 'Flask-SQLAlchemy',
22 'sqlalchemy'
23]
24
25
26setup(
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)

swtstore/application.py

1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2"""2"""
3 __init__.py3 __init__.py
4 :copyright: (c) 2014 by Anon Ray.
5 :license: BSD, see LICENSE for details
6"""4"""
75
8from flask import Flask, request, jsonify, render_template, make_response, g6from flask import Flask, request, jsonify, render_template, make_response, g

swtstore/classes/__init__.py

1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2"""2"""
3 __init__.py3 __init__.py
4 :copyright: (c) 2014 by Anon Ray.
5 :license: BSD, see LICENSE for details
6"""4"""
7from database import db5from database import db
8import models6import models

swtstore/classes/database.py

1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2"""2"""
3 classes/database.py3 classes/database.py
4 :copyright: (c) 2014 by Anon Ray.
5 :license: BSD, see LICENSE for details
6"""4"""
75
8from flask.ext.sqlalchemy import SQLAlchemy6from flask.ext.sqlalchemy import SQLAlchemy

swtstore/classes/utils/__init__.py

1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2"""2"""
3 __init__.py3 __init__.py
4 :copyright: (c) 2014 by Anon Ray.
5 :license: BSD, see LICENSE for details
6"""4"""
7from urlnorm import urlnorm5from urlnorm import urlnorm