Skip to content

Commit

Permalink
Merge pull request #19 from openchatai/feat/dashboard
Browse files Browse the repository at this point in the history
Feat/dashboard
  • Loading branch information
gharbat authored Sep 7, 2023
2 parents f05ac63 + f2d4132 commit 4adf18a
Show file tree
Hide file tree
Showing 479 changed files with 17,947 additions and 2,378 deletions.
19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,29 @@ install:
@sleep 20

@echo "$(COLOR_BOLD)=== Clearing backend server config cache ===$(COLOR_RESET)"
$(DOCKER_COMPOSE) exec dashboard php artisan cache:clear
$(DOCKER_COMPOSE) exec dashboard php artisan config:cache
$(DOCKER_COMPOSE) exec dashboard php artisan migrate
$(DOCKER_COMPOSE) exec dashboard php artisan key:generate
$(DOCKER_COMPOSE) exec backend php artisan cache:clear
$(DOCKER_COMPOSE) exec backend php artisan config:cache
$(DOCKER_COMPOSE) exec backend php artisan migrate
$(DOCKER_COMPOSE) exec backend php artisan key:generate

@echo "$(COLOR_BOLD)=== Run backend server migrations ===$(COLOR_RESET)"
$(DOCKER_COMPOSE) exec dashboard php artisan storage:link
$(DOCKER_COMPOSE) exec backend php artisan storage:link

@echo "$(COLOR_BOLD)=== Installation completed ===$(COLOR_RESET)"
@echo "$(COLOR_BOLD)=== 🔥🔥 You can now access the dashboard at -> http://localhost:8000 ===$(COLOR_RESET)"
@echo "$(COLOR_BOLD)=== 🔥🔥 You can now access the dashboard at -> http://localhost:8888 ===$(COLOR_RESET)"
@echo "$(COLOR_BOLD)=== Enjoy! ===$(COLOR_RESET)"

db-setup:
$(DOCKER_COMPOSE) exec dashboard php artisan migrate:fresh --seed
$(DOCKER_COMPOSE) exec backend php artisan migrate:fresh --seed

down:
$(DOCKER_COMPOSE) down --remove-orphans

exec-backend:
$(DOCKER_COMPOSE) exec backend bash

exec-dashboard:
$(DOCKER_COMPOSE) exec dashboard bash
$(DOCKER_COMPOSE) exec dashboard /bin/sh

exec-llm-server:
$(DOCKER_COMPOSE) exec llm-server bash
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<img alt="GitHub Issues" src="https://img.shields.io/github/issues/openchatai/opencopilot" />
<img alt="GitHub Pull Requests" src="https://img.shields.io/github/issues-pr/openchatai/opencopilot" />
<img alt="Github License" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
<img alt="Discord" src="https://img.shields.io/discord/1110910277110743103?label=Discord&logo=discord&logoColor=white&style=plastic&color=d7b023)](https://discord.gg/Q8hHfdav" />
<img alt="Discord" src="https://imgx.shields.io/discord/1110910277110743103?label=Discord&logo=discord&logoColor=white&style=plastic&color=d7b023)](https://discord.gg/Q8hHfdav" />
</p>

![image](https://github.com/openchatai/OpenCopilot/assets/32633162/a0cdc888-d2de-46b7-8c0b-96e876050b6e)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/.phpunit.cache
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.env.production
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode
36 changes: 36 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Use an official PHP runtime as the base image
FROM php:8.1-cli

# Install system dependencies
RUN apt-get update && apt-get install -y \
libpq-dev \
libzip-dev \
zip \
unzip \
git

RUN docker-php-ext-install pdo pdo_mysql

# Set the working directory
WORKDIR /var/www/html

# Copy the project files to the container
COPY . .

# Copy the .env file (assuming it's in the same directory as the Dockerfile)
COPY .env.example .env

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer --version
# Install Composer dependencies
RUN composer install --no-plugins --no-scripts

# Generate the Laravel application key
RUN php artisan key:generate

# Expose the container's port 5000
EXPOSE 5000

# Start the Laravel development server
CMD php artisan serve --host=0.0.0.0 --port=5000
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.5",
"vite": "^4.0.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
251 changes: 251 additions & 0 deletions backend/public/pilot.js

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,21 @@
</main>


<script src="/pilot.js?V1"></script>
<script src="http://localhost:8888/backend/pilot.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script>
initAiCoPilot({
initialMessages: ["I can support you in managing your pets shop, how I can help you today?"],
token: "{{ $token }}",
triggerSelector: "#triggerSelector",
headers: {
Authorization: "Bearer your_auth_token_goes_here",
},
});
window.onload = () => {
initAiCoPilot({
initialMessage: "Hello, how I can help you?", // Initial message.
token: "{{ $token }}",
triggerSelector: "#triggerSelector", // The selector of the element that will trigger the widget on click.
apiUrl: "http://localhost:8888/backend/api", // The url of the copilot backend API.
headers: {
// Headers that you want to send with every message request to your backend.
Authorization: "Your backend auth token",
},
});
};
</script>

</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,21 @@
</main>


<script src="/pilot.js?V1"></script>
<script src="http://localhost:8888/backend/pilot.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script>
initAiCoPilot({
initialMessages: ["How I can help you today?"],
token: "{{ $token }}",
triggerSelector: "#triggerSelector",
headers: {
Authorization: "Bearer your_auth_token_goes_here",
},
});
window.onload = () => {
initAiCoPilot({
initialMessage: "Hello, how I can help you?", // Initial message.
token: "{{ $token }}",
triggerSelector: "#triggerSelector", // The selector of the element that will trigger the widget on click.
apiUrl: "http://localhost:8888/backend/api", // The url of the copilot backend API.
headers: {
// Headers that you want to send with every message request to your backend.
Authorization: "Your backend auth token",
},
});
};
</script>

</body>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions backend/routes/web.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

use App\Http\Controllers\ChatbotController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

/**
* Demo
*/
Route::get('/demo/{token}', [ChatbotController::class, 'demo'])->name('demo');


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions dashboard/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Dockerfile
.dockerignore
node_modules
npm-debug.log
README.md
.next
.git
6 changes: 6 additions & 0 deletions dashboard/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["next","next/core-web-vitals"],
"rules": {
"react/no-unescaped-entities":0
}
}
52 changes: 34 additions & 18 deletions dashboard/.gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
/.phpunit.cache
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.env.production
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode
/.pnp
.pnp.js
.idea/
# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
1 change: 1 addition & 0 deletions dashboard/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.17.0
Loading

0 comments on commit 4adf18a

Please sign in to comment.