Skip to content

Commit

Permalink
Release v3 (#145)
Browse files Browse the repository at this point in the history
* started v3 with rails 5.0.1

* added models, and data migrations task for few tables

* added more data transfer logic and fixed some models

* don't need encrypted segments

* added translation importer

* time to start writing api, done with data transfer

* added todos, and fixed some polymorphic relation

* send exception to raven, we are already using this on frontend!

* working on serializers

* added translated name of chapters

* added chapter info and verse endpoint

* implemented verse serializer

* working on options controller

* added options endpoint

* finished options controller

* added language filters, and chapter info data

* Generate nginx directory as part of Dockerfile

* removed test code

* API v3  (#82)

* started v3 with rails 5.0.1

* added models, and data migrations task for few tables

* added more data transfer logic and fixed some models

* don't need encrypted segments

* added translation importer

* time to start writing api, done with data transfer

* added todos, and fixed some polymorphic relation

* send exception to raven, we are already using this on frontend!

* working on serializers

* added translated name of chapters

* added chapter info and verse endpoint

* implemented verse serializer

* working on options controller

* added options endpoint

* finished options controller

* added language filters, and chapter info data

* removed test code

* moving ES mapping to related models

* updated readme

* moved db submodule to dumps

* removed v2 controller

* removed annotate from gem lock

* Fix build

* wip

* added simple name of chapters

* moved searchable content to one ES index

* removed transliteration csv

* wip on search

* added ids in api

* removed root from response

* added roots back (#98)

* Added limit and offset for verses (#99)

* fixed language name and segment are array

* added offset and limit to verses endpoint

* Sentry only in production

* Add Page Number to Word Serializer

* Media Content default, translations evaluate

* Translations options approved

* Linting

* added image response

* Take searchable out for better query

* rubocop

* added bare min search

* added missing query dsl file

* added image in verse respose

* added font code for v3, removed image model

* setup ruby path for rvm

* Remove extra passenger_ruby from nginx config

This causes nginx to fail to start the backend server.

* Revert change to passenger_ruby

passenger_ruby should not be set to rvm when using Phusion, at least for now.

* added footnote endpoint (#112)

* added tafsirs endpoint

* Bump phusion to 0.9.20 to bump Ruby to 2.3.3

* removed v2 models and added corpus data

* added lemma and stems

* migrated remaining tables from v2

* reannotated models

* fixed typo

* removed v2 search

* enabled search and we don't need to query languages with search. (#117)

* enabled search and we don't to query languages with search.

* updated rake task to import ES

* removed v2 models (#116)

* added slack in readme (#120)

* Fixes pagination with offset (#121)

* Remove unnecessary Elasticsearch tasks

Elasticsearch runs sandboxed away from api, so these files aren't
available to api anyway.

* Performance (#123)

* WIP

* Preloading magic

* style

* Fallback on EN (#126)

* Indentation style (#127)

* Added boost to translation search for language selected by user (#130)

* Added boost to translation search for language selected by user

* Ruby-esq style for returns

* Show routes for juz, pages, words (#128)

* Audio files api (#132)

* Fixes #131 Puma server (#133)

* added cache headers, and minor performance imporvements

* added more source fields for trans index and minor fixes for pagination (#137)

* Slugs (#138)

* added slug and minor changes in search

* added resource id to translation json

* added slug to content resource

* added missing attrs for search

* word has one audio, no need for another join (#141)

* Search suggestions (#143)

* Added suggestion API

* bare minimum suggestions

* enable get transaltion using slug

* increase highlight size

* we don't need to highlight ayah text for search!

* rollback and fixed bug. User can get multiple translation using ID or slug or resource (#144)
  • Loading branch information
mmahalwy authored Apr 19, 2017
1 parent 16884dd commit dfbf90f
Show file tree
Hide file tree
Showing 283 changed files with 5,386 additions and 57,922 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
/tmp
.*.sw*
.tmp/

data/*
config/deploy.rb
vendor/cache
vendor/bundle/
db
dumps
dump.rdb
passenger.*
.idea/*
.DS_Store
.ruby-version
.ruby-gemset
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "db"]
path = db
path = dumps/db
url = https://github.com/quran/quran.com-api-db.git
5 changes: 0 additions & 5 deletions .history

This file was deleted.

2 changes: 0 additions & 2 deletions .notes/create.view

This file was deleted.

34 changes: 0 additions & 34 deletions .notes/how.to.copy

This file was deleted.

2 changes: 0 additions & 2 deletions .notes/icu

This file was deleted.

2 changes: 0 additions & 2 deletions .notes/term.vector

This file was deleted.

8 changes: 0 additions & 8 deletions .notes/update.lemma.and.stem

This file was deleted.

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ before_install:
before_script:
- psql -c 'create role quran_dev with login createdb;' -U postgres
- bundle exec rake db:create
- bundle exec rake db:migrate
- bundle exec rake db:load_pg_dump

script: "bundle exec rspec"
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM phusion/passenger-customizable:0.9.19
FROM phusion/passenger-customizable:0.9.20

# set correct environment variables
ENV HOME /root
Expand Down Expand Up @@ -37,7 +37,7 @@ echo vm.overcommit_memory = 1 >> /etc/sysctl.conf
WORKDIR /tmp
ADD Gemfile Gemfile
ADD Gemfile.lock Gemfile.lock
RUN bundle install
RUN bundle install --without development test

# setup the app
RUN mkdir /home/app/quran
Expand All @@ -48,6 +48,11 @@ RUN chown -R app log
RUN chown -R app public
RUN chown app Gemfile
RUN chown app Gemfile.lock
RUN mkdir tmp
RUN chown -R app tmp

# let log files for nginx work
RUN mkdir -p /var/log/nginx/api.quran.com

# cleanup apt
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
89 changes: 31 additions & 58 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,77 +1,58 @@
source 'https://rubygems.org'
ruby '2.3.1'
ruby '2.3.3'

git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
#gem 'rails', '4.1.1'
gem 'rails', '4.2.6'
gem 'rails', '~> 5.0.1'

# Use postgresql as the database for Active Record
gem 'pg', '~> 0.19.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'execjs'
gem 'therubyracer', platforms: :ruby

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
gem 'spring-commands-rspec', group: :development
gem 'therubyracer', platforms: :ruby

gem 'oj'
gem 'oj_mimic_json'

gem 'rails-api'

gem 'apipie-rails'
gem 'active_model_serializers', '~> 0.10.0'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]
#
# Rails console to work
gem 'rb-readline'

# Detect the language
gem 'whatlanguage'
gem 'prose'

# ActiveModel like for ruby classes
gem 'virtus'

# composite primary keys
gem 'composite_primary_keys', {
:git => 'git://github.com/composite-primary-keys/composite_primary_keys.git',
:branch => 'ar_4.2.x'
}
gem 'puma', '~> 3.0'

# Printing in console made easy. Simple run or add Rails.logger.ap #YOUR_VAR
gem 'awesome_print'
# Http request
gem 'httparty', require: false

# Elasticsearch
gem 'elasticsearch'
gem 'elasticsearch-model'
gem 'elasticsearch-rails'

# This is for batching the Content::Translation, batches based on the string primary keys
# gem 'batchelor'
gem 'redis-rails'

gem 'rack-cors'

# Paging the results
gem 'kaminari'

# This is to run the rake task for importing in parallel
gem 'parallel'
# Will provide a progress bar as the import happens
gem 'ruby-progressbar'
gem "sentry-raven"

gem "passenger"
gem 'virtus'

group :development, :test do
gem 'pry-byebug'
Expand All @@ -83,22 +64,14 @@ group :development, :test do
end

group :development do
gem 'jazz_hands', github: 'nixme/jazz_hands', branch: 'bring-your-own-debugger'
gem 'web-console', '~> 2.0'
gem 'annotate'
gem 'ruby-progressbar'
gem 'byebug', platform: :mri
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-commands-rspec'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'mechanize'
gem 'bullet'
gem 'meta_request'
end

gem 'elasticsearch'

# To allow CORS for the angular project
# https://github.com/cyu/rack-cors
gem 'rack-cors', :require => 'rack/cors'

gem 'httparty'

gem 'annotate'

gem 'actionpack-page_caching'
gem 'actionpack-action_caching'

gem 'redis-rails'
gem 'gibberish', '2.0.0'
Loading

0 comments on commit dfbf90f

Please sign in to comment.