Skip to content
This repository was archived by the owner on May 11, 2021. It is now read-only.

Kalela/BrightEvents

Repository files navigation

Event Hub

Event Hub is an offshoot website of Bright Events collaborative development training, hosted by Andela. The Site allows users to view and manage their own events as well as inform potential attendants of the event's existence. Visit our link at https://kalela.github.io/BrightEvents/. Heroku app: https://brighteventsapinowlive.herokuapp.com

Build Status

Build Status Maintainability Codacy Badge Coverage Status Code Style

Features

  • Users can advertise events and share them easily
  • Users can manage their own events
  • Users can RSVP events and view people who RSVP their own
  • Users can find events by location and category

Tech and FrameWork used

Installation

  1. Clone the Github repository:

    $ git clone https://github.com/Kalela/BrightEvents.git

  2. Install pip

    $ sudo apt-get install python-pip python-dev build-essential $ sudo pip install --upgrade pip

  3. Install virtualenv

    $ sudo pip install --upgrade virtualenv

  4. Set up autoenv using pip and create a .env file for it to access every time this path is accessed.

    $ pip install autoenv

env Every time this directory is accessed, the commands are excecuted to set up the FLASK_APP and other environment variables. 5. Set up a virtualenv

  • In this case, virtualenv venv (If you can't see the .env file make sure your file explorer has viewing hidden files enabled)

    $ virtualenv venv

  • Run the following to update and refresh your .bashrc:

    $ echo "source which activate.sh" >> ~/.bashrc $ source ~/.bashrc

    • cd Out of the folder and back in to get autoenv up and running and thus your virtualenv venv activated.
  1. Install all application requirements using pip

    $ pip install -r requirements.txt To check if installed run pip freeze to see all installed packages

Designs

All front end designs are located in the designs folder.

Running the API Endpoints

  1. Run a terminal such as cmd on windows or terminal on ubuntu.
  2. cd into main folder and run command flask run. This should start the server to our Event Hub RESTful api on port 5000.

    $ flask run

CMD If your lucky (winks) You won't get any errors and server will be up on localhost port 5000. CMD

  1. Now you can test your endpoints using Postman or Curl. Your good to go.

Endpoints

Endpoint Functionality
POST /api/v2/auth/register Registers a user
POST /api/v2/auth/login Logs a registered user in
POST /api/v2/auth/logout Logs a logged in user out
POST /api/v2/auth/reset-password Resets a logged in users password
GET /api/v2/events Views all events
POST /api/v2/events Adds an event
PUT /api/v2/events/ Edits an existing event
DELETE /api/v2/events/ Deletes an existing event
POST /api/v2/events//rsvp Sends an rsvp to a event

Tests

You will need Postman to run tests on api endpoints:

  1. Start the api server through your terminal by running flask run.

    $ flask run

  2. Start up postman. (Through postman, you can emulate all http verbs('PUT', 'GET', 'DELETE', 'POST',etc) as shown in screenshots below. For Postman installation, search for appropriate documentation. Postman
Test Driven Development
  1. cd Into the main directory.
  2. Run python tests.py to run tests on Bright Events Website RESTful apis.

    $ python tests.py Tests

To access the api documentation:

Access the api documentation at https://brighteventsapinowlive.herokuapp.com/apidocs/

Versioning

We use Github for versioning. Use this repository.