diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..f45f640 --- /dev/null +++ b/.babelrc @@ -0,0 +1,26 @@ +{ + "env": { + "development": { + "presets": [ + "next/babel" + ] + }, + "production": { + "presets": [ + "next/babel" + ] + }, + "test": { + "presets": [ + [ + "next/babel", + { + "preset-env": { + "modules": "commonjs" + } + } + ] + ] + } + } +} diff --git a/.eslintignore b/.eslintignore index 5be912f..f1d08f7 100644 --- a/.eslintignore +++ b/.eslintignore @@ -8,5 +8,7 @@ /tests/fixtures/** /tests/performance/** /tmp/** +next.config.js + # Add any other files or folders that you want eslint to ignore diff --git a/.gitignore b/.gitignore index 188d7f4..65611f7 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,7 @@ build/Release node_modules/ jspm_packages/ package-lock.json - +.DS_Store # TypeScript v1 declaration files typings/ diff --git a/.hound.yml b/.hound.yml deleted file mode 100644 index cd9b2c9..0000000 --- a/.hound.yml +++ /dev/null @@ -1,4 +0,0 @@ -eslint: - enabled: true - config_file: .eslintrc - ignore_file: .eslintignore diff --git a/.travis.yml b/.travis.yml index 2197832..dff50cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ language: node_js node_js: - "node" +script: + - npm run lint + - npm test diff --git a/README.md b/README.md index 26f035b..2d2df88 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,13 @@ -# project-template -Document your applications API and general usage +# Project Help Me # + +Help Me is an app that connects Depressed people to each other, essentially, it is a social network for depressed people + +## Development ## + +* clone the repo * +* ```cd helpme``` +* ```npm install``` +* ```npm run dev``` + + +Antdesign is also used for the components, check diff --git a/components/LandingPage/components/LandingPage.css b/components/LandingPage/components/LandingPage.css new file mode 100644 index 0000000..46ec66d --- /dev/null +++ b/components/LandingPage/components/LandingPage.css @@ -0,0 +1,123 @@ +.LandingPage_footer { + background: #001529; + color: #ffffff; + text-align: center; +} + +.LandingPage_footer > img { + width: 50%; + height: 50%; + margin-bottom: 1em; +} + +.LandingPage_footer > ul { + list-style-type: none; + padding: 0; +} + +.LandingPage_hero { + padding: 24px; + background: #ffffff; + display: flex; + flex-direction: column; + justify-content: center; +} + +.LandingPage_hero > img { + width: 100%; + margin: 2em 0; +} +.LandingPage_content__text { + text-align: center; +} + +.LandingPage_button { + margin-bottom: 2em; +} + +.column-section > img { + width: 50%; + margin: 0 auto; +} + +@media screen and (min-width: 425px) and (max-width: 767px) { + .LandingPage_hero > img { + width: 65%; + margin: 2em auto; + } + + .column-section > img { + width: 30%; + margin-top: 0; + } +} + +@media screen and (min-width: 768px) { + + + .LandingPage_hero { + flex-direction: row; + align-items: center; + } + .LandingPage_content__text { + margin: 2em; + } + .LandingPage_hero > img { + width: 40%; + } + + .LandingPage_body > section { + margin: 0 6em; + } + + .reverse { + flex-direction: row-reverse; + } + + .column-section { + flex-direction: column; + } + + .column-section > div { + margin-bottom: 0; + } + + .column-section > img { + width: 20%; + margin-top: 0; + } + + + + .LandingPage_footer { + text-align: left; + display: flex; + justify-content: space-evenly; + padding: 5em 50px; + } + + .LandingPage_content { + height: 100%; + margin-top: 0; + } + + .LandingPage_footer > img { + width: 120px; + height: 30px; + margin-bottom: 0; + } + + +} + +@media screen and (min-width: 1024px) { + .LandingPage_body > section { + /* padding: 0 3em; */ + } + + .layout_header-desktop { + padding: 0 6em; + } + + +} diff --git a/components/LandingPage/components/LandingPage.jsx b/components/LandingPage/components/LandingPage.jsx new file mode 100644 index 0000000..9458729 --- /dev/null +++ b/components/LandingPage/components/LandingPage.jsx @@ -0,0 +1,59 @@ +import React from 'react'; +import 'antd/dist/antd.css'; +import { Layout, Divider } from 'antd'; +import './LandingPage.css'; +import Paragraph from 'antd/lib/typography/Paragraph'; +import LandingPageContent from './LandingPageContent'; +import PageLayout from '../../Layout'; +import { landingPageContents, pageTitle } from '../constants'; + +/** + * Function for displaying the landing page + * + * @function + * @return {Object} The landing page + */ + +const LandingPage = () => ( + + { + landingPageContents.map(landingPageContent => { + const { + paragraphText, + isButtonPresent, + columnSection, + isImagePresent, + imageLink, + level, + title, + reverseSection, + buttonText, + buttonLink, + } = landingPageContent; + + return ( + + ); + }) + } + +); + +export default LandingPage; diff --git a/components/LandingPage/components/LandingPage.test.jsx b/components/LandingPage/components/LandingPage.test.jsx new file mode 100644 index 0000000..23bbbe2 --- /dev/null +++ b/components/LandingPage/components/LandingPage.test.jsx @@ -0,0 +1,10 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import LandingPage from './index'; + +describe('LandingPage', () => { + it('should renders without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(, div); + }); +}); diff --git a/components/LandingPage/components/LandingPageContent.jsx b/components/LandingPage/components/LandingPageContent.jsx new file mode 100644 index 0000000..0cbcb9e --- /dev/null +++ b/components/LandingPage/components/LandingPageContent.jsx @@ -0,0 +1,83 @@ +import React from 'react'; +import { Button, Typography } from 'antd'; +import PropTypes from 'prop-types'; +import { normalize } from 'path'; +import Link from 'next/link'; + +const { Title, Paragraph } = Typography; + +/** + * Function used to generate section layout content for landing page + * @function + * @param {Number} level - The Number from 1-5 representing the header level h1-h5 + * @param {String} title- The Title of that Section + *@param {String} paragraphText- The Text of that section + * @param {Boolean} isButtonPresent- If true, a button is shown on that section + * @param {String} buttonText- the text on the button + * @param {String} buttonLink- the link that the button leads to + * @param {String} imageLink- the link to an image in the section + * @param {Boolean} reverseSection - if true, the image and section position is swapped + * @param {Boolean} isImagePresent - if true, the image is shown + * @param {Boolean} columnSection - if true, the section will be stacked + * @return {Object} The landing page content component which is used to populate the landing page + */ + +export default function LandingPageContent(props) { + const { + level, + title, + paragraphText, + isButtonPresent, + buttonText, + buttonLink, + imageLink, + isImagePresent, + reverseSection, + columnSection, + } = props; + + let className; + + // this helps to structure the section, the section can be normalize, reversed or columnized + if (!reverseSection && !columnSection) { + className = 'LandingPage_hero'; + } else if (reverseSection && !columnSection) { + className = 'LandingPage_hero reverse'; + } else if (columnSection) { + className = 'LandingPage_hero column-section'; + } + + return ( +
+
+ {title} + {paragraphText} + {/* displays button in a section */} + { + isButtonPresent ? ( + + ) : null + } +
+ + {/* displays image in a section */} + {isImagePresent ? {`${title} : null} +
+ ); +} +LandingPageContent.propTypes = { + level: PropTypes.number, + title: PropTypes.string, + paragraphText: PropTypes.string, + isButtonPresent: PropTypes.bool, + buttonText: PropTypes.string, + buttonLink: PropTypes.string, + isImagePresent: PropTypes.bool, + imageLink: PropTypes.string, + reverseSection: PropTypes.bool, + columnSection: PropTypes.bool, +}; diff --git a/components/LandingPage/components/index.js b/components/LandingPage/components/index.js new file mode 100644 index 0000000..7b923f9 --- /dev/null +++ b/components/LandingPage/components/index.js @@ -0,0 +1,4 @@ + +import LandingPage from './LandingPage'; + +export default LandingPage; diff --git a/components/LandingPage/constants.js b/components/LandingPage/constants.js new file mode 100644 index 0000000..18cd54b --- /dev/null +++ b/components/LandingPage/constants.js @@ -0,0 +1,81 @@ +/* eslint-disable max-len */ +const pageTitle = 'Home | Welcome to Help me'; // the title of the landing page + +const landingPageMainContentTitle = 'Help me Title'; + +const landingPageMainContentParagraphText = 'Lorem ipsum dolor sit amet consectetur adipisicing elit.Deleniti porro vero'; + +const landingPageMainContentButtonText = 'Lets begin this Journey'; + +const landingPageLevel2ParagraphText = 'Lorem ipsum dolor sit amet consectetur adipisicing elit.Deleniti porro veroDeleniti porro vero'; + +const landingPageLevel2ButtonText = 'Lets begin this Journey'; + +const landingPageLevel3ContentTitle = 'Lorem Ipsum dolor sit a '; + +const landingPageLevel3ParagraphText = 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti porro vero'; + +const landingPageLevel4ContentTitle = 'Title 2'; + +const landingPageLevel4ParagraphText = 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti porro vero'; + +const landingPageLevel5ContentTitle = 'Lorem Ipsum dolor sit a '; + +const landingPageLevel5ParagraphText = 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti porro vero Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti porro vero Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti porro vero Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti porro vero Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti porro vero v Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti porro vero'; + +const landingPageLevel5ButtonText = 'Create an Account'; + +const landingPageContents = [ + { + buttonLink: '/signup', + buttonText: landingPageMainContentButtonText, + imageLink: '../../../static/connected.svg', + isButtonPresent: true, + isImagePresent: true, + level: 1, + paragraphText: landingPageMainContentParagraphText, + title: landingPageMainContentTitle, + }, + { + columnSection: true, + imageLink: '../../../static/smile.svg', + isButtonPresent: false, + isImagePresent: true, + level: 2, + paragraphText: landingPageLevel2ParagraphText, + title: landingPageLevel2ButtonText, + + }, + { + imageLink: '../../../static/community.svg', + isButtonPresent: false, + isImagePresent: true, + level: 3, + paragraphText: landingPageLevel3ParagraphText, + reverseSection: true, + title: landingPageLevel3ContentTitle, + }, + { + isButtonPresent: false, + isImagePresent: false, + level: 2, + paragraphText: landingPageLevel4ParagraphText, + title: landingPageLevel4ContentTitle, + }, + { + buttonLink: '/signup', + buttonText: landingPageLevel5ButtonText, + imageLink: '../../../static/hangout.svg', + isButtonPresent: true, + isImagePresent: true, + level: 3, + paragraphText: landingPageLevel5ParagraphText, + reverseSection: false, + title: landingPageLevel5ContentTitle, + }, +]; + +export { + pageTitle, + landingPageContents +}; diff --git a/components/LandingPage/index.js b/components/LandingPage/index.js new file mode 100644 index 0000000..e5e516f --- /dev/null +++ b/components/LandingPage/index.js @@ -0,0 +1,3 @@ +import LandingPage from './components/index'; + +export default LandingPage; diff --git a/components/Layout/components/FooterListCreator.jsx b/components/Layout/components/FooterListCreator.jsx new file mode 100644 index 0000000..042c6bf --- /dev/null +++ b/components/Layout/components/FooterListCreator.jsx @@ -0,0 +1,30 @@ +import React from 'react'; +import Link from 'next/link'; +import PropTypes from 'prop-types'; + +const FooterListCreator = props => { + const { list } = props; + return ( + + ); +}; +export default FooterListCreator; +FooterListCreator.propTypes = { + list: PropTypes.arrayOf(PropTypes.shape({ + href: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + })).isRequired, +}; diff --git a/components/Layout/components/NavHeader.jsx b/components/Layout/components/NavHeader.jsx new file mode 100644 index 0000000..5fcadb7 --- /dev/null +++ b/components/Layout/components/NavHeader.jsx @@ -0,0 +1,116 @@ +import React from 'react'; +import Head from 'next/head'; +import 'antd/dist/antd.css'; +import { + Layout, Menu, Button, Input +} from 'antd'; +import Link from 'next/link'; +import PropTypes from 'prop-types'; +import { headerTitle, menuItems } from '../constants'; + +const { Header } = Layout; +const { Search } = Input; + +/** + * Head function that is infused into all pages and controls page's title + * @function + * @param {String} title - The title of the currently viewed page + * @return {Object} head metadata which is inserted in every page + */ +function NavHeader(props) { + const { title } = props; + let isAuthenticated; + // fake Authentication for development + if (global.location !== undefined && global.location.pathname === '/') { + isAuthenticated = false; + } else { + isAuthenticated = true; + } + + return ( + <> + {/* head parametes */} + + + + + + + + {!title ? headerTitle : title} + + {/* navheader for mobile */} +
+ + + helpme logo + + + {/* hide when authenticated */} + {isAuthenticated ? null : ( + + )} +
+ {/* header for desktop */} +
+ + + helpme logo + + + {isAuthenticated ? ( + <> + {/* search */} + console.log(value)} + style={{ width: 200 }} + /> + {/* navbar for authenticated desktop */} + + { + menuItems.map(menuItem => { + const { key, href, text } = menuItem; + return ( + + + {text} + + + ); + }) + } + + + + ) : ( + + )} +
+ + ); +} +export default NavHeader; +Head.propTypes = { + title: PropTypes.string, +}; diff --git a/components/Layout/components/PageFooter.jsx b/components/Layout/components/PageFooter.jsx new file mode 100644 index 0000000..4ad1d61 --- /dev/null +++ b/components/Layout/components/PageFooter.jsx @@ -0,0 +1,34 @@ +import React from 'react'; +import Link from 'next/link'; +import { Layout } from 'antd'; +import { footerFirstColumn, footerSecondColumn } from '../constants'; +import FooterListCreator from './FooterListCreator'; + +const { Content, Footer } = Layout; + +/** + * footer function that is infused into all pages + * @function + * @return {Object} footer + */ +export default function PageFooter() { + return ( + + + + + + ); +} diff --git a/components/Layout/components/PageLayout.css b/components/Layout/components/PageLayout.css new file mode 100644 index 0000000..4bc2549 --- /dev/null +++ b/components/Layout/components/PageLayout.css @@ -0,0 +1,93 @@ +.PageLayout_content { + height: 100%; + margin-top: 64px; +} + +.layout_header-mobile { + display: flex; + justify-content: space-between; + background-color: #ffffff; + border-bottom: 0.4px solid #e8e8e8; + position: fixed; + width: 100%; + z-index: 1; + align-items: center; +} + +.layout_header-desktop { + display: none; +} + +.layout_sider { + position: fixed; + height: calc(100vh - 64px); + z-index: 1; + margin-top: 64px; +} + +.ant-layout { + background: #ffffff; +} + +.ant-layout-sider-zero-width-trigger { + top: 12px; + position: fixed; + background-color: #1890ff; + left: 0; +} + +.ant-layout-sider-zero-width-trigger:hover { + background-color: #1890ff; +} + +a { + color: #ffffff; +} + +.ant-divider-horizontal { + margin: 0.2px; +} + +.logo { + width: 120px; + height: 30px; +} + +@media screen and (min-width: 768px) { + .PageLayout_body { + /* overflow: auto; */ +background: #E6ECF0; + } + .PageLayout_content { + margin-top: 63px; + background-color: #e8e8e8 +} +.layout_sider { + display: none; + } + +.layout_header-mobile { + display: none; + } + .layout_header-desktop { + background-color: #ffffff; + display: flex; + justify-content: space-between; + align-items: center; + border-bottom: 1px solid #e8e8e8; + position: fixed; + width: 100%; + z-index: 3; + padding: 0 1em; + } + + .layout_header-list { + line-height: 63px; + } +} + +@media screen and (min-width: 1024px) { + .layout_header-desktop { + padding: 0 6em; + } +} diff --git a/components/Layout/components/PageLayout.jsx b/components/Layout/components/PageLayout.jsx new file mode 100644 index 0000000..b8c2b22 --- /dev/null +++ b/components/Layout/components/PageLayout.jsx @@ -0,0 +1,47 @@ +/* eslint-disable react/require-default-props */ +import React from 'react'; +import { Layout } from 'antd'; +import PropTypes from 'prop-types'; +import NavHeader from './NavHeader'; +import Sidebar from './Sidebar'; +import PageFooter from './PageFooter'; +import './PageLayout.css'; +import { headerTitle } from '../constants'; + +const { Content } = Layout; +/** + * Function for displaying the landing page + * @function + * @param {Function} title controls the title of the page + * @param {Function} isAuthenticated controls if user is authrnticated or not + * @param {Function} children other pages who are children of this layout + * @param {Function} isFooterPresent displays footer if true + * @param {Function} isSiderPresent displays side for mobile pages + * @return {Object} control the over all layout of the webpage + */ +export default function PageLayout(props) { + const { + title, isAuthenticated, children, isFooterPresent, isSiderPresent, + } = props; + return ( + <> + + + + + + {children} + + + + {isFooterPresent ? : null} + + ); +} +PageLayout.propTypes = { + children: PropTypes.node, + isAuthenticated: PropTypes.bool, + isFooterPresent: PropTypes.bool, + isSiderPresent: PropTypes.bool, + title: PropTypes.string, +}; diff --git a/components/Layout/components/PageLayout.test.jsx b/components/Layout/components/PageLayout.test.jsx new file mode 100644 index 0000000..075aa0d --- /dev/null +++ b/components/Layout/components/PageLayout.test.jsx @@ -0,0 +1,28 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import NavHeader from './NavHeader'; +import PageFooter from './PageFooter'; +import Sidebar from './Sidebar'; +import PageLayout from './index'; + +describe('PageLayout , NavHeader, PageFooter,Sidebar and PageLayout', () => { + it('NavHeader should render without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(, div); + }); + + it('PageFooter should render without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(, div); + }); + + it('Sidebar should render without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(, div); + }); + + it('PageLayout should render without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(, div); + }); +}); diff --git a/components/Layout/components/Sidebar.jsx b/components/Layout/components/Sidebar.jsx new file mode 100644 index 0000000..e1d164a --- /dev/null +++ b/components/Layout/components/Sidebar.jsx @@ -0,0 +1,44 @@ +import React from 'react'; +import { Layout, Menu, Icon } from 'antd'; +import Link from 'next/link'; +import PropTypes from 'prop-types'; +import { sideBarMenuItems } from '../constants'; + +const { Sider } = Layout; +/** + * Function that controls the sidebar which displays on mobile + * @function + * @param {boolean} IsSiderPresent shows sidebar if true + * @return {Object} Side Bar + */ +export default function Sidebar(props) { + const { IsSiderPresent } = props; + return IsSiderPresent ? ( + +
+ + { + sideBarMenuItems.map(sideBarItem => { + const { + key, href, type, text, + } = sideBarItem; + return ( + + + + + {text} + + + + ); + }) + } + + + ) : null; +} + +Sider.propTypes = { + IsSiderPresent: PropTypes.bool, +}; diff --git a/components/Layout/components/index.js b/components/Layout/components/index.js new file mode 100644 index 0000000..6b80de7 --- /dev/null +++ b/components/Layout/components/index.js @@ -0,0 +1,3 @@ +import PageLayout from './PageLayout'; + +export default PageLayout; diff --git a/components/Layout/constants.js b/components/Layout/constants.js new file mode 100644 index 0000000..4fedfdc --- /dev/null +++ b/components/Layout/constants.js @@ -0,0 +1,64 @@ +// eslint-disable-next-line import/prefer-default-export +const headerTitle = 'Helpme | Connect with Friends'; // title of the header + +const menuItems = [ + { + href: '/', + key: 1, + text: 'Home', + }, { + href: '/forum', + key: 2, + text: 'Forum', + }, { + href: '/Dairy', + key: 3, + text: 'Dairy', + }, +]; + +const footerFirstColumn = [ + { + href: '/#', + text: 'Home', + }, { + href: '/contact', + text: 'Contact us', + }, { + href: '/about-us', + text: 'About Helpme', + }, +]; + +const footerSecondColumn = [ + { + href: '/about-us', + text: 'Security & Privacy', + }, { + href: '/terms', + text: 'Terms Of Service', + }, +]; + +const sideBarMenuItems = [ + { + href: '/#', + key: 1, + text: 'Home', + type: 'user', + }, { + href: '/forum', + key: 2, + text: 'Forum', + type: 'video-camera', + }, { + href: '/dairy', + key: 3, + text: 'Dairy', + type: 'upload', + }, +]; + +export { + headerTitle, menuItems, footerFirstColumn, footerSecondColumn, sideBarMenuItems +}; diff --git a/components/Layout/index.js b/components/Layout/index.js new file mode 100644 index 0000000..0728d99 --- /dev/null +++ b/components/Layout/index.js @@ -0,0 +1,3 @@ +import PageLayout from './components/index'; + +export default PageLayout; diff --git a/config/keys.js b/config/keys.js new file mode 100644 index 0000000..ea0b581 --- /dev/null +++ b/config/keys.js @@ -0,0 +1,3 @@ +module.exports = { + mongoURI: 'mongodb://enyehelpme:enyehelpme123@ds147946.mlab.com:47946/helpme_db', +}; diff --git a/empty.js b/empty.js new file mode 100644 index 0000000..16f0846 --- /dev/null +++ b/empty.js @@ -0,0 +1 @@ +// used to map css files so that jest test can ingnore css; diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..886259c --- /dev/null +++ b/jest.config.js @@ -0,0 +1,21 @@ +const TEST_REGEX = '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|js?|tsx?|ts?)$'; + +module.exports = { + collectCoverage: true, + globals: { + jest: { + useBabelrc: true, + }, + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], + moduleNameMapper: { + '\\.(css|jpg|png|scss|less|sass)$': '/empty.js', + }, + setupFiles: ['/jest.setup.js'], + testPathIgnorePatterns: ['/.next/', '/node_modules/'], + testRegex: TEST_REGEX, + transform: { + '^.+\\.jsx?$': 'babel-jest', + }, +}; + diff --git a/jest.setup.js b/jest.setup.js new file mode 100644 index 0000000..135148a --- /dev/null +++ b/jest.setup.js @@ -0,0 +1,4 @@ +const Enzyme = require('enzyme'); +const Adapter = require('enzyme-adapter-react-16'); + +Enzyme.configure({ adapter: new Adapter() }); diff --git a/models/User.js b/models/User.js new file mode 100644 index 0000000..8c9b3da --- /dev/null +++ b/models/User.js @@ -0,0 +1,29 @@ +const mongoose = require('mongoose'); + +const { Schema } = mongoose; +const UserSchema = new Schema({ + // If there is an associated avatar it will show a placeholder avatar for images + avatar: { + type: String, + }, + date: { + default: Date.now, + type: Date, + }, + email: { + required: true, + type: String, + }, + + name: { + required: true, + type: String, + }, + + password: { + required: true, + type: String, + }, +}); + +module.exports = mongoose.model('users', UserSchema); diff --git a/next.config.js b/next.config.js new file mode 100644 index 0000000..c576301 --- /dev/null +++ b/next.config.js @@ -0,0 +1,3 @@ +const withCSS = require('@zeit/next-css'); + +module.exports = withCSS(); diff --git a/package.json b/package.json index bcf782f..b76590c 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,28 @@ { - "name": "project-template", + "name": "HelpMe", "version": "1.0.0", - "description": "Template for starting a project", + "description": "An App That connects depressed people to each other for comfort", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 0", - "lint": "eslint pages" + "test": "jest", + "lint": "eslint . --fix", + "dev": "node server/index.js", + "build": "next build", + "start": "next start" }, "repository": { "type": "git", - "url": "git+https://github.com/enyeInc/project-template.git" + "url": "git+https://github.com/team-helpme/helpme.git" }, - "author": "Uche Nnadi", + "author": "Justice Otuya, Marshall Akpan, Daniel Damilare", "license": "ISC", "bugs": { - "url": "https://github.com/enyeInc/project-template/issues" + "url": "https://github.com/team-helpme/helpme/issues" }, - "homepage": "https://github.com/enyeInc/project-template#readme", + "homepage": "https://github.com/team-helpme/helpme#readme", "devDependencies": { "babel-eslint": "^10.0.1", "chai": "^4.2.0", - "enzyme": "^3.9.0", "eslint": "^5.8.0", "eslint-config-airbnb": "^17.1.0", "eslint-config-standard": "^12.0.0", @@ -35,11 +37,24 @@ "sinon": "^7.3.1" }, "dependencies": { + "@babel/core": "^7.4.3", + "@shelf/jest-mongodb": "^1.0.1", + "@zeit/next-css": "^1.0.1", + "antd": "^3.16.3", + "auth0-js": "^9.10.2", + "babel-jest": "^24.7.1", + "body-parser": "^1.19.0", "dotenv": "^7.0.0", + "enzyme": "^3.9.0", + "enzyme-adapter-react-16": "^1.12.1", "express": "^4.16.4", + "mongoose": "^5.5.4", "next": "^8.0.4", + "prop-types": "^15.7.2", "react": "^16.8.6", + "react-addons-test-utils": "^15.6.2", "react-dom": "^16.8.6", + "react-test-renderer": "^16.8.6", "redux": "^4.0.1", "redux-saga": "^1.0.2" } diff --git a/pages/index.js b/pages/index.js index e69de29..d7c5b25 100644 --- a/pages/index.js +++ b/pages/index.js @@ -0,0 +1,3 @@ +import LandingPage from '../components/LandingPage/index'; + +export default LandingPage; diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..e59a927 --- /dev/null +++ b/server/index.js @@ -0,0 +1,33 @@ +const express = require('express'); +const next = require('next'); +const bodyParser = require('body-parser'); + +const PORT = process.env.PORT || 3000; +const dev = process.env.NODE_DEV !== 'production'; +const nextApp = next({ dev }); +const handle = nextApp.getRequestHandler(); + +// i need to comment the db declaration below else lint will not pass my code, +// i don't want to delete it as i am not the one who coded it comment by @justiceotuya + +// Configure DB +// const db = require('../config/keys').mongoURI; + +nextApp.prepare().then(() => { + // express code here + const app = express(); + // bodyParser Middleware + app.use(bodyParser.json()); + app.use(bodyParser.urlencoded({ extended: true })); + + // next should handle all other routes except the ones specified. + app.get( + '*', + (req, res) => handle(req, res) + ); + app.listen(PORT, err => { + if (err) throw err; + // eslint-disable-next-line no-console + console.log(`Server ready at http://localhost:${PORT}`); + }); +}); diff --git a/static/community.svg b/static/community.svg new file mode 100644 index 0000000..6835f53 --- /dev/null +++ b/static/community.svg @@ -0,0 +1 @@ +community \ No newline at end of file diff --git a/static/connected.svg b/static/connected.svg new file mode 100644 index 0000000..79b1740 --- /dev/null +++ b/static/connected.svg @@ -0,0 +1 @@ +connected \ No newline at end of file diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..974a52a Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/hangout.svg b/static/hangout.svg new file mode 100644 index 0000000..ecec6ed --- /dev/null +++ b/static/hangout.svg @@ -0,0 +1 @@ +hang out \ No newline at end of file diff --git a/static/logo-light.png b/static/logo-light.png new file mode 100644 index 0000000..3286fe0 Binary files /dev/null and b/static/logo-light.png differ diff --git a/static/logo.png b/static/logo.png new file mode 100644 index 0000000..a0f6e59 Binary files /dev/null and b/static/logo.png differ diff --git a/static/smile.svg b/static/smile.svg new file mode 100644 index 0000000..7b9925c --- /dev/null +++ b/static/smile.svg @@ -0,0 +1 @@ +smiley face \ No newline at end of file