Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
37b5b6f
HOTFIX reading mode markers (#303)
mmahalwy May 22, 2016
bc50cd3
Default api and files (#306)
mmahalwy May 22, 2016
30d2930
Reducing bundle size (#310)
mmahalwy May 24, 2016
2dcbd22
add default segments key (#313)
May 25, 2016
b6d7c7d
transitioning to al-quran al-kareem (#314)
May 25, 2016
7c6f7f5
Fix lint issues
azizur May 7, 2016
15350a8
Update Readme.md
azizur May 7, 2016
1a1ca97
Add devDependency Status
azizur May 7, 2016
5eb61c1
Merge pull request #317 from azizur/fix-lint-issues
ahmedre May 26, 2016
edc4b42
Update Readme for new developers
azizur May 26, 2016
07baa6f
Merge pull request #318 from azizur/update-readme
ahmedre May 26, 2016
2acaf1e
Code splitting assets (#321)
mmahalwy May 27, 2016
394403e
Autocomplete pointing to v2 suggest
mmahalwy May 27, 2016
c8f9299
Merge pull request #322 from quran/fix-auto-complete
ahmedre May 27, 2016
c0c840a
HOTFIX pretty-error dep (#323)
mmahalwy May 27, 2016
e59c56b
HOTFIX Search to the right route (#324)
mmahalwy May 27, 2016
8a6918a
No segments for non-segmented reciters (#325)
mmahalwy May 27, 2016
c233869
Adding sentry (#327)
mmahalwy Jun 1, 2016
9e4aab7
CDN images for surahinfo (#328)
mmahalwy Jun 2, 2016
884f1c5
Reduce data dehydration (#329)
mmahalwy Jun 2, 2016
9a11515
Search Action on homepage (#330)
mmahalwy Jun 2, 2016
78d0bcb
Descriptions for surahs (#331)
mmahalwy Jun 2, 2016
fa2b52f
Fixed head tags (#332)
mmahalwy Jun 3, 2016
936937b
audioplayer bug fixes, or more bugs (#335)
mmahalwy Jun 12, 2016
73f233b
Add sourcemaps to prod
mmahalwy Jun 12, 2016
6a5e9b5
Remove zero padding in urls
mmahalwy Jun 13, 2016
70fbbfd
(WIP) Issue #248 (#336)
abiodun0 Jun 15, 2016
2f493f2
correct waffle url. (#338)
thabti Jun 16, 2016
0f214b0
JS error on surah click (#349)
mahboob-awan Jun 25, 2016
e6d2a8e
Add Heroku generated app.json
mmahalwy Jun 25, 2016
4d0a9be
Ramadan Todo list (#343)
mmahalwy Jun 25, 2016
8b092af
Sourcemap for sentry (#352)
mmahalwy Jun 25, 2016
bd3e55c
contribution guideline (#355)
mahboob-awan Jun 25, 2016
540950f
Heroku pipeline trials (#354)
mmahalwy Jun 25, 2016
4a61d26
Heroku push (#356)
mmahalwy Jun 25, 2016
d23a3ac
Add zendesk widget (#358)
mmahalwy Jun 25, 2016
687f0f0
Fix font artifacts
ahmedre Jul 2, 2016
b0337c4
Merge pull request #366 from quran/fontfix
ahmedre Jul 2, 2016
186867e
Update font for page 237 to fix spacing in 12:17
ahmedre Jul 2, 2016
cf6bbc6
Merge pull request #370 from quran/fix237
ahmedre Jul 2, 2016
1e10b98
Feature/341 social share (#367)
thabti Jul 3, 2016
eed2ce3
Simplify audioplayer (#360)
mmahalwy Jul 3, 2016
1a21634
Fix sentry bug (#373)
mmahalwy Jul 3, 2016
50f210d
#372 colon separated surah/ayah (#374)
thabti Jul 3, 2016
948b91b
Re-output fonts with Apple option enabled
ahmedre Jul 4, 2016
d5c5293
Merge pull request #375 from quran/applefonts
ahmedre Jul 4, 2016
2706cf7
Tooltip options for translation and transliteration (#376)
mmahalwy Jul 4, 2016
b23a80c
Reading mode single line (#377)
mmahalwy Jul 4, 2016
30a7015
- ayah's have link (discuss, maybe not needed) (#379)
thabti Jul 6, 2016
74004e3
Added Mixpanel (#384)
mmahalwy Jul 9, 2016
85c0739
Remove footer links (#385)
mmahalwy Jul 9, 2016
fb35d4f
Fix json-ld (#386)
mmahalwy Jul 9, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding sentry (#327)
  • Loading branch information
mmahalwy committed Jun 1, 2016
commit c233869ab28d61f18698d609ff752c6d0adbb4f8
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ NODE_ENV=development
PORT=8000
API_URL=http://quran.com:3000
SEGMENTS_KEY=
SENTRY_KEY_CLIENT=
SENTRY_KEY_SERVER=
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM node:5.10.0

ENV NODE_ENV production
ENV API_URL http://api.quran.com:3000
ENV SENTRY_KEY_CLIENT https://44c105328ae544ae9928f9eb74b40061@app.getsentry.com/80639
ENV SENTRY_KEY_SERVER https://44c105328ae544ae9928f9eb74b40061:41ca814d33124e04ab450104c3938cb1@app.getsentry.com/80639
ENV PORT 8000

RUN apt-get -y update && apt-get -y install supervisor ssh rsync
Expand Down
3 changes: 3 additions & 0 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { syncHistoryWithStore } from 'react-router-redux';

import debug from 'debug';

import config from 'config';
import ApiClient from './src/helpers/ApiClient';
import createStore from './src/redux/create';
import routes from './src/routes';
Expand All @@ -23,6 +24,8 @@ const client = new ApiClient();
const store = createStore(browserHistory, client, window.__data);
const history = syncHistoryWithStore(browserHistory, store);

Raven.config(config.sentryClient).install()

window.quranDebug = debug;
window.ReactDOM = ReactDOM; // For chrome dev tool support

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"promise": "^7.0.4",
"proxy-middleware": "^0.14.0",
"qs": "^6.1.0",
"raven": "^0.11.0",
"raw-loader": "^0.5.1",
"react": "^0.14.8",
"react-bootstrap": "^0.28.4",
Expand Down
29 changes: 23 additions & 6 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import { ReduxAsyncConnect, loadOnServer } from 'redux-connect';
import createHistory from 'react-router/lib/createMemoryHistory';
import { Provider } from 'react-redux';
import cookie from 'react-cookie';
import raven from 'raven';
import errorhandler from 'errorhandler';


import config from 'config';
import expressConfig from 'server/config/express';

const pretty = new PrettyError();
const server = express();

expressConfig(server);

import routes from './src/routes';
Expand All @@ -26,6 +29,7 @@ import { setUserAgent } from './src/redux/modules/audioplayer';
import { setOption } from './src/redux/modules/options';

// Use varnish for the static routes, which will cache too
server.use(raven.middleware.express.requestHandler(config.sentryServer));

server.use((req, res, next) => {
cookie.plugToRequest(req, res);
Expand Down Expand Up @@ -59,28 +63,40 @@ server.use((req, res, next) => {
res.status(500).send(error);
} else if (renderProps) {
loadOnServer({...renderProps, store, helpers: { client }}).then(() => {
const component = ReactDOM.renderToString(
const component = (
<Provider store={store}>
<ReduxAsyncConnect {...renderProps} />
</Provider>
);

debug('Server', 'Rendering Application component into html');
debug('Server', 'Sending markup');
res.type('html');
res.setHeader('Cache-Control', 'public, max-age=31557600');
res.status(200).send('<!doctype html>\n' + ReactDOM.renderToString(
res.status(200);
debug('Server', 'Sending markup');
res.send('<!doctype html>\n' + ReactDOM.renderToString(
<Html
component={component}
store={store}
assets={webpack_isomorphic_tools.assets()}
/>
));
});
}).catch(next);
}
});
});

server.use(raven.middleware.express.errorHandler(config.sentryServer));

if (process.env.NODE_ENV === 'development') {
// only use in development
server.use(errorhandler());
} else {
server.use((req, res) => {
res.status(500);
res.send('OOPS');
});
}

const port = process.env.PORT || 8000;

export default function serve(cb) {
Expand All @@ -90,6 +106,7 @@ export default function serve(cb) {
==> ✅ Server is listening at http://localhost:${port}
==> 🎯 API at ${process.env.API_URL}
`);
Object.keys(config).forEach(key => config[key].constructor.name !== 'Object' && console.info(`==> ${key}`, config[key]));

cb && cb(this);
});
Expand Down
3 changes: 0 additions & 3 deletions server/config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import compression from 'compression';
import bodyParser from 'body-parser';
import logger from 'morgan';
import favicon from 'serve-favicon';
import errorhandler from 'errorhandler';
import useragent from 'express-useragent';
import cookieParser from 'cookie-parser';
import cors from 'cors';
Expand Down Expand Up @@ -55,6 +54,4 @@ export default function(server) {
server.use('/api', (req, res) => {
proxyApi.web(req, res);
});

// server.use(errorhandler()); // Must be last!
}
2 changes: 2 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module.exports = Object.assign({
host: process.env.HOST || 'localhost',
port: process.env.PORT,
api: process.env.API_URL,
sentryClient: process.env.SENTRY_KEY_CLIENT,
sentryServer: process.env.SENTRY_KEY_SERVER,
app: {
head: {
titleTemplate: `%s - ${title}`,
Expand Down
6 changes: 4 additions & 2 deletions src/helpers/Html.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom/server';
import Helmet from 'react-helmet';
import serialize from 'serialize-javascript';

class Html extends React.Component {
render() {
const { store, component, assets } = this.props;
const content = component ? ReactDOM.renderToString(component) : '';
const head = Helmet.rewind();
console.log(assets.styles);

return (
<html>
Expand All @@ -33,7 +34,7 @@ class Html extends React.Component {
<style id="fonts" />
</head>
<body>
<div id="app" dangerouslySetInnerHTML={{__html: component}} />
<div id="app" dangerouslySetInnerHTML={{__html: content}} />

<script
dangerouslySetInnerHTML={{
Expand Down Expand Up @@ -79,6 +80,7 @@ class Html extends React.Component {
}`
}} />
<script dangerouslySetInnerHTML={{__html: `window.__data=${serialize(store.getState())};`}} charSet="UTF-8"/>
<script src="https://cdn.ravenjs.com/3.0.4/raven.min.js" />
{Object.keys(assets.javascript).map((script, i) =>
<script src={assets.javascript[script]} key={i}/>
)}
Expand Down
2 changes: 2 additions & 0 deletions webpack/dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ module.exports = {
'process.env.BROWSER': true,
'process.env.API_URL': JSON.stringify(process.env.API_URL),
'process.env.SEGMENTS_KEY': JSON.stringify(process.env.SEGMENTS_KEY),
'process.env.SENTRY_KEY_CLIENT': JSON.stringify(process.env.SENTRY_KEY_CLIENT),
'process.env.SENTRY_KEY_SERVER': JSON.stringify(process.env.SENTRY_KEY_SERVER),
__SERVER__: false,
__CLIENT__: true,
__DEVELOPMENT__: true,
Expand Down
2 changes: 2 additions & 0 deletions webpack/prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ module.exports = {
'process.env.BROWSER': true,
'process.env.API_URL': JSON.stringify(process.env.API_URL),
'process.env.SEGMENTS_KEY': JSON.stringify(process.env.SEGMENTS_KEY),
'process.env.SENTRY_KEY_CLIENT': JSON.stringify(process.env.SENTRY_KEY_CLIENT),
'process.env.SENTRY_KEY_SERVER': JSON.stringify(process.env.SENTRY_KEY_SERVER),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
__SERVER__: false,
__CLIENT__: true,
Expand Down