Skip to content

feat: Add JJSIP based phone option to chat #561

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

Open
wants to merge 8 commits into
base: main
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
23 changes: 23 additions & 0 deletions demo/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Docker ignore for demo app

# Dependencies
node_modules
**/node_modules

# Build output
dist
build

# Dockerfile itself
Dockerfile

# Local development files (examples, add if needed)
# .env
# .env.local
# .vscode
# .idea
# *.log
#
# OS generated files
.DS_Store
Thumbs.db
44 changes: 44 additions & 0 deletions demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Stage 1: Build the Vue.js demo application
FROM node:18-alpine AS build-stage

LABEL maintainer="Vue Advanced Chat Dev Team"
LABEL description="Build stage for the Vue Advanced Chat demo application"

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json (or yarn.lock)
# We copy these first to leverage Docker cache for dependencies
COPY package.json ./
# Assuming npm is used because of package-lock.json in reset script
# The following line for package-lock.json is removed as per instructions
# COPY package-lock.json ./

# Install Python and C++ build tools
RUN apk add --no-cache python3 py3-setuptools make g++

# Install dependencies for the demo app
RUN npm install

# Copy the rest of the demo application source code
COPY . .

# Build the application
# The build script is "vite build" as found in demo/package.json
RUN npm run build

# Stage 2: Serve the built application using Nginx
FROM nginx:stable-alpine AS serve-stage

LABEL maintainer="Vue Advanced Chat Dev Team"
LABEL description="Serve stage for the Vue Advanced Chat demo application"

# Copy built assets from the build stage
# Vite builds to a 'dist' directory by default
COPY --from=build-stage /app/dist /usr/share/nginx/html

# Expose port 80 for Nginx
EXPOSE 80

# Start Nginx when the container launches
CMD ["nginx", "-g", "daemon off;"]
25 changes: 25 additions & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Demo Application

This directory contains the demo application for `vue-advanced-chat`.

## Running with Docker

To build and run the demo application using Docker:

1. **Navigate to the demo directory:**
Make sure you are in the `demo` directory of this project.
```bash
cd path/to/your-project/demo
```

2. **Build the Docker image:**
Run the following command from within the `demo` directory. The `.` specifies that the current directory (`demo/`) is the build context.
```bash
docker build -t vue-advanced-chat-demo .
```

3. **Run the Docker container:**
```bash
docker run -p 8080:80 vue-advanced-chat-demo
```
This will start the demo application, and you can access it at [http://localhost:8080](http://localhost:8080) in your web browser.
1 change: 1 addition & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<strong>We're sorry but vue-advanced-chat doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script src="/jssip-0.2.0.min.js"></script>
<script type="module" src="/src/main.js"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions demo/public/jjsip.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Placeholder for JJSIP.js library
// In a real scenario, this file would contain the actual JJSIP.js code.
console.log("JJSIP.js library (placeholder) loaded.");
144 changes: 144 additions & 0 deletions demo/public/jssip-0.2.0.min.js

Large diffs are not rendered by default.

24 changes: 11 additions & 13 deletions demo/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
class="app-container"
:class="{ 'app-mobile': isDevice, 'app-mobile-dark': theme === 'dark' }"
>
<!-- <div>
<button @click="resetData">
Clear Data
</button>
<button :disabled="updatingData" @click="addData">
Add Data
</button>
</div> -->
<span
v-if="showOptions"
class="user-logged"
Expand Down Expand Up @@ -44,12 +36,12 @@
:current-user-id="currentUserId"
:theme="theme"
:is-device="isDevice"
:jjsip-sip-uri="demoJjsipSipUri"
:jjsip-password="demoJjsipPassword"
:jjsip-web-socket-server="demoJjsipWebSocketServer"
:jjsip-display-name="demoJjsipDisplayName"
@show-demo-options="showDemoOptions = $event"
/>

<!-- <div class="version-container">
v1.0.0
</div> -->
</div>
</div>
</template>
Expand Down Expand Up @@ -90,7 +82,13 @@ export default {
currentUserId: '6R0MijpK6M4AIrwaaCY2',
isDevice: false,
showDemoOptions: true,
updatingData: false
updatingData: false,

// JJSIP Demo Credentials to be passed to ChatContainer
demoJjsipSipUri: 'sip:[email protected]',
demoJjsipPassword: 'demopassword',
demoJjsipWebSocketServer: 'wss://demows.example.com',
demoJjsipDisplayName: 'Demo User from App.vue'
}
},

Expand Down
Loading