fossasia / open-event-server

The Open Event Organizer Server to Manage Events https://test-api.eventyay.com
https://api.eventyay.com
GNU General Public License v3.0
2.96k stars 1.89k forks source link

Open Event Server

Open Event Server

GitHub release Build Status CircleCI Build Staus Badge Codacy Badge Codecov branch Gitter Reviewed by Hound Mailing List Twitter Follow

The Open Event Server enables organizers to manage events from concerts to conferences and meet-ups.

It offers features for events with several tracks and venues. Event managers can create invitation forms for speakers and build schedules in a drag and drop interface. The event information is stored in a database. The system provides API endpoints to fetch the data, and to modify and update it. Organizers can import and export event data in a standard compressed file format that includes the event data in JSON and binary media files like images and audio.

The Open Event Server exposes a well documented JSON:API Spec Compliant REST API that can be used by external services (like the Open Event App generators and the frontend) to access & manipulate the data.

API Documentation:

Communication

Demo Version

A demo version is automatically deployed from our repositories:

Installation

The Open Event Server can be easily deployed on a variety of platforms. Detailed platform-specific installation instructions have been provided below.

  1. Installation Instructions
  2. Vagrant Installation
  3. Deployment on Google Compute Engine
  4. Deployment on Google Container Engine (Kubernetes)
  5. Deployment on AWS EC2
  6. Deployment on Digital Ocean
  7. Deployment with Docker
  8. Deployment on Heroku

One-click Heroku deployment is also available:

Deploy

Technology Stack

Please get familiar with the components of the project in order to be able to contribute.

Components

Note that open-event-server works with Python 3.8 at the moment.

External Service Dependencies

OAuth Social Authentication

OAuth is used to get information from Facebook and Google accounts, that enables users to sign in with their respective credentials:

  1. Google - https://accounts.google.com/o/oauth2/auth
  2. Facebook - https://graph.facebook.com/oauth

Twitter

Twitter feed integration is provided in the public event pages.

Required keys can be obtained from https://dev.twitter.com/overview/documentation

Instagram

It is possible to extend the functionality and offer images from Instagram in the event service.

Required keys can be obtained from https://www.instagram.com/developer/authentication/.

Google Maps

Google maps is used to get information about location (info about country, city, latitude and longitude).

Required keys can be obtained from https://developers.google.com/maps/documentation/javascript/get-api-key.

Media Storage - Local/Amazon S3/Google Cloud

Media (like audio, avatars and logos) can be stored either Locally, on Amazon S3 or on Google Storage.

  1. Amazon S3 Setup Instructions
  2. Google Cloud Setup Instructions

Emails - SMTP/Sendgrid

The server can send emails via SMTP or using the sendgrid API.

  1. SMTP can be configured directly at admin/settings
  2. Obtaining Sendgrid API Token.

Heroku API

If the application is deployed on Heroku, we use the heroku API to obtain the latest release and also to display the heroku.

The required token can be obtained from https://devcenter.heroku.com/articles/authentication.

Payment Gateways

For ticket sales the service integrates payment gateways:

  1. Stripe - Obtaining Keys.
  2. Paypal - Obtaining Credentials.

Data Access

Import & Export

Import:

Open Event server supports multiple formats as a valid source for import.

Export:

The event data and the sessions can be exported in various formats.

Roles

The system has two kinds of role type.

  1. System roles are related to the Open Event organization and operator of the application.
  2. Event Roles are related to the users of the system with their different permissions.

Read more here.

Development

Initial setup

Python and Poetry installatioon

We use Python 3.8. If your operating system does not provide Python 3.8 out of the box, it is best installed using pyenv.

For Mac users, see here for more info.

$ brew install pyenv
$ pyenv init # follow instructions to add run commands to your environment

After editing your environment file, reload your shell and navigate to this repo, then install 3.8.17 to be used locally:

$ pyenv install 3.8.17
$ cd ...your../open-event-server/
$ pyenv local 3.8.17

Now the Python version should automatically change when used within open-event-server.

We also expect poetry being available.

Package setup

Change into the open-event-server directory, and execute the following commands:

Activate Python 3.8.17 locally

$ pyenv local 3.8.17

Install dependencies using poetry

$ poetry install --with dev

Activate the pre-commit hook

$ poetry run pre-commit install

With that every git commit will be checked/formatted with various tools before being actually committed.

Development Mode

To enable development mode (development Flask config), set APP_CONFIG environment variable to "config.DevelopmentConfig".

export APP_CONFIG=config.DevelopmentConfig

Model updates & migrations

When writing changes to models. Use migrations.

 # To generate a migration after doing a model update
 python3 manage.py db migrate

 # To sync Database
 python3 manage.py db upgrade

 # To rollback
 python3 manage.py db downgrade

When checking in code for models, please update migrations as well.

API documentation

The api is documented using api blueprint. First, generate the description/blueprint .apib file using:

npx aglio --input docs/api/api_blueprint_source.apib --compile --output docs/api/api_blueprint.apib # generate the description .apib file

Local changes to the description can be viewed using e.g. the apiary gem:

gem install apiaryio # dependency
apiary preview --path docs/api/api_blueprint.apib # opens browser with generated file

Testing

Clone the repo and set up the server according to the steps listed. Make sure you have installed Poetry and all the dependencies required for testing by running

# Install Poetry
curl -sSL https://install.python-poetry.org | python -
source ~/.profile

# Install Python dependencies
poetry install

# Activate project's virtual environment
poetry shell

Running unit tests

./scripts/test_db.sh

And set appropriate value of TEST_DATABASE in .env

TEST_DATABASE_URL=postgresql://test@localhost:5433/test

Running robot framework tests

robot -v SERVER:{server_name} -v SUPERUSER_USERNAME:{super_user_email_here} -v SUPERUSER_PASSWORD:{super_user_password} tests/robot

Change all the parameters inside {} as per your local server. The final command would look like:

robot -v SERVER:localhost:5000 -v SUPERUSER_USERNAME:test@opev.net -v SUPERUSER_PASSWORD:test_password tests/robot

Pre-commits guide

Git hook scripts are useful for identifying simple issues before submission to code review.

Install the git hook scripts:

For configuration, Click Here

Logging

Certain information is being logged and stored in the database for future reference, resolving conflicts in case of hacks and for maintaining an overview of the system. Read more about logging here.

Internationalization (i18n)

Translation status

Open Event is being translated using Weblate, a web tool designed to ease translating for both developers and translators.

If you would like to contribute to the translation of Open Event, you need to register on this server.

Once you have activated your account just proceed to the translation section.

Contributions, Bug Reports, Feature Requests

This is an Open Source project and we would be happy to see contributors who report bugs and file feature requests submitting pull requests as well. Please report issues here https://github.com/fossasia/open-event-server/issues. It is also recommended to go through the developer handbook in order to get a basic understanding of the ecosystem.

Branch Policy

We have the following branches :

Release Policy

The tentative release policy, for now (since there is a lot of activity and a lot of bugs), is an alpha release every Monday and Friday (since we see more activity on weekends). So, any bug-fixes will not be reflected at eventyay.com until a new release is made in the master branch.

Contributions Best Practices

Commits

Feature Requests and Bug Reports

Join the development

License

This project is currently licensed under the GNU General Public License v3.

To obtain the software under a different license, please contact FOSSASIA.