Skip to content

Commit

Permalink
Merge 6589e7a into 54a22d4
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnickii committed Aug 27, 2019
2 parents 54a22d4 + 6589e7a commit 7034578
Show file tree
Hide file tree
Showing 135 changed files with 16,418 additions and 314 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env"],
"plugins": [["@babel/transform-runtime"]]
}
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: process.env.COVERALLS_REPO_TOKEN
25 changes: 25 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
PORT = 8000
NODE_ENV = production
HOST = "127.0.0.1"
DB_USER ="xxxxxx"
DB_NAME = "authors-heaven"
DB_PASSWORD = "postgres"
DB_PORT = 5432
SECRET_KEY=qwerty
API_VERSION=v1
ADMIN_PASSWORD='xxxxxx'
DB_NAME_TEST=xxxxx
SendGridApiKey = xxxxxxxxxLfYZ24S12bPZR0-Hxxxxxxx
USER_PASSWORD='xxxxxxxxx'
FACEBOOK_ID=xxxxxxxxxxxxxxx
FACEBOOK_SECRET='xxxxxxxxxxxx'
FACEBOOK_CALLBACK_URL='hxxxxxxxxxx'
GOOGLE_SECRET='xxxxxxxxxxx'
GOOGLE_ID='87822198681xxxxxxxxxxxxxxsercontent.com'
GOOGLE_CALLBACK_URL='http://localhost:3000/login/callback'
TWITTER_ID='ghgu'
TWITTER_SECRET='ggug'
CLOUDINARY_API_KEY=xxxxxxxxxxxxxxxxx
CLOUDINARY_SECRET_KEY=xxxxxxxxxxxxxxxx
CLOUDINARY_NAME=xxxxxxxxxxxxx
TWITTER_CALLBACK_URL='ghgfh'
24 changes: 24 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# nyc test coverage
.nyc_output

# Npm package lock file
package-lock.json


# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
node_modules

# Coverage directory used by tools like istanbul
coverage

# Migrations
src/migrations

# Seeders
src/api/seeders

# Models
src/models
42 changes: 42 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
root: true,
extends: "airbnb-base",
env: {
node: true,
es6: true,
mocha: true
},
"parserOptions": {
"sourceType": "module",
},
rules: {
"one-var": 0,
"one-var-declaration-per-line": 0,
"new-cap": 0,
"consistent-return": 0,
"no-param-reassign": 0,
"comma-dangle": 0,
curly: ["error", "multi-line"],
"import/no-unresolved": [2, { commonjs: true }],
"no-shadow": ["error", { allow: ["req", "res", "err"] }],
"valid-jsdoc": [
"error",
{
requireReturn: true,
requireReturnType: true,
requireParamDescription: false,
requireReturnDescription: true
}
],
"require-jsdoc": [
"error",
{
require: {
FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: true
}
}
]
}
};
77 changes: 71 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,101 @@

# Created by https://www.gitignore.io/api/node
# Edit at https://www.gitignore.io/?templates=node

### Node ###
# Logs
logs
*.log
.DS_Store

npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directory
node_modules
# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

#ignore vscode settings file
.vscode/settings.json
#ignore DS_Store
.DS_Store

# End of https://www.gitignore.io/api/node

4 changes: 4 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eslint:
enabled: true
config_file: .eslintrc

8 changes: 8 additions & 0 deletions .sequelizerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var path = require('path')

module.exports = {
'config': path.resolve('src', 'config', 'config.js'),
'migrations-path': path.resolve('src', 'migrations'),
'models-path': path.resolve('src', 'models'),
'seeders-path': path.resolve('src', 'seeders'),
}
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: node_js

node_js:
- "stable"

cache:
directories:
- "node_modules"

install:
- npm ci

services:
- postgresql

env:
global:
- NODE_ENV=test

before_script:
- psql -c 'create database authorsheaven_test;' -U postgres

script:
- npm test

after_success:
- npm run coveralls
13 changes: 13 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#### What does this PR do?

#### Description of Task to be completed?

#### How should this be manually tested?

#### Any background context you want to provide?

#### What are the relevant pivotal tracker stories?

#### Screenshots (if appropriate)

#### Questions:
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
[![Build Status](https://travis-ci.com/andela/codepirates-ah-backend.svg?branch=develop)](https://travis-ci.com/andela/codepirates-ah-backend)
[![Coverage Status](https://coveralls.io/repos/github/andela/codepirates-ah-backend/badge.svg?branch=develop)](https://coveralls.io/github/andela/codepirates-ah-backend?branch=develop)
[![Reviewed by Hound CI](https://img.shields.io/badge/Reviewed%20by-Hound%20CI-blue.svg)](https://houndci.com)

Authors Haven - A Social platform for the creative at heart.
=======

## Vision

Create a community of like minded authors to foster inspiration and innovation
by leveraging the modern web.

---

## API Spec

The preferred JSON object to be returned by the API should be structured as follows:

### Users (for authentication)
Expand All @@ -23,7 +29,9 @@ The preferred JSON object to be returned by the API should be structured as foll
}
}
```

### Profile

```source-json
{
"profile": {
Expand All @@ -34,7 +42,9 @@ The preferred JSON object to be returned by the API should be structured as foll
}
}
```

### Single Article

```source-json
{
"article": {
Expand All @@ -56,7 +66,9 @@ The preferred JSON object to be returned by the API should be structured as foll
}
}
```

### Multiple Articles

```source-json
{
"articles":[{
Expand Down Expand Up @@ -96,7 +108,9 @@ The preferred JSON object to be returned by the API should be structured as foll
"articlesCount": 2
}
```

### Single Comment

```source-json
{
"comment": {
Expand All @@ -113,7 +127,9 @@ The preferred JSON object to be returned by the API should be structured as foll
}
}
```

### Multiple Comments

```source-json
{
"comments": [{
Expand All @@ -131,7 +147,9 @@ The preferred JSON object to be returned by the API should be structured as foll
"commentsCount": 1
}
```

### List of Tags

```source-json
{
"tags": [
Expand All @@ -140,7 +158,9 @@ The preferred JSON object to be returned by the API should be structured as foll
]
}
```

### Errors and Status Codes

If a request fails any validations, expect errors in the following format:

```source-json
Expand All @@ -152,16 +172,16 @@ If a request fails any validations, expect errors in the following format:
}
}
```

### Other status codes:

401 for Unauthorized requests, when a request requires authentication but it isn't provided

403 for Forbidden requests, when a request may be valid but the user doesn't have permissions to perform the action

404 for Not found requests, when a resource can't be found to fulfill the request


Endpoints:
----------
## Endpoints:

### Authentication:

Expand Down Expand Up @@ -390,3 +410,20 @@ No additional parameters required
### Get Tags

`GET /api/tags`

# Create A .env File In The Project Folder And Save The Following Credentials Inside

- DB_HOST = "localhost"
- DB_USER = "postgres"
- DB_PASSWORD = "xxxxxxxxxx"
- DB_NAME = "hoven"
- DB_NAME_TEST = "hoven-test"
- DB_PORT = 5432
- ADMIN_FIRSTNAME = "someone"
- ADMIN_LASTNAME = "someone"
- ADMIN_USERNAME = "someone"
- ADMIN_EMAIL = "someone@gmail.com"
- ADMIN_PASSWORD = "xxxxxxxxxx"
- SECRET="secret"
- STATE="development"
- api_version=v1
Loading

0 comments on commit 7034578

Please sign in to comment.