@@ -27,6 +27,7 @@ router.get('/', async (req, res) => {
|
|||||||
router.post('/cluster', async (req, res) => {
|
router.post('/cluster', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const notes = await loadNotes();
|
const notes = await loadNotes();
|
||||||
|
console.log('notes returned from loadNotes', notes)
|
||||||
const clusters = await clusterNotes(notes);
|
const clusters = await clusterNotes(notes);
|
||||||
res.json(clusters);
|
res.json(clusters);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ import config from './config/index.js';
|
|||||||
const PORT = config.port || 3001;
|
const PORT = config.port || 3001;
|
||||||
|
|
||||||
app.listen(PORT, () => {
|
app.listen(PORT, () => {
|
||||||
console.log(`Envision backend running on port ${PORT}`);
|
console.log(`Backend running on port ${PORT}`);
|
||||||
});
|
});
|
||||||
@@ -34,11 +34,11 @@ ${notesJson}`;
|
|||||||
|
|
||||||
export const clusterNotes = async (notes) => {
|
export const clusterNotes = async (notes) => {
|
||||||
const response = await client.messages.create({
|
const response = await client.messages.create({
|
||||||
model: "claude-sonnet-4-20250514",
|
model: "claude-sonnet-4-20250514",
|
||||||
max_tokens: 4096,
|
max_tokens: 4096,
|
||||||
messages: [
|
messages: [
|
||||||
{ role: "user", content: buildPrompt(notes) },
|
{ role: "user", content: buildPrompt(notes) },
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
const raw = response.content[0].text;
|
const raw = response.content[0].text;
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ type ButtonProps = {
|
|||||||
|
|
||||||
const Button = ({ onClick, isLoading, label }: ButtonProps) => {
|
const Button = ({ onClick, isLoading, label }: ButtonProps) => {
|
||||||
return (
|
return (
|
||||||
<button className="primaryButton" onClick={onClick} disabled={isLoading}>
|
<button className="primaryButton" onClick={onClick} disabled={isLoading}>
|
||||||
{isLoading ? 'Working...' : label}
|
{isLoading ? 'Working...' : label}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
14
frontend/src/components/navbar.tsx
Normal file
14
frontend/src/components/navbar.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
const Navbar = () => {
|
||||||
|
return (
|
||||||
|
<div className="main-head-box">
|
||||||
|
<div className="main-head-subbox-left">
|
||||||
|
<h1 className="main-head">kohngrüti</h1>
|
||||||
|
</div>
|
||||||
|
<div className="main-head-subbox-right">
|
||||||
|
<span className="material-symbols-outlined">recenter</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Navbar;
|
||||||
@@ -49,7 +49,7 @@ const Stickies = () => {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="stickies-container">
|
<div className="stickies-container">
|
||||||
<Button onClick={handleCluster} isLoading={isPending} label="Group Notes By Theme" />
|
<Button onClick={handleCluster} isLoading={isPending} label="Group Stickies By Topic" />
|
||||||
</div>
|
</div>
|
||||||
<div className="stickies-grid">
|
<div className="stickies-grid">
|
||||||
{stickies?.map((sticky) => (
|
{stickies?.map((sticky) => (
|
||||||
|
|||||||
@@ -1,22 +1,18 @@
|
|||||||
import Stickies from '../components/stickies';
|
import Stickies from '../components/stickies';
|
||||||
|
import Navbar from '../components/navbar'
|
||||||
import '../styles/home.css'
|
import '../styles/home.css'
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="main-head-box">
|
<div>
|
||||||
<div className="main-head-subbox-left">
|
<Navbar />
|
||||||
<h1 className="main-head">kohngrüti</h1>
|
</div>
|
||||||
</div>
|
<div>
|
||||||
<div className="main-head-subbox-right">
|
<Stickies />
|
||||||
<span className="material-symbols-outlined">recenter</span>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
);
|
||||||
<div>
|
|
||||||
<Stickies />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Home;
|
export default Home;
|
||||||
@@ -2,7 +2,8 @@
|
|||||||
font-family: "Sulphur Point", sans-serif;
|
font-family: "Sulphur Point", sans-serif;
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
color: #6dd6f4;
|
color: #6dd6f4;
|
||||||
|
border: 1px solid rgb(92, 0, 91);
|
||||||
width: 16rem;
|
width: 16rem;
|
||||||
height: 2.5rem;
|
height: 3rem;
|
||||||
margin-top: 14px;
|
margin-top: 14px;
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
.stickies-container {
|
.stickies-container {
|
||||||
margin: 36px 0px 36px 0px;
|
margin: 36px 0px 36px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.clusters-container {
|
.clusters-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -17,7 +18,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cluster-group {
|
.cluster-group {
|
||||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
border: 1px solid #6dd6f4;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user