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
- 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
-
Flask and Flask-api
- Clone the Github repository:
$ git clone https://github.com/Kalela/BrightEvents.git
- Install pip
$ sudo apt-get install python-pip python-dev build-essential $ sudo pip install --upgrade pip
- Install virtualenv
$ sudo pip install --upgrade virtualenv
- Set up autoenv using pip and create a .env file for it to access every time this path is accessed.
$ pip install autoenv
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.
- Install all application requirements using pip
$ pip install -r requirements.txt To check if installed run pip freeze to see all installed packages
All front end designs are located in the designs folder.
- Run a terminal such as cmd on windows or terminal on ubuntu.
- 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
If your lucky (winks) You won't get any errors and server will be up on localhost port 5000.
- Now you can test your endpoints using Postman or Curl. Your good to go.
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 |
You will need Postman to run tests on api endpoints:
- Start the api server through your terminal by running flask run.
$ flask run
- 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.
- cd Into the main directory.
- Run python tests.py to run tests on Bright Events Website RESTful apis.
Access the api documentation at https://brighteventsapinowlive.herokuapp.com/apidocs/
We use Github for versioning. Use this repository.