Skip to content

Commit

Permalink
Create project
Browse files Browse the repository at this point in the history
  • Loading branch information
omarciovsena committed Nov 25, 2018
0 parents commit 5964ab3
Show file tree
Hide file tree
Showing 217 changed files with 30,256 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version: 2
jobs:
test:
docker:
- image: circleci/node:10.7.0
- image: circleci/postgres:9.6.2-alpine
environment:
POSTGRES_USER: marciovsena
POSTGRES_DB: bibleapi_test

steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}

- run:
name: Install Dependencies
command: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- run:
name: Run tests
command: yarn test:circle

production:
docker:
- image: buildpack-deps:trusty

steps:
- checkout
- run: bash .circleci/setup-heroku.sh
- add_ssh_keys:
fingerprints:
- $HEROKU_SSH_FINGERPRINT
- deploy:
name: Deploy to Heroku if tests pass and branch is master
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
git push --force git@heroku.com:$HEROKU_APP_NAME.git HEAD:refs/heads/master
fi
workflows:
version: 2
test_deploy:
jobs:
- test
- production:
requires:
- test
filters:
branches:
only:
- master
17 changes: 17 additions & 0 deletions .circleci/setup-heroku.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
ssh-keyscan -H heroku.com >> ~/.ssh/known_hosts
# If you need access to the heroku CLI to run heroku commands in the deploy step add these lines:
# mkdir -p /usr/local/lib /usr/local/bin
# tar -xvzf heroku-linux-amd64.tar.gz -C /usr/local/lib
# ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku

cat > ~/.netrc << EOF
machine api.heroku.com
login $HEROKU_LOGIN
password $HEROKU_API_KEY
EOF

cat >> ~/.ssh/config << EOF
VerifyHostKeyDNS yes
StrictHostKeyChecking no
EOF
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
19 changes: 19 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
HOST=127.0.0.1
PORT=3333
NODE_ENV=development

APP_NAME=bibleAPI
APP_URL=http://${HOST}:${PORT}

CACHE_VIEWS=false

APP_KEY=

DB_CONNECTION=pg
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USER=marciovsena
DB_PASSWORD=
DB_DATABASE=bibleapi

HASH_DRIVER=bcrypt
14 changes: 14 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
HOST=127.0.0.1
PORT=3334
NODE_ENV=testing
APP_NAME=BibleApi
APP_URL=http://${HOST}:${PORT}
CACHE_VIEWS=false
APP_KEY=JpPCmPCvA4UrFrmRJv8wZg2MDICMaV2S
DB_CONNECTION=pg
DB_HOST=localhost
DB_PORT=5432
DB_USER=marciovsena
DB_PASSWORD=
DB_DATABASE=bibleapi_test
HASH_DRIVER=bcrypt
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Node modules
node_modules

# Adonis directory for storing tmp files
tmp

# Environment variables, never commit this file
.env

# The development sqlite file
database/development.sqlite

public/
dist/

apidoc/.gitignore

.nyc_output/
coverage/
29 changes: 29 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"description": "These are just examples for demonstration, nothing prescriptive",
"nyc": {
"check-coverage": true,
"per-file": true,
"lines": 99,
"statements": 99,
"functions": 99,
"branches": 99,
"include": [
"src/**/*.js"
],
"exclude": [
"src/**/*.spec.js"
],
"ignore-class-method": "methodToIgnore",
"reporter": [
"lcov",
"text-summary"
],
"extension": [
".js"
],
"cache": true,
"all": true,
"temp-dir": "./alternative-tmp",
"report-dir": "./test-repost"
}
}
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"semi": false,
"singleQuote": true,
"overrides": [
{
"files": "*.test.js",
"options": {
"semi": true
}
}
]
}
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# bibleApi Contributing Guide

Before submitting your contribution please read the guidelines.

- [Commit Guidelines](#commit-guidelines)
- [Issue Reporting Guidelines](#issue-reporting-guidelines)
- [Pull Request Guidelines](#pull-request-guidelines)

## Commit Guidelines

Commit messages should follow the [commit message convention](https://www.conventionalcommits.org/en/v1.0.0-beta.2/).

## 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.

- 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).

- Only create issues for the newest version.

- Create a declarative title and describe clearly the steps necessary to reproduce the issue. If an issue labeled "need repro" receives no further input from the issue author for more than 3 days, it will be closed.

- If you want to show your code please use [Codepen](http://codepen.io/pen/) or [JSFiddle](https://jsfiddle.net/) or [Postman](https://www.getpostman.com/)

- In case you found a solution by yourself try to explain how you fixed it. It could be useful for somebody else. 😃

## Pull Request Guidelines

- The `master` branch is basically just a snapshot of the latest stable release. All development should be done in dedicated branches. **Do not submit PRs against the `master` branch.**

- Make small commits as you work on the PR. They will be automatically squashed before merging.

- Provide convincing reason to add a new feature. Ideally you should open a suggestion/request issue first and have it greenlighted before working on it.

- If fixing a bug:
- If you are resolving a special issue, add the GitHub ID to your commit. E.g. `(fix something really ugly #xxx)`
- Provide detailed description of the bug in the PR.

Contribution based on the [vue-material](https://github.com/vuematerial/vue-material/blob/master/.github/CONTRIBUTING.md) and [docz](https://github.com/pedronauck/docz/blob/master/CONTRIBUTING.md) contribution files
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2018, Márcio Vinícius Sena
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<p align="center">
<img src="https://bibleapi.co/theme/images/brand.png" alt="bibleAPI" width="150">
</p>
<p align="center">
<a href="https://bibleapi.co">bibleAPI.co</a> is a RESTful API of the Holy Bible developed with <a href="https://adonisjs.com/">AdonisJs</a> 🚀
</p>

<p align="center">
<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://stats.uptimerobot.com/5PXmCNLM" title="Circle CI">
<img src="https://circleci.com/gh/marciovsena/bibleapi.svg?style=shield&circle-token=d5991d37b216f8da35b279de6789085300b5c75e" alt="Circle Ci"/>
</a>
<a href="https://github.com/marciosena/bibleapi/master/LICENSE.rst" title="license">
<img src="https://badgen.net/badge/license/BSD/blue" alt="BSD License">
</a>
</p>

## ► Documentation

- [📘 Documentation](https://doc.bibleapi.co) - apiDoc
- [😍 Home Page](https://bibleapi.co)

## ► Usage

- `GET https://bibleapi.co/api/books/:abbrev`
- `GET https://bibleapi.co/api/books/`
- `POST https://bibleapi.co/api/search/`
- body:
```
{
"version": ":version",
"search": ":work"
}
```
- `GET https://bibleapi.co/api/verses/:version/:book/:chapter/:number`
- `GET https://bibleapi.co/api/verses/:version/:book/:chapter/`

## ► Installation

#### Dependencies

- [Yarn](https://adonisjs.com/)
- [AdonisJs](https://adonisjs.com/)

#### Setup

- Download this source code into a working directory.
- Install the requirements: `yarn`
- Run migrations `yarn migrations`
- Run the server using the following command: `yarn start:dev`
- Visit `localhost:3333` to see the running website!

## ► Fair use policy

bibleAPI is free and open to use. The project is primarily an educational tool, and we will not tolerate denial of service attacks preventing people from learning.

## ► Contributing

Contributions, issues and feature requests are very welcome.
Please make sure to read the [Contributing Guide](/CONTRIBUTING.md) before making a pull request.

Visite our [trello](https://trello.com/b/VPGRzM36/biblieapi) board

## ► Contributor

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/bibleapi/commits?author=marciovsena "Code") [📖](https://github.com/marciovsena/bibleapi/commits?author=marciovsena "Documentation") [🐛](https://github.com/marciovsena/bibleapi/issues?q=author%marciovsena "Bug reports")
| :---: |
21 changes: 21 additions & 0 deletions ace
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict'

/*
|--------------------------------------------------------------------------
| Ace Commands
|--------------------------------------------------------------------------
|
| The ace file is just a regular Javascript file but with no extension. You
| can call `node ace` followed by the command name and it just works.
|
| Also you can use `adonis` followed by the command name, since the adonis
| global proxy all the ace commands.
|
*/

const { Ignitor } = require('@adonisjs/ignitor')

new Ignitor(require('@adonisjs/fold'))
.appRoot(__dirname)
.fireAce()
.catch(console.error)
15 changes: 15 additions & 0 deletions apidoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"description": "A RESTful API for Bible",
"name": "bibleAPI",
"title": "bibleAPI",
"url": "https://bibleapi.co/",
"header": {
"title": "bibleAPI",
"index": "Home",
"indexHref": "https://bibleapi.co"
},
"template": {
"forceLanguage": "en"
},
"version": "1.0.0"
}
1 change: 1 addition & 0 deletions apidoc/api_data.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apidoc/api_data.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apidoc/api_project.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apidoc/api_project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "name": "bibleAPI", "version": "1.0.0", "description": "A RESTful API for Bible", "title": "bibleAPI", "url": "https://bibleapi.co/", "header": { "title": "bibleAPI", "index": "Home", "indexHref": "https://bibleapi.co" }, "template": { "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2018-11-15T16:50:11.432Z", "url": "http://apidocjs.com", "version": "0.17.6" }}
Expand Down
Loading

0 comments on commit 5964ab3

Please sign in to comment.