hack4impact-upenn / maps4all

Generalized application for displaying location-based resources on a map
MIT License
33 stars 11 forks source link
flask maps python

# Maps4All Circle CI Code Climate Test Coverage Issue Count

Team Members

Synopsis

A generalized Flask application for displaying location-based resources on a map.

Setting up

Clone the repo
$ git clone https://github.com/hack4impact/maps4all.git
$ cd maps4all
Initialize a virtualenv
$ pip install virtualenv
$ virtualenv -p python3 venv
$ source venv/bin/activate

(If you're on a mac) Make sure xcode tools are installed

$ xcode-select --install
Install the dependencies
$ pip install -r requirements.txt
Other dependencies for running locally

You need to install Foreman and Redis. Chances are, these commands will work:

$ gem install foreman

For Mac (using homebrew):

$ brew install redis

For Linux (Fedora)

$ sudo dnf install redis

For Linux (Debian/Ubuntu):

$ sudo apt-get install redis-server

If you don't want to install redis locally, you can use Redis container with docker

$ docker pull redis:latest
$ docker run -d -p 6379:6379 --name maps4all-redis redis:latest
Set your environment variables

Create a .env file in your directory and include the following variables:

Your .env file should look something like this:

ADMIN_EMAIL=admin@maps4all.org
ADMIN_PASSWORD=password123
FILEPICKER_API_KEY=XXXXXXXXXXXXXXXX
MAIL_USERNAME=janedoe
MAIL_PASSWORD=password123
GOOGLE_API_KEY=XXXXXXXXXXXXXXXX
GOOGLE_API_1=XXXXXXXXXXXXXXXX
GOOGLE_API_2=XXXXXXXXXXXXXXXX
TWILIO_ACCOUNT_SID=XXXXXXXXXXXXXXXX
TWILIO_AUTH_TOKEN=XXXXXXXXXXXXXXXX
Create the database
$ python manage.py recreate_db
Other setup (e.g. creating roles in database)
$ python manage.py setup_dev
[Optional] Add fake data to the database
$ python manage.py add_fake_data

Running the app

$ source venv/bin/activate
$ honcho start -f Local

Then navigate to http://localhost:5000 on your preferred browser to open the web app.

Project Structure

├── Procfile
├── README.md
├── app
│   ├── __init__.py
│   ├── account
│   │   ├── __init__.py
│   │   ├── forms.py
│   │   └── views.py
│   ├── admin
│   │   ├── __init__.py
│   │   ├── forms.py
│   │   └── views.py
│   ├── assets
│   │   ├── scripts
│   │   │   ├── app.js
│   │   │   └── vendor
│   │   │       ├── jquery.min.js
│   │   │       ├── semantic.min.js
│   │   │       └── tablesort.min.js
│   │   └── styles
│   │       ├── app.scss
│   │       └── vendor
│   │           └── semantic.min.css
│   ├── assets.py
│   ├── decorators.py
│   ├── email.py
│   ├── main
│   │   ├── __init__.py
│   │   ├── errors.py
│   │   ├── forms.py
│   │   └── views.py
│   ├── models.py
│   ├── static
│   │   ├── fonts
│   │   │   └── vendor
│   │   ├── images
│   │   └── styles
│   │       └── app.css
│   ├── templates
│   │   ├── account
│   │   │   ├── email
│   │   │   ├── login.html
│   │   │   ├── manage.html
│   │   │   ├── register.html
│   │   │   ├── reset_password.html
│   │   │   └── unconfirmed.html
│   │   ├── admin
│   │   │   ├── index.html
│   │   │   ├── manage_user.html
│   │   │   ├── new_user.html
│   │   │   └── registered_users.html
│   │   ├── errors
│   │   ├── layouts
│   │   │   └── base.html
│   │   ├── macros
│   │   │   ├── form_macros.html
│   │   │   └── nav_macros.html
│   │   ├── main
│   │   │   └── index.html
│   │   └── partials
│   │       ├── _flashes.html
│   │       └── _head.html
│   └── utils.py
├── config.py
├── manage.py
├── requirements
│   ├── common.txt
│   └── dev.txt
└── tests
    ├── test_basics.py
    └── test_user_model.py

License

MIT License