├── static └── .gitkeep ├── config ├── prod.env.js ├── dev.env.js └── index.js ├── slack2.gif ├── .firebaserc ├── src ├── assets │ ├── logo.png │ └── Slack_icons.svg ├── pages │ ├── Schat.vue │ ├── Login.vue │ └── Register.vue ├── router │ └── index.js ├── App.vue ├── components │ ├── sidebar │ │ ├── Sidebar.vue │ │ ├── ConnectedUser.vue │ │ ├── Users.vue │ │ └── Channels.vue │ └── messages │ │ ├── SingleMessage.vue │ │ ├── FileModal.vue │ │ ├── Messages.vue │ │ └── MessageForm.vue ├── main.js └── store.js ├── .gitignore ├── .editorconfig ├── .postcssrc.js ├── .babelrc ├── firebase.json ├── README.md ├── index.html └── package.json /static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /slack2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunorafael8/Slack-Clone/HEAD/slack2.gif -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "slack-clone-c9c18" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunorafael8/Slack-Clone/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserlist" field in package.json 6 | "autoprefixer": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { "modules": false }], 4 | "stage-2" 5 | ], 6 | "plugins": ["transform-runtime"], 7 | "comments": false, 8 | "env": { 9 | "test": { 10 | "presets": ["env", "stage-2"], 11 | "plugins": [ "istanbul" ] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "public": "dist", 4 | "redirects": [ { 5 | "source" : "/login", 6 | "destination" : "/", 7 | "type" : 301 8 | }, 9 | { 10 | "source" : "/register", 11 | "destination" : "/", 12 | "type" : 302 13 | }] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # **SLACK CLONE ** 3 | 4 | ---------- 5 | ![Slack](https://github.com/brunorafael8/Slack-Clone/blob/master/slack2.gif) 6 | 7 | *Vue.js + Firebase project* 8 | 9 | ## Build Setup 10 | ---------- 11 | ### install dependencies 12 | >*npm install* 13 | 14 | ### serve with hot reload at localhost:8080 15 | >*npm run dev* 16 | 17 | ### build for production with minification 18 | >*npm run build* 19 | 20 | ### build for production and view the bundle analyzer report 21 | >*npm run build --report* 22 | -------------------------------------------------------------------------------- /src/pages/Schat.vue: -------------------------------------------------------------------------------- 1 | 7 | 17 | 22 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Slack Clone 6 | 7 | 8 | 9 |
10 | 11 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Login from '../pages/Login' 4 | import Register from '../pages/Register' 5 | import Schat from '../pages/Schat' 6 | 7 | 8 | Vue.use(Router) 9 | 10 | export default new Router({ 11 | mode: 'history', 12 | routes: [ 13 | { 14 | path: '/login', 15 | name: 'login', 16 | component: Login 17 | }, 18 | { 19 | path: '/register', 20 | name: 'register', 21 | component: Register 22 | }, 23 | { 24 | path: '/', 25 | name: 'schat', 26 | component: Schat, 27 | beforeEnter: (to, from, next) => { 28 | if(!firebase.auth().currentUser){ 29 | next('/login') 30 | }else{ 31 | next() 32 | } 33 | } 34 | } 35 | ] 36 | }) 37 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 14 | 15 | 28 | -------------------------------------------------------------------------------- /src/components/sidebar/Sidebar.vue: -------------------------------------------------------------------------------- 1 | 12 | 21 | 36 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import firebase from 'firebase' 7 | import store from './store' 8 | 9 | // Initialize Firebase 10 | let config = { 11 | apiKey: "AIzaSyBf7sUbfgN3jNwi2a0jXPW1vocrvwGKrik", 12 | authDomain: "slack-clone-c9c18.firebaseapp.com", 13 | databaseURL: "https://slack-clone-c9c18.firebaseio.com", 14 | projectId: "slack-clone-c9c18", 15 | storageBucket: "slack-clone-c9c18.appspot.com", 16 | messagingSenderId: "643242151043" 17 | }; 18 | firebase.initializeApp(config); 19 | window.firebase = firebase 20 | 21 | const unsuscribe = firebase.auth().onAuthStateChanged(user => { 22 | 23 | store.dispatch('setUser', user) 24 | 25 | new Vue({ 26 | el: '#app', 27 | router, 28 | template: '', 29 | components: { App }, 30 | store 31 | }) 32 | 33 | unsuscribe() 34 | 35 | }) 36 | 37 | Vue.config.productionTip = false 38 | 39 | /* eslint-disable no-new */ 40 | -------------------------------------------------------------------------------- /src/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'Vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | const state = { 7 | currentUser: null, 8 | currentChannel: null, 9 | isPrivate: false 10 | } 11 | 12 | const mutations = { 13 | SET_USER(state, user){ 14 | state.currentUser = user 15 | }, 16 | SET_CURRENT_CHANNEL(state, channel){ 17 | state.currentChannel = channel 18 | }, 19 | SET_PRIVATE(state, isPrivate){ 20 | state.isPrivate = isPrivate 21 | } 22 | } 23 | 24 | const actions = { 25 | setUser({commit}, user){ 26 | commit("SET_USER", user) 27 | }, 28 | setCurrentChannel({commit}, channel){ 29 | commit("SET_CURRENT_CHANNEL", channel) 30 | }, 31 | setPrivate({commit}, isPrivate){ 32 | commit("SET_PRIVATE", isPrivate) 33 | } 34 | } 35 | 36 | const getters = { 37 | currentUser: state => state.currentUser, 38 | currentChannel: state => state.currentChannel, 39 | isPrivate: state => state.isPrivate 40 | } 41 | 42 | export default new Vuex.Store({ 43 | state, 44 | mutations, 45 | actions, 46 | getters 47 | }) 48 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'], 18 | // Run the build command with an extra argument to 19 | // View the bundle analyzer report after build finishes: 20 | // `npm run build --report` 21 | // Set to `true` or `false` to always turn it on or off 22 | bundleAnalyzerReport: process.env.npm_config_report 23 | }, 24 | dev: { 25 | env: require('./dev.env'), 26 | port: 8080, 27 | autoOpenBrowser: true, 28 | assetsSubDirectory: 'static', 29 | assetsPublicPath: '/', 30 | proxyTable: {}, 31 | // CSS Sourcemaps off by default because relative paths are "buggy" 32 | // with this option, according to the CSS-Loader README 33 | // (https://github.com/webpack/css-loader#sourcemaps) 34 | // In our experience, they generally work as expected, 35 | // just be aware of this issue when enabling this option. 36 | cssSourceMap: false 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/assets/Slack_icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/components/messages/SingleMessage.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 44 | 45 | 63 | -------------------------------------------------------------------------------- /src/components/sidebar/ConnectedUser.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 50 | 51 | 63 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "slack_clone", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "Bruno Rafael ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "start": "node build/dev-server.js", 10 | "build": "node build/build.js" 11 | }, 12 | "dependencies": { 13 | "firebase": "^3.9.0", 14 | "md5": "^2.2.1", 15 | "mime-types": "^2.1.15", 16 | "moment": "^2.18.1", 17 | "uuid": "^3.0.1", 18 | "vue": "^2.2.6", 19 | "vue-router": "^2.3.1", 20 | "vuex": "^2.3.1" 21 | }, 22 | "devDependencies": { 23 | "autoprefixer": "^6.7.2", 24 | "babel-core": "^6.22.1", 25 | "babel-loader": "^6.2.10", 26 | "babel-plugin-transform-runtime": "^6.22.0", 27 | "babel-preset-env": "^1.3.2", 28 | "babel-preset-stage-2": "^6.22.0", 29 | "babel-register": "^6.22.0", 30 | "chalk": "^1.1.3", 31 | "connect-history-api-fallback": "^1.3.0", 32 | "copy-webpack-plugin": "^4.0.1", 33 | "css-loader": "^0.28.0", 34 | "eventsource-polyfill": "^0.9.6", 35 | "express": "^4.14.1", 36 | "extract-text-webpack-plugin": "^2.0.0", 37 | "file-loader": "^0.11.1", 38 | "friendly-errors-webpack-plugin": "^1.1.3", 39 | "html-webpack-plugin": "^2.28.0", 40 | "http-proxy-middleware": "^0.17.3", 41 | "image-webpack-loader": "^3.3.1", 42 | "node-sass": "^4.5.3", 43 | "opn": "^4.0.2", 44 | "optimize-css-assets-webpack-plugin": "^1.3.0", 45 | "ora": "^1.2.0", 46 | "rimraf": "^2.6.0", 47 | "sass-loader": "^6.0.5", 48 | "semver": "^5.3.0", 49 | "shelljs": "^0.7.6", 50 | "url-loader": "^0.5.8", 51 | "vue-loader": "^11.3.4", 52 | "vue-style-loader": "^2.0.5", 53 | "vue-template-compiler": "^2.2.6", 54 | "webpack": "^2.6.1", 55 | "webpack-bundle-analyzer": "^2.2.1", 56 | "webpack-dev-middleware": "^1.10.0", 57 | "webpack-hot-middleware": "^2.18.0", 58 | "webpack-merge": "^4.1.0" 59 | }, 60 | "engines": { 61 | "node": ">= 4.0.0", 62 | "npm": ">= 3.0.0" 63 | }, 64 | "browserslist": [ 65 | "> 1%", 66 | "last 2 versions", 67 | "not ie <= 8" 68 | ] 69 | } 70 | -------------------------------------------------------------------------------- /src/components/messages/FileModal.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 72 | -------------------------------------------------------------------------------- /src/pages/Login.vue: -------------------------------------------------------------------------------- 1 | 44 | 87 | 110 | -------------------------------------------------------------------------------- /src/components/messages/Messages.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 99 | 100 | 119 | -------------------------------------------------------------------------------- /src/components/sidebar/Users.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 101 | 102 | 125 | -------------------------------------------------------------------------------- /src/components/sidebar/Channels.vue: -------------------------------------------------------------------------------- 1 | 51 | 114 | 159 | -------------------------------------------------------------------------------- /src/pages/Register.vue: -------------------------------------------------------------------------------- 1 | 57 | 155 | 177 | -------------------------------------------------------------------------------- /src/components/messages/MessageForm.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 158 | 159 | 174 | --------------------------------------------------------------------------------