-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07eef45
commit 3a6d0b8
Showing
42 changed files
with
800 additions
and
10,965 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const fs = require('fs') | ||
|
||
const dir = fs.readdirSync(__dirname + '/database') | ||
|
||
let npmScripts = '' | ||
|
||
dir.forEach(file => { | ||
if (file.split('.')[1] === 'bson') { | ||
let name = file.split('.')[0] | ||
|
||
npmScripts += `npm run import-${name} && ` | ||
|
||
console.log( | ||
`"import-${name}":"mongorestore -d quran -c ${name} database/${file}",` | ||
) | ||
} | ||
}) | ||
|
||
console.log(npmScripts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { GraphQLServer } = require('graphql-yoga') | ||
|
||
require('dotenv').config() | ||
require('./dbconnect') | ||
const Ayah = require('./resolvers/Ayah') | ||
const Query = require('./resolvers/Query') | ||
const Word = require('./resolvers/Word') | ||
const server = new GraphQLServer({ | ||
typeDefs: __dirname + '/schema.graphql', | ||
resolvers: { | ||
Query, | ||
Ayah, | ||
Word, | ||
}, | ||
}) | ||
|
||
server.start( | ||
{ | ||
port: 5000, | ||
}, | ||
({ port }) => { | ||
console.log('Server working at http://localhost:' + port) | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const mongoose = require('mongoose') | ||
|
||
let suraScheema = mongoose.Schema({ | ||
ar1: String, | ||
ar2: String, | ||
ar3: String, | ||
ar4: String, | ||
ar5: String, | ||
ayah: String, | ||
count: String, | ||
lemma: String, | ||
pos1: String, | ||
pos2: String, | ||
pos3: String, | ||
pos4: String, | ||
pos5: String, | ||
root_ar: String, | ||
surah: String, | ||
verb_type: String, | ||
verf_form: String, | ||
word: String, | ||
}) | ||
|
||
module.exports = mongoose.model('Corpus', suraScheema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const mongoose = require('mongoose') | ||
|
||
let suraScheema = mongoose.Schema({ | ||
ayah: String, | ||
primary: String, | ||
sura: String, | ||
text: String, | ||
}) | ||
|
||
module.exports = mongoose.model('Translation', suraScheema, 'tr_en_sahih') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const mongoose = require('mongoose') | ||
|
||
let suraScheema = mongoose.Schema({ | ||
ayah: String, | ||
bn: String, | ||
en: String, | ||
in: String, | ||
sura: String, | ||
word: String, | ||
}) | ||
|
||
module.exports = mongoose.model('Word', suraScheema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
{"version":2,"name":"quran","builds":[{"src":"**/*.js","use":"@now/node"}]} | ||
{ | ||
"version": 1, | ||
"name": "quran-graphql-api" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,39 @@ | ||
{ | ||
"name": "express-basic", | ||
"version": "1.0.0", | ||
"description": "hello world", | ||
"main": "true", | ||
"author": "anwarulislam", | ||
"license": "MIT", | ||
"scripts": { | ||
"start": "nodemon index.js" | ||
}, | ||
"dependencies": { | ||
"bcryptjs": "^2.4.3", | ||
"colors": "^1.3.3", | ||
"cookie-parser": "^1.4.4", | ||
"dotenv": "^8.0.0", | ||
"express": "^4.16.4", | ||
"express-graphql": "^0.8.0", | ||
"express-session": "^1.16.1", | ||
"express-validator": "^5.3.1", | ||
"graphql": "^14.3.0", | ||
"mongoose": "^5.5.7", | ||
"mongoose-paginate-v2": "^1.2.1", | ||
"nodemon": "^1.19.0" | ||
} | ||
"name": "quran-project-backend-api", | ||
"version": "1.0.0", | ||
"description": "quran-project-backend-api", | ||
"main": "true", | ||
"author": "anwarulislam", | ||
"license": "MIT", | ||
"scripts": { | ||
"start": "nodemon index.js", | ||
"import-ayah": "mongorestore -d quran -c ayah database/ayah.bson", | ||
"import-bookmarks": "mongorestore -d quran -c bookmarks database/bookmarks.bson", | ||
"import-corpus": "mongorestore -d quran -c corpus database/corpus.bson", | ||
"import-footnotes_mhk": "mongorestore -d quran -c footnotes_mhk database/footnotes_mhk.bson", | ||
"import-notes": "mongorestore -d quran -c notes database/notes.bson", | ||
"import-quran_index": "mongorestore -d quran -c quran_index database/quran_index.bson", | ||
"import-surah": "mongorestore -d quran -c surah database/surah.bson", | ||
"import-tafsir_kathir": "mongorestore -d quran -c tafsir_kathir database/tafsir_kathir.bson", | ||
"import-tafsir_kathir_segment": "mongorestore -d quran -c tafsir_kathir_segment database/tafsir_kathir_segment.bson", | ||
"import-tr_en_sahih": "mongorestore -d quran -c tr_en_sahih database/tr_en_sahih.bson", | ||
"import-verb_with_forms": "mongorestore -d quran -c verb_with_forms database/verb_with_forms.bson", | ||
"import-words": "mongorestore -d quran -c words database/words.bson", | ||
"seed-data": "npm run import-ayah && npm run import-bookmarks && npm run import-corpus && npm run import-footnotes_mhk && npm run import-notes && npm run import-quran_index && npm run import-surah && npm run import-tafsir_kathir && npm run import-tafsir_kathir_segment && npm run import-tr_en_sahih && npm run import-verb_with_forms && npm run import-words" | ||
}, | ||
"dependencies": { | ||
"bcryptjs": "^2.4.3", | ||
"colors": "^1.3.3", | ||
"cookie-parser": "^1.4.4", | ||
"dotenv": "^8.0.0", | ||
"express": "^4.16.4", | ||
"express-graphql": "^0.8.0", | ||
"express-session": "^1.16.1", | ||
"express-validator": "^5.3.1", | ||
"graphql": "^14.3.0", | ||
"graphql-yoga": "^1.17.4", | ||
"mongoose": "^5.5.7", | ||
"mongoose-paginate-v2": "^1.2.1", | ||
"nodemon": "^1.19.0" | ||
} | ||
} |
Oops, something went wrong.
3a6d0b8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deployment failed with the following error: