This repository has been archived by the owner on Sep 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
chore: initial version #1
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
REACT_APP_VERSION=$npm_package_version | ||
GENERATE_SOURCEMAP=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/src/__tests__/cypress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
build/ | ||
node_modules/ | ||
scripts/ | ||
wip/ | ||
|
||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
package-lock.json* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"printWidth": 100, | ||
"trailingComma": "none", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) ARK Ecosystem <info@ark.io> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# ARK Messenger 💬 | ||
|
||
A fully anonymous and secure chat service proof of concept that utilizes many of the benefits that the ARK blockchain has to offer. | ||
|
||
Website: [arkmessenger.io](http://www.arkmessenger.io) | ||
|
||
## Installation | ||
|
||
Clone the ARK Messenger repository and cd into it: | ||
|
||
``` | ||
git clone https://github.com/ArkEcosystem/poc-ark-messenger.git | ||
cd poc-ark-messenger | ||
``` | ||
|
||
Install all dependencies: | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
Run the application: | ||
|
||
``` | ||
npm start | ||
``` | ||
|
||
By running the application in a development environment, it expects the blockchain to run locally on port `4003`. You can change this behavior by editing the `nodes` value in `./src/config.ts` | ||
|
||
## Tests | ||
|
||
Run Jest tests with: | ||
|
||
``` | ||
npm run test:jest | ||
``` | ||
|
||
Run Cypress tests with: | ||
|
||
``` | ||
npm run test:cypress | ||
``` | ||
|
||
## Credits | ||
|
||
This project exists thanks to all the people who [contribute](../../contributors). | ||
|
||
## License | ||
|
||
[MIT](LICENSE) © [ARK Ecosystem](https://ark.io) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"baseUrl": "http://localhost:3000", | ||
"pluginsFile": "src/__tests__/cypress/plugins/index.js", | ||
"supportFile": "src/__tests__/cypress/support/index.js", | ||
"integrationFolder": "src/__tests__/cypress/integration", | ||
"fixturesFolder": "src/__tests__/cypress/fixtures", | ||
"screenshotsFolder": "src/__tests__/cypress/screenshots", | ||
"videosFolder": "src/__tests__/cypress/videos", | ||
"viewportHeight": 1080, | ||
"viewportWidth": 1920 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"name": "ark-messenger-client", | ||
"version": "0.8.0", | ||
"description": "A decentralized chat application built on ARK.", | ||
"license": "MIT", | ||
"contributors": [ | ||
"Lemii <lemiidelegate@gmail.com>" | ||
], | ||
"homepage": "https://www.arkmessenger.io", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ArkEcosystem/poc-ark-messenger.git" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test:jest": "react-scripts test", | ||
"test:cypress": "cypress open", | ||
"eject": "react-scripts eject" | ||
}, | ||
"dependencies": { | ||
"@arkecosystem/core-transactions": "^2.6.0-next.9", | ||
"@arkecosystem/crypto": "^2.6.0-next.5", | ||
"@fortawesome/fontawesome-svg-core": "^1.2.25", | ||
"@fortawesome/free-regular-svg-icons": "^5.12.0", | ||
"@fortawesome/free-solid-svg-icons": "^5.11.2", | ||
"@fortawesome/react-fontawesome": "^0.1.7", | ||
"animate.css": "^3.7.2", | ||
"axios": "^0.19.0", | ||
"bip39": "^3.0.2", | ||
"bootstrap": "^4.4.1", | ||
"crypto-browserify": "^3.12.0", | ||
"jquery": "^3.4.1", | ||
"markdown-to-jsx": "^6.10.3", | ||
"node-sass": "^4.13.0", | ||
"popper.js": "^1.16.0", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"react-modal": "^3.11.1", | ||
"react-router-dom": "^5.1.2", | ||
"react-scripts": "3.3.0", | ||
"react-spinners": "^0.6.1", | ||
"typescript": "~3.7.2" | ||
}, | ||
"devDependencies": { | ||
"@testing-library/jest-dom": "^4.2.4", | ||
"@testing-library/react": "^9.3.2", | ||
"@testing-library/user-event": "^7.1.2", | ||
"@types/bytebuffer": "^5.0.40", | ||
"@types/jest": "^24.0.0", | ||
"@types/markdown-to-jsx": "^6.9.1", | ||
"@types/node": "^12.0.0", | ||
"@types/react": "^16.9.0", | ||
"@types/react-dom": "^16.9.0", | ||
"@types/react-modal": "^3.10.4", | ||
"@types/react-router-dom": "^5.1.3", | ||
"cypress": "^3.8.3" | ||
}, | ||
"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" | ||
] | ||
}, | ||
"jest": { | ||
"watchPathIgnorePatterns": [ | ||
"src/__tests__/cypress/*" | ||
] | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!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="A decentralized chat application built on ARK." /> | ||
<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>ARK Messenger</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> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"short_name": "React App", | ||
"name": "Create React App Sample", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
}, | ||
{ | ||
"src": "logo192.png", | ||
"type": "image/png", | ||
"sizes": "192x192" | ||
}, | ||
{ | ||
"src": "logo512.png", | ||
"type": "image/png", | ||
"sizes": "512x512" | ||
} | ||
], | ||
"start_url": ".", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# https://www.robotstxt.org/robotstxt.html | ||
User-agent: * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const createRandomString = () => | ||
Math.random() | ||
.toString(36) | ||
.substring(7); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
describe('Channels', () => { | ||
beforeEach(() => { | ||
const userPassphrase = | ||
'clay harbor enemy utility margin pretty hub comic piece aerobic umbrella acquire'; | ||
|
||
cy.visit('/login'); | ||
|
||
cy.get('input[name=passphrase').type(userPassphrase); | ||
|
||
cy.get('button').click(); | ||
|
||
cy.wait(3000); | ||
}); | ||
|
||
describe('Create Channel', () => { | ||
it('should create and join a new channel', () => { | ||
cy.get('#create-button').click(); | ||
|
||
cy.wait(500); | ||
|
||
cy.get('#create').contains('Channel ID'); | ||
|
||
cy.get('#create').contains('Passphrase'); | ||
|
||
cy.wait(3000); | ||
|
||
cy.get('#join-button-2').click(); | ||
|
||
cy.url().should('not.eq', Cypress.config('baseUrl') + '/channels'); | ||
|
||
cy.get('#page-content-wrapper').contains('No messages'); | ||
}); | ||
}); | ||
|
||
describe('Join Channel', () => { | ||
it('should accept input', () => { | ||
const pw = 'somepassphrase'; | ||
|
||
cy.get('input[name=passphrase') | ||
.type(pw) | ||
.should('have.value', pw); | ||
}); | ||
|
||
it('should join the channel', () => { | ||
const pw = 'road mesh portion rich damp grain defense away pill curious dynamic moment'; | ||
|
||
cy.get('input[name=passphrase') | ||
.type(pw) | ||
.should('have.value', pw); | ||
|
||
cy.get('#join-button').click(); | ||
|
||
cy.url().should('eq', Cypress.config('baseUrl') + '/chat/AJAkJNx1Xpb9cPVWb3hdkXqwvyeBYcoUW7'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { createRandomString as r } from '../helpers'; | ||
|
||
describe('Chat', () => { | ||
beforeEach(() => { | ||
const userPassphrase = | ||
'clay harbor enemy utility margin pretty hub comic piece aerobic umbrella acquire'; | ||
const channelPassphrase = | ||
'limb tobacco green tower time source piano icon run barely pigeon curve'; | ||
|
||
cy.visit('/login'); | ||
|
||
cy.get('input[name=passphrase]').type(userPassphrase); | ||
|
||
cy.get('button').click(); | ||
|
||
cy.get('input[name=passphrase]').type(channelPassphrase); | ||
|
||
cy.get('#join-button').click(); | ||
}); | ||
|
||
describe('Chat', () => { | ||
it('should accept input', () => { | ||
const text = 'some text'; | ||
|
||
cy.get('textarea[name=message]') | ||
.type(text) | ||
.should('have.value', text); | ||
}); | ||
|
||
it("should send a message to the channel by pressing the 'Enter' key", () => { | ||
const randomText = 'Random text: ' + r(); | ||
|
||
cy.get('textarea[name=message]') | ||
.type(randomText) | ||
.should('have.value', randomText) | ||
.type('{enter}'); | ||
|
||
cy.wait(5000); | ||
|
||
cy.get('#page-content-wrapper').contains(randomText); | ||
}); | ||
|
||
it("should send a message to the channel by clicking the 'Send' button", () => { | ||
const randomText = 'Random text: ' + r(); | ||
|
||
cy.get('textarea[name=message]') | ||
.type(randomText) | ||
.should('have.value', randomText); | ||
|
||
cy.get('#send-button').click(); | ||
|
||
cy.wait(5000); | ||
|
||
cy.get('#page-content-wrapper').contains(randomText); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole
__tests__
folder should be moved up to the top-level.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@faustbrian The project is bootstrapped with Create React App and requires the
__tests__
folder to be placed inside thesrc
folder. If you move the folder to the root it will create all kinds of problems and would need quite some extra work to get it working properly. Worst case scenario an eject is necessary, and this would not work well with the goals set out for this project.