Skip to content

Commit

Permalink
Merge 0b558ac into 1db0cf6
Browse files Browse the repository at this point in the history
  • Loading branch information
madeofhuman committed Sep 4, 2018
2 parents 1db0cf6 + 0b558ac commit f1c6eb3
Show file tree
Hide file tree
Showing 60 changed files with 245 additions and 246 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "A Social platform for the creative at heart",
"main": "server/index.js",
"scripts": {
"test": "npm run migrate:test && cross-env NODE_ENV=test nyc --reporter=html --reporter=text mocha --timeout 50000 --exit --require babel-register ./server/tests/**/*.test.js",
"test": "npm run test:v1",
"test:v1": "npm run migrate:test && cross-env NODE_ENV=test nyc --reporter=html --reporter=text mocha --timeout 500000 --exit --require babel-register ./server/v1/tests/**/*.test.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"coveralls": "nyc --reporter=lcov --reporter=text-lcov npm test",
"prestart": "sequelize db:migrate",
Expand Down
6 changes: 3 additions & 3 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from 'path';
import session from 'express-session';
import cors from 'cors';

import router from './routes';
import v1Router from './v1/routes';

const env = process.env.NODE_ENV;

Expand Down Expand Up @@ -39,13 +39,13 @@ app.use(
}),
);

app.use('/api', router);
app.use('/api/v1', v1Router);

// catch un-available routes
app.all('*', (req, res) => {
res.status(404).json({
status: 'error',
message: 'Oh-oh! Seems like the page you requested does not exist. Please check the URL again.',
message: 'Oh-oh! Seems like the resource you requested does not exist. Please check the URL again.',
});
});

Expand Down
Empty file removed server/middlewares/isUser.js
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import google from 'passport-google-oauth20';
import facebook from 'passport-facebook';
import { MockStrategy, setupSerializeAndDeserialize } from 'passport-mock-strategy';
import AuthController from '../controllers/AuthController';
import config from '../config/passport';
import config from '../../config/passport';
import init from './init';

if (process.env.NODE_ENV === 'test') {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-restricted-syntax */
import models from '../models';
import models from '../../models';
import randomString from '../helpers/randomString';
import dashReplace from '../helpers/replaceDash';
import queryHelper from '../helpers/queryHelper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import bcrypt from 'bcrypt';
import models from '../models';
import models from '../../models';
import JwtHelper from '../helpers/JwtHelper';
import NotificationController from './NotificationController';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import models from '../models';
import models from '../../models';
import NotificationController from './NotificationController';

const { Comment, User, Article } = models;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import models from '../models';
import models from '../../models';
import NotificationController from './NotificationController';

const { Follow, User } = models;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Pusher from 'pusher';
import models from '../models';
import pusherConfig from '../config/pusher';
import models from '../../models';
import pusherConfig from '../../config/pusher';

const { Channel, Subscription, Notification } = models;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { } from 'dotenv/config';
import bcrypt from 'bcrypt';
import models from '../models';
import models from '../../models';
import Mailer from '../helpers/Mailer';
import JwtHelper from '../helpers/JwtHelper';
import emails from '../helpers/emailMessages';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import models from '../models';
import models from '../../models';
import AuthController from './AuthController';
import queryHelper from '../helpers/queryHelper';
import NotificationController from './NotificationController';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import models from '../models';
import models from '../../models';
import NotificationController from './NotificationController';

const { Article, Rating } = models;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import models from '../models';
import models from '../../models';
import queryHelper from '../helpers/queryHelper';

const { User, Tag, Article } = models;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import models from '../models';
import models from '../../models';
import JwtHelper from '../helpers/JwtHelper';
import Mailer from '../helpers/Mailer';
import emails from '../helpers/emailMessages';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import models from '../models';
import models from '../../models';

const {
User, Rating, Tag, Article, Subscription, Channel, Notification
Expand Down
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.
2 changes: 1 addition & 1 deletion server/public/index.html → server/v1/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ul class="header-nav" role="navigation">
<li class="nav-left"><a href="index.html">Home</a></li>
<li><a href="login.html">Login</a></li>
</ul>
</ul>
</nav>
</section>
</header>
Expand Down
10 changes: 5 additions & 5 deletions server/public/login.html → server/v1/public/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<nav>
<ul class="header-nav" role="navigation">
<li class="nav-left"><a href="index.html">Home</a></li>
</ul>
</ul>
</nav>
</section>
</header>
Expand All @@ -29,12 +29,12 @@
Login to your Account
</div>
<form name="loginForm" action="">
<div id="loginError"></div>

<div id="loginError"></div>

<div class="form-section">
<input type="text" id="username" name="username" placeholder="Email or Username" required>
<div id="emailError"></div>
<div id="emailError"></div>
</div>

<div class="form-section">
Expand All @@ -47,7 +47,7 @@
</div>
</form>
</section>

</main>
<section class="footer" id="footer">
<div class="container">
Expand Down
File renamed without changes.
64 changes: 32 additions & 32 deletions server/public/styles.css → server/v1/public/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body {

header {
border: -1px solid rgba(238,238,238 ,1);
margin: auto;
margin: auto;
background: #afb5bf;
border-radius: 2px;
width: 100%;
Expand Down Expand Up @@ -42,33 +42,33 @@ a:hover, a:active {
}

a.primary:hover {
background-color: green;
background-color: green;
color: white;
text-decoration: none;
text-decoration: none;
}

a.danger:hover {
background-color: red;
background-color: red;
color: white;
text-decoration: none;
}

a.warning:hover {
background-color: orange;
background-color: orange;
color: white;
text-decoration: none;
}

a.info:hover {
background-color: blue;
background-color: blue;
color: white;
text-decoration: none;
}

button, .button {
padding: 14px 25px;
margin: 6px;
text-align: center;
text-align: center;
font-weight: bold;
text-decoration: none;
display: inline-block;
Expand All @@ -94,17 +94,17 @@ button .danger {
}

button.primary:hover {
background-color: green;
background-color: green;
color: white;
}

button.info:hover {
background-color: blue;
background-color: blue;
color: white;
}

button.danger:hover {
background-color: red;
background-color: red;
color: white;
}

Expand Down Expand Up @@ -146,7 +146,7 @@ input[type=submit]:hover {
/* Classes */

.home-welcome {
background-image:
background-image:
linear-gradient(
rgba(160, 0, 0, 0.4),
rgba(160, 0, 0, 0.4)
Expand All @@ -158,7 +158,7 @@ input[type=submit]:hover {
}

.home-who {
background-image:
background-image:
linear-gradient(
rgba(160, 0, 0, 0.4),
rgba(160, 0, 0, 0.4)
Expand Down Expand Up @@ -228,20 +228,20 @@ header .container, footer .container {
text-align: center;
}

.small-card {
.small-card {
width: 50%;
}
.medium-card {
.medium-card {
width: 70%;
}

.large-card {
.large-card {
width: 90%;
}

.card-head {
box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
border-radius: 5px;
border-radius: 5px
font-weight: bold;
width: 90%;
font-size: 28px;
Expand Down Expand Up @@ -272,23 +272,23 @@ header .container, footer .container {
padding: 8px 0;
}

.columns {
.columns {
display: flex;
display: -webkit-flex;
display: -ms-flexbox;
justify-content: space-between;
}

.column {
flex: 1;
.column {
flex: 1;
width: 0;
margin: 0 10px;
}
.column:first-child {
.column:first-child {
margin: 0 10px 0 0;
}

.column:last-child {
.column:last-child {
margin: 0 0 0 10px;
}

Expand Down Expand Up @@ -338,25 +338,25 @@ header .container, footer .container {
width: 90%;
}

.columns, .header-nav {
.columns, .header-nav {
flex-flow: column wrap;
}

.column {
flex: 0;
.column {
flex: 0;
width: 100%;
margin: 10px 0;
}
.column:first-child {

.column:first-child {
margin: 10px 0;
}

.column:last-child {
.column:last-child {
margin: 10px 0;
}

.small-card {
.small-card {
width: 90%;
}
}
Expand Down Expand Up @@ -394,10 +394,10 @@ p#welcome {
top: 50%;
height: 20vw;
width: 20vw;
margin: -10vw 0 0 -10vw;
margin: -10vw 0 0 -10vw;
border: 3px solid transparent;
border-top-color: #3498db;
border-bottom-color: #3498db;
border-bottom-color: #3498db;
border-radius: 50%;
z-index: 2;
-webkit-animation: spin 2s linear infinite;
Expand All @@ -412,7 +412,7 @@ p#welcome {
top:2%;
bottom: 2%;
left: 2%;
right: 2%;
right: 2%;
border: 3px solid transparent;
z-index: 2;
border-top-color: #db213a;
Expand All @@ -430,7 +430,7 @@ p#welcome {
top:5%;
bottom: 5%;
left: 5%;
right: 5%;
right: 5%;
border: 3px solid transparent;
border-top-color: #dec52d;
z-index: 2;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions server/routes/index.js → server/v1/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import userRouter from './users';
import followRouter from './follow';
import searchRouter from './search';

const router = Router();
const v1Router = Router();

router.use('/auth', authRouter);
router.use('/user', profileRouter);
router.use('/users', userRouter);
router.use('/search', searchRouter);
router.use('/articles', articleRouter);
router.use('/user', followRouter);
v1Router.use('/auth', authRouter);
v1Router.use('/user', profileRouter);
v1Router.use('/users', userRouter);
v1Router.use('/search', searchRouter);
v1Router.use('/articles', articleRouter);
v1Router.use('/user', followRouter);

// Matches /api the API home route
router.get('/*', (req, res) => {
v1Router.get('/*', (req, res) => {
res.status(200).send({
url: `${req.protocol}://${req.headers.host}`,
status: 'success',
message: "Welcome to Author's Haven - A Social platform for the creative at heart."
message: "Authors' Haven API V1"
});
});

export default router;
export default v1Router;
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f1c6eb3

Please sign in to comment.