Connect

A moderated social platform that helps individuals connect based on location, skills and interests. Connect is BSD licenced.

https://travis-ci.org/nlhkabu/connect.svg?branch=master

Note

Connect is in active development and not yet feature complete. See RoadMap for information on planned features.

Contents

What and Why

Note

Connect is in active development and not yet feature complete. See RoadMap for information on planned features.

Objectives

Connect’s objectives are:

  1. To foster a sense of community across geographical boundaries
  2. To help community members form professional and personal relationships
  3. To ensure a safe and welcoming space

Features

Core Functionality

Connect members can:

  • Create a profile containing:
    • A biography
    • Links to external websites (e.g, twitter profile, linkedIn profile)
    • Roles - for nominating how they prefer to interact with other members (e.g. by selecting ‘mentor’)
    • Skills
    • Location settings (TODO)
  • Filter the membership base by:
    • Role
    • Skill
    • Location (TODO)
  • Contact other Connect members (TODO)

Safety And Security
  • Membership by invitation or approval only
  • Built-in abuse reporting and adjudication system
  • Logging of moderator decisions (viewable by other moderators)
Email Notifications
  • Standard users are notified when:
    • Their account application is approved or rejected
    • They are invited to Connect
    • They are reinvited to Connect (reminder email)
    • An abuse report they have logged has been adjudicated
    • A moderator issues a them a warning (as a result of an abuse report logged against them)
    • A moderator bans them from the site (as a result of an abuse report logged against them)
  • Moderators are notified when:
    • A new account application is logged
    • A new abuse report is logged

Moderators do not receive email reports (nor can they view logs) where they are the subject of an abuse report.

Demo

A demo version of Connect is available to try at http://kabu-connect.herokuapp.com Use the following authentication details to login:

Standard User:
password: demo

Moderator:
password: demo


Installation

Connect is currently tested with Python 3.4 and Django 1.7 & 1.8.

Dependencies

You will need to have the following installed:

  • Python 3
  • pip
  • virtualenv-wrapper
  • PostgreSQL (although sqlite can be used on dev machines)

You may also need to install libyaml:

# On Ubuntu
$ sudo apt-get install libyaml-dev

# Or Fedora
$ sudo yum install libyaml-devel

Next setup your virtualenv with:

$ mkvirtualenv --python=/usr/bin/python3 connect
$ pip install -r requirements/dev.txt

Postgres setup

Postgres is not required for local development, but it can be a good idea – running tests against the same database as production can sometimes pick up edge case bugs early.

If you’re setting up a staging, production, or CI server, postgres is strongly recommended. Install it with sudo apt-get install postgresql-9.4 or similar, and then set up a database for the connect app:

$ createdb connectdb
$ createuser -P connectuser   # note password chosen
$ psql

=# GRANT ALL PRIVILEGES ON DATABASE connectdb TO connectuser;
=# ALTER USER connectuser CREATEDB;

=# \l # Check database access permissions
=# \q # (or Ctrl-D) Exit from psql

(You can substitute connectdb and connectuser as you wish, you will just need to reflect that in the DATABASE_URL you set below.)

Environment variables

A fully configured connect instance requires the following environment variables:

  • DATABASE_URL – db config syntax: "postgres://USER:PASSWORD@HOST:PORT/DB-NAME"
  • SECRET_KEY – this should not be stored in your repository.
  • ALLOWED_HOSTS – required when DEBUG=False, so for staging/ci/prod.
  • DEFAULT_FROM_EMAIL – the from address for in-app emails
  • MANDRILL_API_KEY – Mandrill is recommend for sending emails from the server
  • DJANGO_MODE – outside dev, set this to “Production” or “Staging”

All of these have working defaults in dev, but if you want to override any of them (eg to use postgres), you can set them like this:

export DATABASE_URL="postgres://connectuser:<password>@localhost:5432/connectdb"
export SECRET_KEY="a long string of random characters"
export DEFAULT_FROM_EMAIL="admin@mentorconnect.com"
#... etc

Tip

A good place to set them is in the postactivate virtualenv hook, which will be somewhere like ~/.virtualenvs/connect/bin/postactivate. For neatness, unset them in the predeactivate virtualenv hook too:

unset DATABASE_URL
unset SECRET_KEY
unset DEFAULT_FROM_EMAIL
#... etc

Initial database setup

First sync the database:

$ python manage.py migrate

Then create a superuser:

$ python manage.py createsuperuser

Now you can run your local sever:

$ python manage.py runserver

And you’ll be able to open up the development site in your web browser at http://localhost:8000/

Important

Now that your site is up and running, you will need to login to the admin and:

  1. Set is_moderator to True for your superuser.
  2. Set up some additional data in your database. (See Site Configuration for more information.)

Running Tests

$ python manage.py test #to test the entire project.
$ python manage.py test connect/appname #to test a specific django app

To run Connect’s Behave tests, you will need to have PhantomJS installed.

$ npm install phantomjs

Run the BDD tests with:

$ python manage.py test bdd

To run an individual test feature, use

$ npm install phantomjs
$ python manage.py test bdd --behave_include featurename

Alternatively you can use any other supported browser (e.g. Chrome, Firefox) by installing it on your system and specifying it when you run your tests:

$ python manage.py test bdd --behave_browser <browser>

Editing SCSS files (style)

Connect is built with Sass and Compass.

To use them you will also need ruby - the installation process for this is beyond the scope of these instructions. Please refer to the Saas and Compass documentation for more information.

To compile your SCSS into CSS, use:

compass compile connect/static/css # where final argument is a path to the css folder

Or you can automatically update your changes with:

compass watch connect/static/css # where final argument is a path to the css folder

Example: Changing the highlighting color

You can change the default pink highlight color by editing the $highlight variable at the top of static/css/sass/_color.scss

Additional configuration

In settings.py, you may also wish to override:

  • Admins
  • Timezone
  • Gravatar Settings

Site Configuration

After you have installed Connect, but before you start inviting new users, you will need to configure a few things in the database.

First - login to the Django admin using your superuser credentials.

Sites [Required]

In addition to using the Django sites framework, Connect requires you to specify a number of additional settings used throughout the site and email templates:

  • A logo
  • A site tagline
  • An email address for receiving enquiries (for example, if a member wishes to challenge a moderator’s decision)
  • An email header image

Brands

If you are setting up a site for artists, you might anticipate that many of your members have a Deviant Art page. In this case, you would register:

  • Deviant Art as the brand name
  • deviantart.com as the domain
  • fa-deviantart as the font awesome icon

Now, when a member adds http://deviantart.com/mypage/ to their public profile, the icon next to that link will be the font awesome deviant art icon.

Roles

Roles define how a member would like to interact with others in the community. For example, an artist community might want to set up the following roles:

  1. Social with the description I would like to socialise with other members
  2. Share Materials with the description I would like to share art materials with other members
  3. Share Workshop with the description I would like to share a workshop space with other members
  4. Exhibition Partner with the description I would like to do joint exhibitions with other members
  5. Mentor with the description I would like to mentor other members

Once roles are set up in the database, members can:

  • Select one or more role to display on their public profile
  • Search the membership base by one or more role

Skills

Skills allow members to indicate their areas of expertise and interest. If you were setting up an art community, skills could include:

  • Sculpture
  • Installation Art
  • Watercolors
  • Oils
  • Vector Art
  • Photography

Once skills are set up in the database, members can:

  • Select one or more skill to display on their public profile
  • Specify a proficiency for each skill displayed on their public profile
  • Search the membership base by one or more skill

Note

Creating the skills via the Django admin (rather than allowing members to create skills on the fly) is a deliberate design decision - as it avoids the creation of similar or duplicate skills. If a member wants to list a skill that is not available, Connect invites them to email the email address set in your site configuration. Choose your skills wisely!

Flat Pages

Pages added via Flat Pages are automatically added to the site-wide footer. Example pages to consider:

  • Code of Conduct
  • Privacy Policy
  • Terms and Conditions

Organisations using Connect

Using Connect? Please add your details here :)

Authors

Contacts

Nicole Harris
  • Lead developer
Olivier Harris
  • Code review and mentoring
  • Deployment
  • CI integration

Contributors

Special thanks

  • Folks on #django IRC for feedback and bug smashing
  • Idan Gazit for additional mentoring

RoadMap

Connect is in active development and is not yet feature complete. Major upcoming tasks include:

  1. Allowing members to set their timezone and location
  2. Allowing members to search for other members by location
  3. Integrating a mechanism for members to contact each other

Major done tasks:

  1. Writing python BDD tests with Behave
  2. Integrating third party mail service (most likely Mailgun), and queuing mail delivery with Celery
  3. Adding JavaScript form validation

Indices and tables