Skip to content

Commit

Permalink
Merge branch 'master' into depfu/update/yarn/axios-0.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
omarciovsena authored Feb 15, 2024
2 parents 611597b + b1784a5 commit 843d1c5
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 124 deletions.
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

patreon: marciovsena
custom: ["https://picpay.me/marciovsena"]
patreon: omarciovsena
custom: ["https://picpay.me/omarciovsena"]
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Commit messages should follow the [commit message convention](https://www.conven

## Issue Reporting Guidelines

- Do not create questions. The issue list is exclusively for reports, bugs and feature requests. Use the [Twitter](https://twitter.com/marciovsena) instead.
- Do not create questions. The issue list is exclusively for reports, bugs and feature requests. Use the [Twitter](https://twitter.com/omarciovsena) instead.

- Always search for your issue first. It may have already been answered, planned or fixed in some branch. New features will be planned on [Trello](https://trello.com/b/VPGRzM36).

Expand Down
19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<a href="https://www.patreon.com/join/marciovsena" target="_blank">
<a href="https://www.patreon.com/join/omarciovsena" target="_blank">
<img src="https://cdn-std.dprcdn.net/files/acc_649651/plrSCT" height="80" alt="Patreon">
</a>
</p>
Expand All @@ -14,10 +14,10 @@
<a href="https://stats.uptimerobot.com/5PXmCNLM" title="Uptimerobot">
<img src="https://img.shields.io/uptimerobot/ratio/m778918918-3e92c097147760ee39d02d36.svg" alt="Uptimerobot">
</a>
<a href="https://github.com/marciovsena/abibliadigital/blob/dev/LICENSE" title="license">
<a href="https://github.com/omarciovsena/abibliadigital/blob/dev/LICENSE" title="license">
<img src="https://badgen.net/badge/license/BSD/blue" alt="BSD License">
</a>
<a href="https://codeclimate.com/github/marciovsena/abibliadigital/maintainability"><img src="https://api.codeclimate.com/v1/badges/2cf1c4940336ad7911be/maintainability" /></a>
<a href="https://codeclimate.com/github/omarciovsena/abibliadigital/maintainability"><img src="https://api.codeclimate.com/v1/badges/2cf1c4940336ad7911be/maintainability" /></a>
<a href="https://discord.gg/Te3fkHg"><img src="https://img.shields.io/discord/722477891102834789.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2" /></a>
</p>

Expand All @@ -27,7 +27,7 @@
- [Setup](#setup)
- [Setup using Docker](#setup-using-docker)
- [Fair use policy](#fair-use-policy)
- [Documentation](https://github.com/marciovsena/abibliadigital/blob/master/DOCUMENTATION.md)
- [Documentation](https://github.com/omarciovsena/abibliadigital/blob/master/DOCUMENTATION.md)
- [Credits and Thanks](#credits-and-thanks)
- [Contributing](#contributing)
- [Contributor](#contributor)
Expand Down Expand Up @@ -78,15 +78,6 @@ If you do not want to install Mongo, Redis, Node and Yarn, follow these steps.
### Steps

- Download this source code into a working directory. (Keep the directory name as "abibliadigital")
- Create `.env` file:

```
MONGODB_URI=mongodb://abibliadigital-mongo/abibliadigital
NODE_ENV="development"
SECRET_KEY=""
REDIS_URL="redis://abibliadigital-redis"
```

- Run the project using the following command: `docker-compose up`
- Visit `localhost:3000/api/check` to see the running api!

Expand Down Expand Up @@ -117,5 +108,5 @@ Visit our [trello](https://trello.com/b/VPGRzM36/biblieapi) board
Created and maintained by:

<!-- prettier-ignore -->
| [<img src="https://avatars0.githubusercontent.com/u/3450717?s=460&v=4" width="60px;"/><br /><sub><b>Márcio Sena</b></sub>](https://github.com/marciovsena)<br />[💻](https://github.com/marciovsena/abibliadigital/commits?author=marciovsena "Code") [📖](https://github.com/marciovsena/abibliadigital/commits?author=marciovsena "Documentation") [🐛](https://github.com/marciovsena/abibliadigital/issues?q=author%3Amarciovsena "Bug reports")
| [<img src="https://avatars0.githubusercontent.com/u/3450717?s=460&v=4" width="60px;"/><br /><sub><b>Márcio Sena</b></sub>](https://github.com/omarciovsena)<br />[💻](https://github.com/omarciovsena/abibliadigital/commits?author=marciovsena "Code") [📖](https://github.com/omarciovsena/abibliadigital/commits?author=omarciovsena "Documentation") [🐛](https://github.com/omarciovsena/abibliadigital/issues?q=author%3Aomarciovsena "Bug reports")
| :---: |
14 changes: 12 additions & 2 deletions controllers/verse.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,18 @@ export const search = async (req, res) => {
var expression = new RegExp(
'' +
search
.toLowerCase()
.split(' ')
.map(function (word) {
return '(?=.*\\b' + word + '\\b)'
return '(?=.*' + diacriticSensitiveRegex(word) + ')'
})
.join('') +
'.+'
)

const verses = await Verse.find({
version,
text: expression
text: {$regex: expression, $options: 'i' }
})

res.json({
Expand Down Expand Up @@ -168,3 +169,12 @@ const getItem = async params => {
version
})
}

const diacriticSensitiveRegex = (string = '') => {
return string
.replace(/a/g, '[a,á,à,ä,â]')
.replace(/e/g, '[e,é,ë,è]')
.replace(/i/g, '[i,í,ï,ì]')
.replace(/o/g, '[o,ó,ö,ò]')
.replace(/u/g, '[u,ü,ú,ù]')
}
10 changes: 8 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ version: '3'
services:
abibliadigital:
build: ./docker-api
command: ["bash","/usr/src/api/start.sh"]
command: [ "bash", "/usr/src/api/start.sh" ]
ports:
- "3000:3000"
expose:
- "3000"
container_name: abibliadigital
environment:
- MONGODB_URI=mongodb://abibliadigital-mongo/abibliadigital
- NODE_ENV="development"
- SECRET_KEY=""
- REDIS_URL=redis://abibliadigital-redis
volumes:
- ../abibliadigital:/usr/src/api
depends_on:
Expand All @@ -34,5 +39,6 @@ services:
- "6379:6379"
expose:
- "6379"
restart: always
volumes:
- $PWD/redis-data:/var/lib/redis
- ../redis-data:/var/lib/redis
2 changes: 1 addition & 1 deletion helpers/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const genericError = (res, err) => {
console.error('err', err)
return res.status(500).json({
msg: 'Oops! An unexpected error has occurred, create an [issue](https://github.com/marciovsena/abibliadigital/issues/new) with the information of this request.',
msg: 'Oops! An unexpected error has occurred, create an [issue](https://github.com/omarciovsena/abibliadigital/issues/new) with the information of this request.',
err
})
}
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.3.1",
"description": "A RESTful API for Bible (nvi, ra, acf, kjv, bbe)",
"main": "index.js",
"repository": "https://github.com/marciovsena/abibliadigital",
"repository": "https://github.com/omarciovsena/abibliadigital",
"author": "Márcio Sena <contato@marciosena.com.br>",
"license": "MIT",
"private": false,
Expand Down Expand Up @@ -31,18 +31,18 @@
"@babel/preset-env": "^7.14.2",
"@sendgrid/mail": "^6.5.5",
"@zeit/next-css": "^1.0.1",
"body-parser": "^1.19.0",
"body-parser": "^1.20.2",
"chalk": "^3.0.0",
"cors": "^2.8.5",
"dotenv": "^8.6.0",
"express": "^4.17.3",
"generate-password": "^1.6.0",
"express": "^4.18.2",
"generate-password": "^1.7.0",
"i18n": "^0.8.6",
"jest": "^24.9.0",
"jsonwebtoken": "^8.5.1",
"md5": "^2.3.0",
"moment": "^2.29.1",
"mongoose": "^5.13.8",
"moment": "^2.29.4",
"mongoose": "^5.13.20",
"pug": "^3.0.2",
"redis": "^3.1.2",
"supertest": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion public/theme-v2/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ nav .container {
border-right: 1px solid #cccccc;
display: inline-block;
font-family: "monaco", "Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace;
font-size: 12px;
font-size: 10px;
padding: 18px 20px;
width: 230px;
}
Expand Down
18 changes: 9 additions & 9 deletions views/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ body
li: button.icon-close.menu-toggle
li: a.text.section-scroll(href='#about' title=__('aboutTitle'))= __('about')
li: a.text.section-scroll(href='#howToUse' title=__('howToUseTitle'))= __('howToUse')
li: a.text(href='http://github.com/marciovsena/abibliadigital' target='_blank' title=__('documentationTitle'))= __('documentation')
li: a.text(href='http://github.com/omarciovsena/abibliadigital' target='_blank' title=__('documentationTitle'))= __('documentation')
li: a.text.section-scroll(href='#donate' title=__('donateTitle'))= __('donate')
li: a.icon-github(href='http://github.com/marciovsena/abibliadigital' target='_blank' title=__('githubTitle'))
li: a.icon-twitter(href='http://twitter.com/marciovsena' target='_blank' title=__('contactTitle'))
li: a.icon-github(href='http://github.com/omarciovsena/abibliadigital' target='_blank' title=__('githubTitle'))
li: a.icon-twitter(href='http://twitter.com/omarciovsena' target='_blank' title=__('contactTitle'))
li: a.icon-discord(href='https://t.co/CFSf4CY47T' target='_blank' title=__('contactTitle'))
li: a(href=__('changeLanguageLink') title=__('changeLanguageTitle')): img(src=__('changeLanguageImage') alt=__('changeLanguageTitle'))
// Header
Expand All @@ -68,10 +68,10 @@ body
.bg
.bg
ul#social-links
li: a.icon-github(href='http://github.com/marciovsena/abibliadigital' target='_blank' title=__('githubTitle'))
li: a.icon-twitter(href='http://twitter.com/marciovsena' target='_blank' title=__('contactTitle'))
li: a.icon-github(href='http://github.com/omarciovsena/abibliadigital' target='_blank' title=__('githubTitle'))
li: a.icon-twitter(href='http://twitter.com/omarciovsena' target='_blank' title=__('contactTitle'))
li: a.icon-discord(href='https://t.co/CFSf4CY47T' target='_blank' title=__('contactTitle'))
li: a.icon-patreon(href='https://www.patreon.com/marciovsena' target="_blank" title=__('donate'))
li: a.icon-patreon(href='https://www.patreon.com/omarciovsena' target="_blank" title=__('donate'))
// About Section
section#about
.container
Expand Down Expand Up @@ -100,14 +100,14 @@ body
h2= __('bannerTitle')
p= __('bannerDescription')
.col
a.btn-primary(href='https://github.com/marciovsena/abibliadigital/blob/master/DOCUMENTATION.md' target='_blank' title=__('documentationTitle'))= __('bannerButton')
a.btn-primary(href='https://github.com/omarciovsena/abibliadigital/blob/master/DOCUMENTATION.md' target='_blank' title=__('documentationTitle'))= __('bannerButton')
// How To Use
section#howToUse
.container
h2= __('howToUse')
p.font-p.mg-bt-30
| #{__('options')}: books, books/gn, verses/nvi/gn/1, verses/acf/gn/1/1
a(href='https://github.com/marciovsena/abibliadigital/blob/master/DOCUMENTATION.md/' target='_blank' title=__("documentation"))= __('andMore')
a(href='https://github.com/omarciovsena/abibliadigital/blob/master/DOCUMENTATION.md/' target='_blank' title=__("documentation"))= __('andMore')
form#form-1
label#basic-addon3(for='path') https://www.abibliadigital.com.br/api/
input#path(type='text' aria-describedby='basic-addon3' value='verses/nvi/sl/23' placeholder='verses/{version}/{book}/{chapter}/{number}')
Expand All @@ -119,7 +119,7 @@ body
h2= __('contributeTitle')
p.font-p.mg-bt-30
| #{__('contributeDescription')}
a(href='https://www.patreon.com/marciovsena' target='_blank')
a(href='https://www.patreon.com/omarciovsena' target='_blank')
img(src='https://cdn-std.dprcdn.net/files/acc_649651/plrSCT' style='height: 80px;' alt='Patreon')
// Footer
footer
Expand Down
2 changes: 1 addition & 1 deletion views/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"contributeDescription": "From one-time or monthly donations you can contribute to the project, prioritize new tasks and accelerate new features.",
"contributeTitle": "Contribute to the project!",
"counterSubtitle": "requests",
"counterTitle": "+1million",
"counterTitle": "+5million",
"credits": "Copyright © 2018-2022 ABíbliaDigital. All rights reserved.",
"credits2": "For more information, contact us",
"description": "Bible API - RESTful API with multiple versions of the Holy Bible in 4 languages",
Expand Down
2 changes: 1 addition & 1 deletion views/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"contributeDescription": "A partir de doações pontuais ou mensais é possível contribuir com o projeto, priorizar novas tarefas e acelerar novas funcionalidades.",
"contributeTitle": "Contribua com o projeto!",
"counterSubtitle": "requisições",
"counterTitle": "+1milhão",
"counterTitle": "+5milhões",
"credits": "Copyright © 2018-2022 ABíbliaDigital. Todos os direitos reservados.",
"credits2": "Para mais informações, entre em contato por",
"description": "Bíblia API - API REST com múltiplas versões da Bíblia Sagrada em 4 idiomas",
Expand Down
Loading

0 comments on commit 843d1c5

Please sign in to comment.