Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chores] set up project #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
],
"@babel/preset-react"
],
"plugins": [
[
"module-resolver",
{
"root": [
"./"
],
"alias": {
"@": "./"
}
}
],
"@babel/plugin-proposal-class-properties"
]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
/tests/performance/**
/tmp/**
next.config.js
serviceWorker.js


# Add any other files or folders that you want eslint to ignore
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@
"react/jsx-closing-bracket-location": "error",
"react/void-dom-elements-no-children": "error",
"react/jsx-tag-spacing": "error",
"react/jsx-no-literals": "error",
"react/jsx-no-literals": ["off", "{ noStrings: true }"],
"react/jsx-wrap-multilines": "error",
"react/jsx-no-comment-textnodes": "error",
"jsx-a11y/anchor-is-valid": 0,
"import/prefer-default-export": "off"
"import/prefer-default-export": "off",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
},
"settings": {
"react": {
Expand Down
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
/dist
/coveralls
node_modules
package-lock.json
.nyc_output
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# project-template
Document your applications API and general usage
[![Build Status](https://travis-ci.com/Enye-Team-Giraffe/vote_right_frontend.svg?branch=master)](https://travis-ci.com/Enye-Team-Giraffe/vote_right_frontend)

TODO: Put a quick description of the application here.
# vote-right-frontend
Vote Right is a voting application based on blockchain technology. A secured, decentralized, auditable and open platform for e-voting and vote counting that everybody can trust.

## Usage
TODO: Provide how to interact with your repo at a high level. This could include what REST endpoints exist and/or how to configure the application.
Expand Down
16 changes: 16 additions & 0 deletions __test__/App.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import toJson from 'enzyme-to-json';
import App from '../src/App';
import { mount } from './enzyme';

describe('SAMPLE TEST', () => {
it('should return a successful sample test ', () => {
expect(true).toBeTruthy();
});

it('should render the App component correctly', () => {
const Wrapper = mount(<App />);
expect(toJson(Wrapper)).toMatchSnapshot();
expect(Wrapper.find('h1')).toHaveLength(1);
});
});
9 changes: 9 additions & 0 deletions __test__/__snapshots__/App.spec.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SAMPLE TEST should render the App component correctly 1`] = `
<App>
<h1>
WELCOME TO VOTE RIGHT APPLICATION
</h1>
</App>
`;
11 changes: 11 additions & 0 deletions __test__/enzyme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Enzyme, {
configure, shallow, mount, render
} from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import toJson from 'enzyme-to-json';

configure({ adapter: new Adapter() });
export {
shallow, mount, render, toJson
};
export default Enzyme;
28 changes: 28 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
collectCoverageFrom: [
'src/**/*.{js,jsx}',
'!<rootDir>/__test__/**/*.(spec|test).{js,jsx}',
'!**/dist/**',
],
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: [
'<rootDir>/src/serviceWorker.js',
'<rootDir>/node_modules',
'<rootDir>/dist/',
'<rootDir>/src/utils',
'<rootDir>/src/components/icons',
'<rootDir>/src/index.js',
'<rootDir>/src/store/index.js',
'<rootDir>/src/config/',
],
moduleNameMapper: {
'.+\\.(css|scss)$': 'identity-obj-proxy',
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2)$': 'jest-transform-stub',
},
testPathIgnorePatterns: ['<rootDir>/node_modules/'],

transform: {
'^.+\\.(js|jsx|mjs)$': '<rootDir>/node_modules/babel-jest',
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$'],
};
99 changes: 67 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,78 @@
{
"name": "project-template",
"version": "1.0.0",
"description": "Template for starting a project",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 0",
"lint": "eslint ."
},
"name": "vote-right",
"version": "0.1.0",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/enyeInc/project-template.git"
"url": "git+https://github.com/Enye-Team-Giraffe/vote_right_frontend.git"
},
"author": "Uche Nnadi",
"author": "Usman Abdulraheem, Alexander Shuaibu, Onyinye Ezike",
"license": "ISC",
"bugs": {
"url": "https://github.com/enyeInc/project-template/issues"
"url": "https://github.com/Enye-Team-Giraffe/vote_right_frontend/issues"
},
"homepage": "https://github.com/enyeInc/project-template#readme",
"devDependencies": {
"babel-eslint": "^10.0.1",
"enzyme": "^3.9.0",
"eslint": "^5.8.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-standard": "^4.0.0",
"jest": "^24.7.1",
"supertest": "4.0.2"
"homepage": "https://github.com/Enye-Team-Giraffe/vote_right_frontend#readme",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject",
"lint": "eslint --ext .js --ext .jsx . --fix",
"test": "jest --coverage",
"coverage": "cat ./coverage/lcov.info | coveralls"
},
"dependencies": {
"dotenv": "^7.0.0",
"express": "^4.16.4",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"redux": "^4.0.1",
"redux-saga": "^1.0.2"
"@babel/cli": "^7.7.4",
"@babel/core": "^7.7.4",
"dotenv": "^8.2.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme-to-json": "^3.4.3",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.2.0",
"redux": "^4.0.4",
"redux-saga": "^1.1.3"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/preset-env": "^7.7.4",
"@babel/preset-react": "^7.7.4",
"babel-eslint": "^10.0.3",
"babel-plugin-import": "^1.12.2",
"babel-plugin-module-resolver": "^3.2.0",
"babel-plugin-wrap-in-js": "^1.1.1",
"eslint": "^6.7.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.7.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-standard": "^4.0.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.9.0",
"jest-transform-stub": "^2.0.0",
"prettier": "^1.19.1",
"prettier-eslint": "^9.0.1",
"prettier-eslint-cli": "^5.0.0"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
43 changes: 43 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
7 changes: 7 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

function App() {
return <h1>WELCOME TO VOTE RIGHT APPLICATION</h1>;
}

export default App;
11 changes: 11 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import * as serviceWorker from './serviceWorker';

ReactDOM.render(<App />, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
Loading