Bright events provides a platform for event organizers to create and manage different types of events while making them easily accessible to target markets
- python3
- postgresSQL Databse Engine
-
You can also view the Designs Here
-
Link to Hosted demo
-
Access the API Documentation Here
-
Clone the Github repo to your machine
git clone https://github.com/frankip/bright_events.git
-
change the directory to the project by
cd bright_events
-
change to the active branch
git checkout development
-
Create a virtual enviroment
virtualenv -p python3 venv
-
Activate the enviroment
source venv/bin/activate
-
Install the project requirements
pip install -r requirements.txt
-
Intall Postgress
sudo apt-get install postgresql postgresql-contrib
-
switch to postgress account
sudo -i -u postgres
-
create database
psql -c "CREATE DATABASE flask_api;" -U postgres psql -c "CREATE DATABASE test_db;" -U postgres
-
create user and set password
psql -c "CREATE USER test WITH PASSWORD 'admin';" -U postgres
-
Run migrations
python manage.py db init python manage.py db migrate python manage.py db upgrade
on the terminal run
export DATABASE_URL='postgresql://postgres:@localhost/flask_api'
To test our project on your terminal run
export FLASK_APP=run.py
then
flask run
on your browser open up http://127.0.0.1:5000/api/events/
the endpoints for the API are
POST /api/auth/register/
POST /api/auth/login/
POST /api/auth/logout/
POST /api/auth/reset-password/
POST /api/events/
GET /api/events/
GET /api/events/<int:key>/
PUT /api/events/<int:key>/
POST /api/events/<int:key>/rsvp
GET /api/events/<int:key>/rsvp
use the API documentation to get sample data of payload Here
do not forget to include the headers on your postman
- Content-Type: application/json
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiO
make sure to register and login first to get the authorization token. Copy the token and paste it into the header section, creating an Authorization header. Don't forget to put the word Bearer before the token with a space separating them like this:
Bearer eyJ0eXATQsImV4cCI6ViIjo1fQ.8ju7doEn6Q8VJ6WXAnBHKlyn8KCkMr....
curl -H "Accept: application/json"\-H "Content-type: application/json" -X POST \
-d '{"email": "test@test.com", "password": "test_password"}' \
http://127.0.0.1:5000/api/auth/register/
curl -H "Accept: application/json" \
-H "Content-type: application/json" -X POST \
-d '{"email": "test@test.com", "password": "test_password"}' \
http://127.0.0.1:5000/api/auth/login/