Skip to content
Merged
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
28 changes: 0 additions & 28 deletions .github/workflows/full-ci.yml

This file was deleted.

21 changes: 20 additions & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,29 @@ function App() {
return data.response.trim();
};

const openWindowPrompt = async () => {
const url = prompt('Enter the URL of the database you want to add');
const name = prompt('Enter the name of the database you want to add');
if (url && name) {
const data = await apiFetch('/sql/add-database', {
method: 'POST',
data: { databaseUrl: url, databaseName: name },
});
console.log(data);
alert('Database added successfully');
}
};

return (
<main className={styles.main}>
<img src={sqlLogo} className={styles.icon}></img>
<h3 className={styles.heading}>SQL Assistant</h3>
<h3 className={styles.heading}>
SQL Assistant
</h3>
<small>Current Database: cars.db</small>
<button onClick={openWindowPrompt} className={styles.btnText} type="submit" name="add-database" value="Add Database">
Add Database using URL
</button>
<form className={styles.form} onSubmit={onSubmit}>
<input
type="text"
Expand Down
18 changes: 18 additions & 0 deletions client/src/styles/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,24 @@
cursor: pointer;
}

.main .btnText:hover {
background: none;
transform: translateY(1px);
}
.main .btnText {
padding: .5rem 0;
color: var(--color-primary);
margin-bottom: 1.5rem;
background: none;
border: none;
font-size: .75rem;
border-radius: 4px;
transition: transform 0.1s all ease-in-out;
text-align: center;
width: 100%;
cursor: pointer;
}

.main .btnGroup {
display: flex;
gap: 10px;
Expand Down
Empty file removed server/db/car_db.sqlite
Empty file.
47 changes: 17 additions & 30 deletions server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,39 @@ services:
dockerfile: ./Dockerfile
ports:
- "3001:3001"
env_file:
- .env.local
environment:
- TOGETHER_API_KEY=${TOGETHER_API_KEY}
- TOGETHER_MODEL=${TOGETHER_MODEL}
- TOGETHERAI_API_KEY=${TOGETHERAI_API_KEY}
- TOGETHERAI_MODEL_NAME=${TOGETHERAI_MODEL_NAME}
- LANGCHAIN_TRACING_V2=${LANGCHAIN_TRACING_V2}
- LANGCHAIN_CALLBACKS_BACKGROUND=${LANGCHAIN_CALLBACKS_BACKGROUND}
- LANGSMITH_ENDPOINT=${LANGSMITH_ENDPOINT}
- LANGSMITH_API_KEY=${LANGSMITH_API_KEY}
- LANGSMITH_PROJECT=${LANGSMITH_PROJECT}
- SQLITE_DB_PATH=${SQLITE_DB_PATH}
- DB_DIR=${DB_DIR}

depends_on:
sqlite:
condition: service_healthy
networks:
- sql-assistant-network

sqlite:
image: nouchka/sqlite3:latest
image: keinos/sqlite3:latest
container_name: sqlite-db
ports:
- "8080:8080"
- "5432:5432"
volumes:
- ./sqlite_data/init-cars-db.sh:/db/init-cars-db.sh
- ./sqlite_data/car_db.sql:/db/car_db.sql
- sqlite_data:/db
- ./sqlite_data:/db
entrypoint: >
sh -c "sqlite3 cars.db < /db/car_db.sql && tail -f /dev/null"
sh -c "sqlite3 /db/cars.db << /db/car_db.sql && tail -f /dev/null"
healthcheck:
test: ["CMD", "sqlite3", "/db/cars.db", ".tables"]
interval: 5s
timeout: 5s
retries: 5
networks:
- sql-assistant-network

sqlitebrowser:
image: lscr.io/linuxserver/sqlitebrowser:latest
container_name: sqlitebrowser
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- CUSTOM_HTTP_PORT=4000
- CUSTOM_HTTPS_PORT=4001
depends_on:
sqlite:
condition: service_healthy
security_opt:
- seccomp:unconfined #optional
volumes:
- sqlite_data:/db/cars.db
ports:
- 4000:4000
- 4001:4001
restart: unless-stopped
networks:
- sql-assistant-network
3 changes: 3 additions & 0 deletions server/env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ SQLITE_DB_PATH=./data/car_database.sqlite
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100

# Database Directory
DB_DIR=./db

Loading
Loading