Eventum is a content management system for an event-driven blog that syncs with Google Calendar.
- Built in Flask
- Flask-Mongoengine and Mongoengine are used to interface with MongoDB
- Authentication is done with Google+ server-side flow
- Forms and validation are done through Flask-WTForms and WTForms
- CSS is generated from SCSS and managed with Flask-Assets
Eventum runs on Linux and OSX. To get it up an running, follow these steps:
-
Install MongoDB (Ubuntu Linux, OSX).
On OSX, you may have to run
$ mkdir /data /data/db
before you can runmongod
without errors. -
Install VirtualEnv:
$ sudo pip install virtualenv
-
Download a copy of
client_secrets.json
from the Google Developer Console or from a friend, and place it in theconfig
folder. -
Authorize the Google Calendar API:
$ python manage.py --authorize
-
Install SASS gem
gem install sass
- otherwise, you will see an
OS
error
- otherwise, you will see an
Then you should be all set to run!
Here's how to run Eventum in a development environment:
mongod &
virtualenv --no-site-packages .
source bin/activate
source config/settings.dev
pip install -r config/requirements.txt
python run.py
Or alternately:
./develop.sh
source bin/activate
source config/settings.dev
python run.py
Finally, go to localhost:5000
on your browser
It is possible to run Eventum without logging in using Google+ or authenticating with Google Calendar. To do so, edit config/settings.sh
and set GOOGLE_AUTH_ENABLED
to FALSE
:
# Whether or not to enable Google Auth or not.
echo $GOOGLE_AUTH_ENABLED
There is an alternative installation route that will set up a virtual machine on your computer and install all necessary software for you. You must first install Virtual box and Vagrant.
vagrant up
# wait for installation
# enter your virtual machine
vagrant ssh
# enter your project directory
cd /vagrant
# add application settings to your environment
source config/settings.sh
# run the application
python run.py
# view the app!
# open your browser to localhost:5000
Eventum uses Sphinx to compile documentation to an HTML website. This documentation is generated from the source code.
Here's how to compile the docs:
# The documentation requires that the app is runnable, so you must be in a
# development environment
./develop.sh
source bin/activate
source config/settings.sh
cd docs
# This will generate the documentation website in /docs/_build/html
make html
# Then either host the docs on localhost:8000
cd _build/html
python -m SimpleHTTPServer .
# Or open them directly
open _build/html/index.html
Tests live in the test
directory, and can be run via nosetests:
source bin/activate # If you are not already in your virtualenv
nosetests
.
├── app # All code related to the running of the app
│ ├── forms # Flask-WTForms models, used for generating forms in HTML
│ │ # and validating input
│ ├── lib # Misc helpers, tasks, and modular libraries
│ ├── models # Mongoengine Models
│ ├── routes # All Flask routes, using Blueprints
│ ├── static
│ │ ├── css # CSS
│ │ │ ├── lib # CSS libraries
│ │ │ └── gen # CSS generated from SCSS
│ │ ├── img # Images
│ │ ├── js # Javascript files
│ │ └── scss # Stylesheets
│ ├── templates # HTML templates
│ └── __init__.py # All app-wide setup. Called by `run.py`
├── config # Configuration files
├── data # Backup data
├── manage.py # Various scripts. Run `python manage.py` to view usage.
├── run.py # Runs the app!
├── script # Scripts run by `manage.py` outside of the app
├── test # Unit tests
└── log # Log Files