spchuang/community
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
The free mysql db we're using for now:
Online Mysql DB:
Host: sql3.freesqldatabase.com
Database name: sql322886
Database user: sql322886
Database password: wD5*sF5%
Port number: 3306
Install python dependencies:
sudo pip install -r requirement.txt
Create the databases:
python db_create.py
start the server:
python run.py
Top-level structure:
community/
db/
migration/ : alembic migration stuff
version/ : different revision scripts for db migration
models.py : sql-alchemy model definition
db_create.py: create db
app/
controllers/ :controllers are pretty much functions separated out from main for sake of readability
api/ : API endpoints for ajax
community.py : community list, community api,
account.py : User related stuff; like logins, logout, profile page, signup
static/
css/
img/
js/
templates/
account/
community/
helper/ : jinja macros
home/
status/
404.html : 404 page
base.html : the base template (defines javascript files and navigation header)
__init__.py : initializaiton of the app (ex. for sqlachemy and flask-login)
forms.py : definition of Flask-WTF forms
main.py : main entry point of the app; defines routing
config.py : Application configuration
run.py : start the application
try.py : just for testing out sqlalchemy quries
test.py : Unit tester (undone)
requirements.txt: python dependency list
Libraries:
Backend:
Flask: micro framework
Jinja2: templating
Flask-sqlAlchemy: main db ORM
Flask-login: login library. Can integrate with fb easier later
Flask-WTF: form creation/validation
py-bcrypt: password hashing
alembic: db migration
Front:
JQuery
handlebar: templating (http://handlebarsjs.com/)
jquery.timeago (http://timeago.yarp.com/)
TODO list:
See github issues
Possibly useful resources
Text length contraints
http://stackoverflow.com/questions/11735947/what-is-maximum-message-length-for-facebook-wall-post-closed
http://sugarjs.com/
https://github.com/david0178418/BackboneJS-AMD-Boilerplate/tree/master/src/js
https://github.com/backbone-boilerplate/backbone-boilerplate
https://github.com/ccoenraets/directory-backbone-bootstrap-require
db design
http://stackoverflow.com/questions/4048151/what-are-the-options-for-storing-hierarchical-data-in-a-relational-database
Question:
1. initie comments? self-referencial table or only one layer of comments
Alemic db migration
run : "alembic revision --autogenerate -m "Added some table"
then : alembic upgrade head
see http://mattupstate.com/python/databases/2012/11/15/database-migrations-with-alembic-sqlalchemy-and-flask.html
Handy links (tutorials):
http://tutorialzine.com/2011/03/custom-facebook-wall-jquery-graph/
More:
Community Relationship:
Financial Tracking:
Meeting Tracking
universal wall:
-easy integrate a comment wall to any page so that we can comment on say, an event or a task.
Task todo:
- assign people
- watch list
- set priority status
- partial update of main when checking sidebar
- sort/filter