All Projects → jmaczan → Basic Vue Chat

jmaczan / Basic Vue Chat

Easy to use Vue chat.

Projects that are alternatives of or similar to Basic Vue Chat

Swiftychat
SwiftUI Chat UI (Client) Framework & Documentation to get started!
Stars: ✭ 50 (-21.87%)
Mutual labels:  chatroom, chat, chat-application
Vue Advanced Chat
A beautiful chat rooms component made with Vue.js - compatible with Vue, React & Angular
Stars: ✭ 351 (+448.44%)
Mutual labels:  chatroom, chat, chat-application
Darkwire.io
End-to-end encrypted instant web chat
Stars: ✭ 594 (+828.13%)
Mutual labels:  chatroom, chat, chat-application
Unplug
unplug : desktop client for matrix.org (work-in-progress)
Stars: ✭ 45 (-29.69%)
Mutual labels:  chat, chat-application
Workerman Chat
Websocket chat room written in PHP based on workerman.
Stars: ✭ 988 (+1443.75%)
Mutual labels:  chatroom, chat
Heal O Chat
Heal-O-Chat is a Social Media Application for people who have been feeling less motivated in life or are losing hope. This platform allows users to chat with people and share their thoughts and feelings with each other and thereby let go of stress, anxiety, and depression that they've been feeling for long.
Stars: ✭ 42 (-34.37%)
Mutual labels:  chat, chat-application
Vms
A Vue.js 2.0 Content Management System
Stars: ✭ 885 (+1282.81%)
Mutual labels:  vuex, vuejs2
Tick.chat
Chat via nearby persons. Instant, Secure, Anonymously. 🕶
Stars: ✭ 50 (-21.87%)
Mutual labels:  chat, chat-application
Ticket Conductor
A free and open-source Laravel 5.5 and VueJS (SPA) Ticket system
Stars: ✭ 48 (-25%)
Mutual labels:  vuex, vuejs2
Simple Todo Tutorial
Simple todo app built with Vue 2.0 and Vuex 2.0
Stars: ✭ 62 (-3.12%)
Mutual labels:  vuex, vuejs2
Vuex Flash
VueJs Flash Message Component within Vuex
Stars: ✭ 54 (-15.62%)
Mutual labels:  vuex, vuejs2
React Bell Chat
🔔 Easy to use chat user interface for React
Stars: ✭ 38 (-40.62%)
Mutual labels:  chat, chat-application
Createmap
Create a Map - City of Baltimore
Stars: ✭ 31 (-51.56%)
Mutual labels:  vuex, vuejs2
Vuetify Material Dashboard
Vuetify Material Dashboard - Open Source Material Design Admin
Stars: ✭ 1,023 (+1498.44%)
Mutual labels:  vuex, vuejs2
Vuejs Interview Questions
List of 300 VueJS Interview Questions And Answers
Stars: ✭ 948 (+1381.25%)
Mutual labels:  vuex, vuejs2
Ionic Chat With Firebase
IONIC Chat With Firebase
Stars: ✭ 53 (-17.19%)
Mutual labels:  chat, chat-application
Chatair Android
💬 A full featured chat in android using Firestore
Stars: ✭ 55 (-14.06%)
Mutual labels:  chat, chat-application
Genal Chat
🐱‍🏍阿童木聊天室 nestjs+vue全栈聊天室 前后端分离 typescript一把梭
Stars: ✭ 1,105 (+1626.56%)
Mutual labels:  chatroom, vuex
Blog Admin
personal blog administration and management, by iview
Stars: ✭ 13 (-79.69%)
Mutual labels:  vuex, vuejs2
Chat21 Ios Sdk
DEPRECATED
Stars: ✭ 15 (-76.56%)
Mutual labels:  chat, chat-application

basic-vue-chat

Build Status Version

Implementation of Vue-based chat.

Installation

You can install the component using package managers, such as npm or yarn or install component from the repository.

npm

npm i basic-vue-chat

yarn

yarn add basic-vue-chat

using repository

git clone https://github.com/jmaczan/basic-vue-chat.git
cd basic-vue-chat
npm i

Dependencies

Components uses Vue (vue package), Fontawesome and Moment.js for Vue (vue-moment).

Usage

Chat is a single Vue component, which you can find in /src/components/basic-vue-chat/. To start, just import BasicVueChat component and put the following line into your html code:

<basic-vue-chat />

Pushing messages

To push message to chat, just pass newMessage prop to BasicVueChat. Example:

<basic-vue-chat :new-message="message" />

The message object above may be part of data in your Vue component in which you will use BasicVueChat.

Example of correct message structure:

{
  id: 0,
  author: 'Person',
  imageUrl: 'http://path/to/image',
  image: '',
  contents: 'hi there',
  date: '16:30'
}

You can find example of message pushing in App.vue file.

Handling messages from user

When user sends message, the message is propagated to BasicVueChat component and event newOwnMessage is emitted. To handle this event, you can for example do this:

<basic-vue-chat @newOwnMessage="onNewOwnMessage" />

where onNewOwnMessage(message) is a method in your Vue component in which you will use BasicVueChat.

Example of correct event payload structure:

{
  id: 1,
  imageUrl: 'http://path/to/image',
  image: File(),
  contents: 'hello',
  date: '16:31'
}

Images

You can upload and receive images. To attach image, use paperclip button. Image will be emitted in message on image (as File object) and imageUrl (path string) properties.

Commands

To start development, you can use hot reload mode:

npm run serve

To build production version:

npm run build

To run tests:

npm test

Mock data

To attach mock data, just pass logic prop attachMock to BasicVueChat.

Customization

Styles

Styles are imported in main BasicVueChat component and variables have !default values, so it means that you can override default values by defining your own variables before styles import.

<style lang="scss">
$primary: red;
// above the following import you can override default values of variables like $primary 
@import "../../assets/scss/main.scss";
</style>

Title

Pass prop title to BasicVueChat component.

<basic-vue-chat :title="'My Best Team'" />

Initial data

Pass prop initialFeed to BasicVueChat component.

<basic-vue-chat :initial-feed="feed" />

Example of correct data structure:

const feed = [
  {
    id: 1,
    author: 'Person',
    imageUrl: 'http://path/to/image',
    contents: 'hi there',
    date: '16:30'
  },
  {
    id: 0,
    author: 'Me',
    contents: 'hello',
    date: '16:30'
  }
]

Pass prop initialAuthorId to BasicVueChat component to define current user's ID. Default value is 0.

Styling

Chat uses SCSS, so you can easily override variables used in project. You can find them in /src/assets/scss/modules/_variables.scss. All variables have default values.

Description Variable Default value
Primary color $primary $slate-blue (#6B63D8)
Secondary color $secondary $lavender (#B284ED)
Header color $header-color $ghost-white (#FAF9FF)
Input background color $input-background-color $alice-blue (#F2EFFF)
Font family $font-family 'Source Sans Pro', sans-serif
Font weight $font-weight 400
Font size $font-size 14px
Dark text color $dark-text-color $madison (#2C3E50)
Light text color $light-text-color $ghost-white (#FAF9FF)
Dark background color $dark-bg $madison (#2C3E50)
Light background color $light-bg $white (#FFFFFF)
Chat window width $window-width 500px
Chat window height $window-height 400px
Message max width $message-max-width 200px

Code structure

  1. assets
    • Sass standard CSS code structure
    • Components styles in partials directory
    • Variables and settings in modules directory
  2. components
    • chat's components are in subdirectories of basic-vue-chat directory
  3. helpers
    • reusable helpers for scrolling functionalities
  4. App.vue - runner file
  5. main.js - project config

Technologies used

  1. JavaScript
    • Vue
    • Moment.js
  2. HTML5
  3. CSS
    • SCSS
    • BEM
  4. Tests
    • Jest
    • Vue test utils
  5. Tooling
    • npm
  6. Continuous Integration
    • Travis CI
  7. Linting
    • ESLint standard config

Developed and tested under macOS High Sierra 10.13 and Google Chrome 69.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].