├── .dockerignore
├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── assets
├── .babelrc
├── css
│ └── app.css
├── js
│ ├── actions
│ │ ├── cryptoActions.js
│ │ ├── messageActions.js
│ │ ├── userActions.js
│ │ └── usersAction.js
│ ├── app.js
│ ├── components
│ │ ├── App.js
│ │ ├── ChatSegment.js
│ │ ├── ColorPicker.js
│ │ ├── ExportKey.js
│ │ ├── Home.js
│ │ ├── HomepageLayout.js
│ │ ├── InviteUserModal.js
│ │ ├── Main.js
│ │ ├── MainMenuDropdown.js
│ │ ├── MessageForm.js
│ │ ├── Nav.js
│ │ ├── OnlineUsersDropdown.js
│ │ ├── RenderedMessage.js
│ │ ├── RenderedUrl.js
│ │ ├── Root.js
│ │ ├── SignUp.js
│ │ ├── TagsDropdown.js
│ │ └── UserModal.js
│ ├── reducers
│ │ ├── appReducer.js
│ │ ├── cryptoReducer.js
│ │ ├── index.js
│ │ ├── messageReducer.js
│ │ ├── userReducer.js
│ │ └── usersReducer.js
│ ├── registerServiceWorker.js
│ ├── socket.js
│ └── utils
│ │ └── api.js
├── package-lock.json
├── package.json
├── static
│ ├── favicon.ico
│ ├── images
│ │ ├── matt.jpg
│ │ ├── openpgp.worker.min.js
│ │ └── phoenix.png
│ └── robots.txt
├── test
│ ├── App.test.js
│ ├── __mocks__
│ │ ├── fileMock.js
│ │ └── styleMock.js
│ └── mocks
│ │ ├── index.js
│ │ └── initialState.json
├── theme
│ ├── semantic.less
│ ├── site
│ │ └── globals
│ │ │ └── site.overrides
│ └── theme.config
├── webpack.config.js
└── webpack.config.prod.js
├── config
├── config.exs
├── dev.exs
├── prod.exs
└── test.exs
├── datamodel.mwb
├── docker-compose.dev.yml
├── docker-compose.gcp.yml
├── docker-compose.prod.yml
├── docker-compose.yml
├── docker-entrypoint.sh
├── lib
├── app.ex
├── app
│ ├── application.ex
│ ├── message.ex
│ ├── message_tag.ex
│ ├── repo.ex
│ ├── request.ex
│ ├── tag.ex
│ ├── team.ex
│ ├── user.ex
│ ├── user_manager
│ │ ├── error_handler.ex
│ │ ├── guardian.ex
│ │ ├── pipeline.ex
│ │ └── user_manager.ex
│ └── user_request.ex
├── app_web.ex
└── app_web
│ ├── channels
│ ├── presence.ex
│ ├── room_channel.ex
│ ├── user_channel.ex
│ └── user_socket.ex
│ ├── controllers
│ ├── page_controller.ex
│ ├── team_controller.ex
│ └── user_controller.ex
│ ├── endpoint.ex
│ ├── gettext.ex
│ ├── router.ex
│ ├── templates
│ ├── layout
│ │ └── app.html.eex
│ └── page
│ │ └── index.html.eex
│ └── views
│ ├── error_helpers.ex
│ ├── error_view.ex
│ ├── layout_view.ex
│ ├── message_view.ex
│ ├── page_view.ex
│ ├── request_view.ex
│ ├── tag_view.ex
│ ├── team_view.ex
│ ├── user_request_view.ex
│ └── user_view.ex
├── manifest.json
├── mix.exs
├── mix.lock
├── priv
├── gettext
│ ├── en
│ │ └── LC_MESSAGES
│ │ │ └── errors.po
│ └── errors.pot
└── repo
│ ├── migrations
│ ├── 20180426162009_create_users.exs
│ ├── 20180427194318_create_messages.exs
│ ├── 20180427194621_create_tags.exs
│ ├── 20180427194813_create_message_tags.exs
│ ├── 20180427195200_create_teams.exs
│ ├── 20180428193155_add_body_index_to_tags.exs
│ ├── 20180428200542_add_name_index_to_teams.exs
│ ├── 20180507182458_add_color_to_user.exs
│ ├── 20180512131400_add_claims_to_teams.exs
│ ├── 20180515170348_add_unique_constraint_to_team_names.exs
│ ├── 20180527173825_add_url_data_to_message.exs
│ ├── 20180530191317_add_unique_constraint_to_tags.exs
│ ├── 20180603151531_create_requests.exs
│ ├── 20180603153408_addscope_and_group_pub_key_to_requests.exs
│ ├── 20180606185126_add_avatar_to_users.exs
│ ├── 20180609181732_add_avatar_to_requests.exs
│ ├── 20180616164207_add_nickname_to_team.exs
│ ├── 20181209031824_add_public_key_to_users.exs
│ ├── 20181213004517_add_encrypted_password_to_users.exs
│ ├── 20181222201425_add_required_to_public_key_on_users.exs
│ ├── 20181222211648_create_user_requests.exs
│ └── 20181223162110_add_rejected_to_user_requests.exs
│ └── seeds.exs
├── react-logo.png
├── scripts
├── attach.sh
├── run_dev.sh
├── run_gcp.sh
└── run_prod.sh
└── test
├── app_web
├── channels
│ └── room_channel_test.exs
└── views
│ ├── layout_view_test.exs
│ └── page_view_test.exs
├── support
├── channel_case.ex
├── conn_case.ex
└── data_case.ex
└── test_helper.exs
/.dockerignore:
--------------------------------------------------------------------------------
1 | assets/node_modules
2 | _build/
3 | deps/
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # App artifacts
2 | /_build
3 | /db
4 | /deps
5 | /*.ez
6 |
7 | # Generated on crash by the VM
8 | erl_crash.dump
9 |
10 | # Generated on crash by NPM
11 | npm-debug.log
12 |
13 | # Static artifacts
14 | /assets/node_modules
15 |
16 | # Since we are building assets from assets/,
17 | # we ignore priv/static. You may want to comment
18 | # this depending on your deployment strategy.
19 | /priv/static/
20 |
21 | # Files matching config/*.secret.exs pattern contain sensitive
22 | # data and you should not commit them into version control.
23 | #
24 | # Alternatively, you may comment the line below and commit the
25 | # secrets files as long as you replace their contents by environment
26 | # variables.
27 | /config/*.secret.exs
28 | .env
29 | db-key.json
30 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM elixir:1.6
2 |
3 | RUN apt-get update && apt-get install -qq -y inotify-tools curl libnotify-bin --fix-missing --no-install-recommends
4 |
5 | RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
6 | RUN apt-get update && apt-get install -qq -y nodejs tar --fix-missing --no-install-recommends
7 |
8 | ENV RUSTUP_HOME=/usr/local/rustup \
9 | CARGO_HOME=/usr/local/cargo \
10 | PATH=/usr/local/cargo/bin:$PATH \
11 | RUST_VERSION=1.33.0
12 | RUN set -eux; \
13 | \
14 | dpkgArch="$(dpkg --print-architecture)"; \
15 | case "${dpkgArch##*-}" in \
16 | amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='c9837990bce0faab4f6f52604311a19bb8d2cde989bea6a7b605c8e526db6f02' ;; \
17 | armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='297661e121048db3906f8c964999f765b4f6848632c0c2cfb6a1e93d99440732' ;; \
18 | arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='a68ac2d400409f485cb22756f0b3217b95449884e1ea6fd9b70522b3c0a929b2' ;; \
19 | i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='27e6109c7b537b92a6c2d45ac941d959606ca26ec501d86085d651892a55d849' ;; \
20 | *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
21 | esac; \
22 | \
23 | url="https://static.rust-lang.org/rustup/archive/1.11.0/${rustArch}/rustup-init"; \
24 | wget "$url"; \
25 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
26 | chmod +x rustup-init; \
27 | ./rustup-init -y --no-modify-path --default-toolchain $RUST_VERSION; \
28 | rm rustup-init; \
29 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
30 | rustup --version; \
31 | cargo --version; \
32 | rustc --version;
33 |
34 | WORKDIR /app
35 | COPY ./mix* ./
36 | RUN mix local.hex --force
37 | RUN mix local.rebar --force
38 | RUN export MIX_ENV=prod && mix deps.get --force
39 | RUN cd deps/html5ever/native/html5ever_nif && cargo update
40 | RUN export MIX_ENV=prod && mix deps.compile
41 |
42 | COPY ./assets/package* ./assets/
43 | RUN cd assets && npm i
44 | COPY ./assets ./assets/
45 | RUN cd assets && npm run build
46 | RUN mkdir -p /app/priv/static/js
47 | RUN cp /app/assets/node_modules/openpgp/dist/openpgp.worker.min.js /app/priv/static/js
48 | RUN cp /app/assets/node_modules/openpgp/dist/openpgp.min.js /app/priv/static/js
49 |
50 |
51 | COPY ./manifest.json ./priv/static/
52 | COPY ./react-logo.png ./priv/static/images/
53 | COPY ./ ./
54 | RUN export MIX_ENV=prod && mix compile --force
55 | RUN export MIX_ENV=prod && mix phx.digest
56 | RUN rm -rf deps/*/.fetch
57 |
58 | EXPOSE 4000
59 | ENTRYPOINT [ "./docker-entrypoint.sh" ]
60 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Kenneth Bergquist
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Mentat
2 |
3 | [ ](https://app.codeship.com/projects/290692)
4 |
5 | Mentat is a group chat application with a focus on message tagging and privacy. It allows deep categorization and retrieval of messages based on tags (a la Twitter hashtags). It also aims for reasonable privacy, meaning everything aside from feature metadata is end-to-end encrypted with OpenPGP, including avatars. Feature metadata is anything that the server depends on in order to deliver a feature; tags are stored in plaintext in order to index and retrieve them from the database, and URLs are sent as plaintext so the server can ping them and generate a thumbnail.
6 |
7 | See it in action here:
8 |
9 | https://metachat.app
10 |
11 | ## Features
12 |
13 | - End-to-end encryption by default
14 | - Deeply embedded tagging system
15 | - Link previews
16 | - Web notifications
17 |
18 | ## Usage Instructions
19 |
20 | ### Inviting users
21 |
22 | Each room is identified by its UUID. To invite a user, either share the UUID found in the URL of the room, or simply share the URL. The user will be instructed to set a username, then a new request will be generated. Click the users icon in the upper left corner and accept the request to add the user to the group.
23 |
24 | ### Adding message tags
25 |
26 | Message tagging is the key feature of Mentat. There are several ways to add a tag to a message:
27 |
28 | 1. Embed a tag in the message, like you can with a tweet.
29 | 2. Select a tag or several tags from the tag dropdown. When you send a message, all the selected tags will be added to the message.
30 | 3. Click the plus icon next to a message after it is sent. Type the tag and press Enter.
31 |
32 | ### Browsing tags
33 |
34 | When you start a session, no tags are selected. In this view, you will see every message that is sent, and you can scroll through all previous messages. When you select a tag, you will only see past messages that have that tag, and you will only receive messages with that tag. You can select several tags to sort by a number of categories, allowing quick access to past messages on the topic that interests you. Use this feature to categorize your messages based on project, memes, events, etc.
35 |
36 | ## User Authentication
37 |
38 | Like the [Web Auth API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API), Mentat uses asymmetric cryptography for authentication. When you first join a chat room, a personal keypair will be generated and stored in browser storage. If you are the creator of this room, the client will also generate a keypair for the room. If not, a request will be generated: the client will send its personal public key to the server and request access to the room. Someone who already has the group keypair must accept the request to grant you access. When the member accepts your request, her client will encrypt the room private key with your public key and send the encrypted key to the server. Now your client can grab the room key, decrypt it, and begin decrypting the room's messages.
39 |
40 | Right now, it's the user's responsibility to use a secure device that only she has access to. On the roadmap, a user could specify a temporary session that would be deleted after a certain amount of time or inactivity.
41 |
42 | ## Stack
43 |
44 | - fully containerized
45 |
46 | ### Server
47 |
48 | - Phoenix/Elixir
49 | - Postgres
50 |
51 | ### Client
52 |
53 | - React/Redux
54 | - OpenPGP.js
55 |
56 | ## Development
57 |
58 | Ensure that Docker and docker-compose are installed and the Docker daemon is running. Start the development environment by navigating to the root of the project and running the following script: `./scripts/run_dev.sh`. Once the compilation and Javascript build are complete, the app will be available at `http://localhost:4000`.
59 |
60 | ## Project Structure
61 |
62 | ## Invitation to contribute
63 |
--------------------------------------------------------------------------------
/assets/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env", "react", "stage-2"]
3 | }
--------------------------------------------------------------------------------
/assets/css/app.css:
--------------------------------------------------------------------------------
1 | .visible.transition {
2 | margin-top: auto !important;
3 | display: inline-block !important;
4 | position: relative;
5 | top: 20%;
6 | }
7 |
8 | .newTagInput input {
9 | width: 8px;
10 | -webkit-transition: width 2s; /* Safari */
11 | transition: width 2s;
12 | }
13 |
14 | .newTagInput input:focus {
15 | width: 100px;
16 | }
--------------------------------------------------------------------------------
/assets/js/actions/cryptoActions.js:
--------------------------------------------------------------------------------
1 | let openpgp = require('openpgp');
2 | import randomWords from 'random-words';
3 |
4 | export const burnBrowser = () => {
5 | return {
6 | type: 'burn_browser'
7 | }
8 | }
9 |
10 | export const importKey = (publicKey, privateKey, passphrase, requests) => {
11 | return async (dispatch, _) => {
12 | dispatch({
13 | type: 'new_key',
14 | publicKey,
15 | privateKey,
16 | passphrase
17 | })
18 | const privKeyObj = openpgp.key.readArmored(privateKey).keys[0];
19 | await privKeyObj.decrypt(passphrase)
20 | requests.requests.forEach(async (request) => {
21 | const privateGroupKeyOptions = {
22 | message: openpgp.message.readArmored(request.encrypted_team_private_key),
23 | privateKeys: [privKeyObj]
24 | };
25 | const privateKey = await openpgp.decrypt(privateGroupKeyOptions)
26 | dispatch({
27 | type: 'new_group_key',
28 | room: request.team_name,
29 | publicKey: request.team_public_key,
30 | privateKey: privateKey.data,
31 | name: request.team_nickname
32 | })
33 | })
34 | }
35 | }
36 |
37 | export const approveRequest = (publicKey, encryptedPrivateKey, encryptedPassphrase, requests) => {
38 | return async (dispatch, getState) => {
39 | const state = getState();
40 | var privKeyObj = openpgp.key.readArmored(state.cryptoReducer.privateKey).keys[0];
41 | await privKeyObj.decrypt(state.cryptoReducer.passphrase)
42 | const privateKeyOptions = {
43 | message: openpgp.message.readArmored(encryptedPrivateKey),
44 | privateKeys: [privKeyObj]
45 | };
46 | const privateKey = await openpgp.decrypt(privateKeyOptions)
47 | const passphraseOptions = {
48 | message: openpgp.message.readArmored(encryptedPassphrase),
49 | privateKeys: [privKeyObj]
50 | };
51 | const passphrase = await openpgp.decrypt(passphraseOptions)
52 | const newPrivateKey = privateKey.data
53 | const newPassphrase = passphrase.data
54 | dispatch({
55 | type: 'new_key',
56 | publicKey,
57 | privateKey: newPrivateKey,
58 | passphrase: newPassphrase
59 | })
60 | privKeyObj = openpgp.key.readArmored(newPrivateKey).keys[0];
61 | await privKeyObj.decrypt(newPassphrase)
62 | requests.requests.forEach(async (request) => {
63 | const privateGroupKeyOptions = {
64 | message: openpgp.message.readArmored(request.encrypted_team_private_key),
65 | privateKeys: [privKeyObj]
66 | };
67 | const privateKey = await openpgp.decrypt(privateGroupKeyOptions)
68 | dispatch({
69 | type: 'new_group_key',
70 | room: request.team_name,
71 | publicKey: request.team_public_key,
72 | privateKey: privateKey.data,
73 | name: request.team_nickname
74 | })
75 | })
76 | }
77 | }
78 |
79 | export const generateKeypair = () => {
80 | return (dispatch, getState) => {
81 | const passphrase = randomWords({ exactly: 10, join: ' ' })
82 | const options = {
83 | userIds: [{ name:'Example Example', email:'example@example.com' }],
84 | numBits: 2048,
85 | passphrase: passphrase
86 | };
87 |
88 | openpgp.generateKey(options).then((key) => {
89 | const privateKey = key.privateKeyArmored;
90 | const publicKey = key.publicKeyArmored;
91 | dispatch({
92 | type: 'new_key',
93 | passphrase,
94 | privateKey,
95 | publicKey
96 | });
97 | });
98 | }
99 | }
100 |
101 | export const generateGroupKeypair = (room, roomName) => {
102 | return (dispatch, getState) => {
103 | const options = {
104 | userIds: [{ name:'Example Example', email:'example@example.com' }],
105 | numBits: 2048,
106 | passphrase: ''
107 | };
108 |
109 | openpgp.generateKey(options).then((key) => {
110 | const privateKey = key.privateKeyArmored;
111 | const publicKey = key.publicKeyArmored;
112 | return dispatch({
113 | type: 'new_group_key',
114 | privateKey,
115 | publicKey,
116 | room,
117 | name: roomName
118 | });
119 | });
120 | }
121 | }
122 |
123 | export const receiveGroupKeypair = (room, publicKey, encryptedPrivateKey, users = [], name = '') => {
124 | return (dispatch, getState) => {
125 | const state = getState();
126 | var privKeyObj = openpgp.key.readArmored(state.cryptoReducer.privateKey).keys[0];
127 | privKeyObj.decrypt(state.cryptoReducer.passphrase).then(() => {
128 | const options = {
129 | message: openpgp.message.readArmored(encryptedPrivateKey),
130 | privateKeys: [privKeyObj]
131 | };
132 | openpgp.decrypt(options).then((plaintext) => {
133 | dispatch({
134 | type: 'new_group_key',
135 | privateKey: plaintext.data,
136 | publicKey,
137 | room,
138 | name
139 | });
140 | const groupPrivateKey = openpgp.key.readArmored(plaintext.data).keys[0];
141 | users.forEach((user) => {
142 | if (user.avatar) {
143 | const groupOptions = {
144 | privateKeys: [groupPrivateKey],
145 | message: openpgp.message.readArmored(user.avatar)
146 | }
147 | openpgp.decrypt(groupOptions).then((plaintext) => {
148 | const addUser = {
149 | ...user,
150 | avatar: plaintext.data
151 | };
152 | dispatch({type: 'add_user', user: addUser})
153 | });
154 | }
155 | });
156 | });
157 | });
158 | }
159 | }
160 |
161 | export const newGroupName = (room, nickname) => {
162 | return {
163 | type: 'new_group_name',
164 | room,
165 | nickname
166 | }
167 | }
168 |
169 | export const setGroupPublic = (room) => {
170 | return {
171 | type: 'set_public',
172 | room: room
173 | }
174 | }
--------------------------------------------------------------------------------
/assets/js/actions/messageActions.js:
--------------------------------------------------------------------------------
1 | export const addMessage = (message) => {
2 | return {
3 | type: 'add_message',
4 | id: message.id,
5 | message
6 | }
7 | };
8 |
9 | export const newUrl = (id, urlData, tag) => {
10 | return (dispatch, _) => {
11 | dispatch({
12 | type: 'new_url',
13 | id,
14 | urlData
15 | })
16 |
17 | if (tag) {
18 | dispatch({
19 | type: 'new_tag',
20 | id,
21 | tag
22 | })
23 | }
24 | }
25 | };
26 |
27 | export const newTag = (id, tag) => {
28 | return {
29 | type: 'new_tag',
30 | id,
31 | tag
32 | }
33 | };
34 |
35 | export const refreshTags = (id, tags) => {
36 | return {
37 | type: 'update_tags',
38 | id,
39 | tags
40 | }
41 | }
42 |
43 | export const removeTag = (id, tag) => {
44 | return {
45 | type: 'remove_tag',
46 | id,
47 | tag
48 | }
49 | }
--------------------------------------------------------------------------------
/assets/js/actions/userActions.js:
--------------------------------------------------------------------------------
1 | export const updateName = (name, color) => {
2 | return {
3 | type: 'set_name',
4 | name,
5 | color
6 | }
7 | }
8 |
9 | export const updateUrlPreviews = (urlPreviews) => {
10 | return {
11 | type: 'set_url_previews',
12 | urlPreviews
13 | }
14 | }
15 |
16 | export const signIn = (email, password) => {
17 | return (dispatch, _) => {
18 | fetch('/auth/login', {
19 | method: 'POST',
20 | headers: {
21 | 'Content-Type': 'application/json'
22 | },
23 | body: JSON.stringify({
24 | email,
25 | password
26 | })
27 | }).then((response) => {
28 | return response.json();
29 | }).then((response) => {
30 | if (response.error) {
31 | dispatch({
32 | type: 'auth_errors',
33 | errors: { email: ['or password incorrect.']}
34 | })
35 | } else {
36 | dispatch({
37 | type: 'sign_in',
38 | token: response.jwt,
39 | id: response.id,
40 | name: response.name,
41 | color: response.color
42 | })
43 | }
44 | })
45 | }
46 | }
47 |
48 | export const expireToken = () => {
49 | return {
50 | type: 'expire_token'
51 | }
52 | }
53 |
54 | export const signUp = (email, password) => {
55 | return (dispatch, getState) => {
56 | const state = getState()
57 | fetch('/auth/sign_up', {
58 | method: 'POST',
59 | headers: {
60 | 'Content-Type': 'application/json'
61 | },
62 | body: JSON.stringify({
63 | email,
64 | password,
65 | publicKey: state.cryptoReducer.publicKey,
66 | color: state.userReducer.color
67 | })
68 | }).then((response) => {
69 | return response.json();
70 | }).then((response) => {
71 | if (response.errors) {
72 | dispatch({
73 | type: 'auth_errors',
74 | errors: response.errors
75 | })
76 | } else {
77 | dispatch({
78 | type: 'sign_in',
79 | token: response.jwt,
80 | id: response.id,
81 | name: email
82 | })
83 | }
84 | })
85 | }
86 | }
--------------------------------------------------------------------------------
/assets/js/actions/usersAction.js:
--------------------------------------------------------------------------------
1 | export const addUser = (user) => {
2 | return {
3 | type: 'add_user',
4 | user
5 | }
6 | }
7 |
8 | export const setLastSynced = (lastSynced) => {
9 | return {
10 | type: 'set_last_synced',
11 | lastSynced
12 | }
13 | }
--------------------------------------------------------------------------------
/assets/js/app.js:
--------------------------------------------------------------------------------
1 | // Brunch automatically concatenates all files in your
2 | // watched paths. Those paths can be configured at
3 | // config.paths.watched in "brunch-config.js".
4 | //
5 | // However, those files will only be executed if
6 | // explicitly imported. The only exception are files
7 | // in vendor, which are never wrapped in imports and
8 | // therefore are always executed.
9 |
10 | // Import dependencies
11 | //
12 | // If you no longer want to use a dependency, remember
13 | // to also remove its path from "config.paths.watched".
14 | import "phoenix_html"
15 | import "../theme/semantic.less";
16 | import '../node_modules/huebee/dist/huebee.css'
17 | import '../css/app.css';
18 | import React from 'react'
19 | import ReactDOM from 'react-dom'
20 | import Root from './components/Root'
21 | import registerServiceWorker from './registerServiceWorker';
22 |
23 | ReactDOM.render(
32 | Press the button below to export your private account key to a file. Keep this file safe and secure: you can use it to restore your account if you ever lose access. 33 |
34 |145 | Tag messages to create channels of content on the fly. Dynamically categorize your conversations, allowing quick retrieval of the content that matters to you. Metachat intelligently groups your shared links for you. 146 |
147 |151 | Your messages on Metachat are end-to-end encrypted: only the members of your group have access to your content. 152 |
153 |That is what they all say about us
168 |
174 |
187 | Instead of focusing on content creation and hard work, we have learned how to master the 188 | art of doing nothing by providing massive amounts of whitespace and generic content that 189 | can seem massive, monolithic and worth your attention. 190 |
191 | 194 |206 | Yes I know you probably disregarded the earlier boasts as non-sequitur filler content, but 207 | it's really true. It took years of gene splicing and combinatory DNA research, but our 208 | bananas can really dance. 209 |
210 | 213 |241 | Extra space for a call to action inside the footer that could help re-engage users. 242 |
*/} 243 |39 | Are you sure? This will permanently delete your keys and messages, revoking access to the room. 40 |
41 |103 | Are you sure? This will permanently delete your keys and messages, revoking access to the room. 104 |
105 |A productive web framework that
does not compromise speed and maintainability.