Skip to content

ertongcan/storyly_case_study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

storyly-api

Case Study

Run

https://github.com/ertongcan/storyly_case_study.git
cd storyly_case_study
COPY .env.sample AS .env

Setup

python3 -m venv venv
source venv/bin/activate OR \venv\Scripts\activate
pip install -r requirements.txt

DB Setup

Follow these steps run models migration, at the end of below commands, models in the app will be created on specified db(from .env file)

set FLASK_APP=api/__init__.py
flask db init
flask db migrate
flask db upgrade

Then

flask run

Run Tests

python tests.py

Endpoints

GET '/stories/<string:token>' - get stories by given app token
GET '/stories_enhanced/<string:token>' - get stories by app token (peformance optimized version)
POST '/event/<string:token>' - save user events
GET '/event/dau/<string:token>/<string:event_date>' - get daily active users

Load Test

Tests are taken place using apache ab testing tool by following command;

ab -k -n 100 -c 10 <URL_TO_TEST>

Test Results

Without optimization


alt text

Optimized


alt text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages