Build a memory of everything you read using local embeddings and semantic search.
nomic-embed-text model (100% offline)docker-compose for PostgreSQL, pgvector, and Ollama| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js, React, TypeScript, Tailwind CSS | Dashboard UI for saving/searching links |
| Backend | NestJS, TypeScript, class-validator | RESTful API with modular architecture |
| Database | PostgreSQL, Prisma, pgvector | Vector storage and similarity search |
| Embeddings | Ollama, 768 dimensions | Local embedding generation |
| Infrastructure | Docker | Containerized dev/production environment |
# 1. Start Docker services
docker-compose up -d
# 2. Install dependencies (monorepo)
npm install
# 3. Set up database
npm run prisma:migrate:dev
# 4. Start backend (Terminal 1)
npm run start:backend
# 5. Start frontend (Terminal 2)
npm run start:frontend
# Open http://localhost:3001
«««< HEAD Key Points:
http://localhost:3000http://localhost:3001nomic-embed-text model (100% offline)docker-compose for PostgreSQL, pgvector, and OllamaDashboard UI with save link input (left) and semantic search interface (right), displaying search results with similarity scores.
┌─────────────────────────────────────────────────────────────────┐
│ Stashly Workflow │
├─────────────────────────────────────────────────────────────────┤
│ │
│ SAVE LINK FLOW: │
│ ┌─────────────┐ ┌──────────────────┐ ┌──────────────┐ │
│ │ User Pastes│───▶│ Extract Metadata │───▶│ Generate │ │
│ │ Link URL │ │ (title, desc) │ │ Embedding │ │
│ └─────────────┘ │ via Fetch + DOM │ │ (Ollama) │ │
│ │ Parser │ │ 768 dims │ │
│ └──────────────────┘ └───────┬──────┘ │
│ │ │
│ ┌────────▼────────┐ │
│ │ Store in DB: │ │
│ │ - URL, title, │ │
│ │ - embedding │ │
│ │ - userId │ │
│ └────────────────┘ │
│ │
│ SEARCH FLOW: │
│ ┌──────────────┐ ┌──────────────────┐ ┌──────────────┐ │
│ │ User Query │───▶│ Generate Query │───▶│ pgvector │ │
│ │ │ │ Embedding │ │ Cosine Sim │ │
│ └──────────────┘ │ (Ollama) │ │ (top 5) │ │
│ │ 768 dims │ │ Filter by │ │
│ └──────────────────┘ │ userId │ │
│ └───────┬──────┘ │
│ │ │
│ ┌────────▼────────┐ │
│ │ Return Results │ │
│ │ with Scores │ │
│ └────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 16.1+, React 19, TypeScript, Tailwind CSS | Dashboard UI for saving/searching links |
| Backend | NestJS 10+, TypeScript 5.1+, class-validator | RESTful API with modular architecture |
| Database | PostgreSQL 16, Prisma 5.12+, pgvector | Vector storage and similarity search |
| Embeddings | Ollama (nomic-embed-text), 768 dimensions | Local embedding generation |
| Infrastructure | Docker, Docker Compose | Containerized dev/production environment |
| Package Manager | npm | Dependency management |
=======
5b413f236d3245f214f366f42003ff7ef5373b77
Installation
<<<<<<< HEAD
git clone https://github.com/yourusername/Stashly.git
cd Stashly
=======
git clone https://github.com/yourusername/Stashly.git
cd Stashly
>>>>>>> 5b413f236d3245f214f366f42003ff7ef5373b77
docker-compose up -d
Wait ~30 seconds for services to stabilize. Verify with:
docker-compose ps
npm install
npm run prisma:migrate:dev
npm run start:backend
Backend runs on http://localhost:3000.
npm run start:frontend
Frontend runs on http://localhost:3001.
Note: If ports conflict, update apps/web/package.json:
"dev": "next dev -p 3001"
http://localhost:3000Stashly/
├── apps/
│ ├── backend/ # NestJS backend
│ │ ├── src/
│ │ │ ├── app.module.ts
│ │ │ ├── main.ts
│ │ │ ├── common/
│ │ │ │ ├── embedding/ # Ollama integration
│ │ │ │ └── prisma/ # Database client
│ │ │ ├── links/ # Link save/search logic
│ │ │ └── auth/ # Auth module (stub)
│ │ ├── prisma/
│ │ │ ├── schema.prisma # Database schema
│ │ │ └── migrations/ # DB migrations
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ └── nest-cli.json
│ └── web/ # Next.js frontend
│ ├── app/
│ │ ├── page.tsx # Dashboard UI
│ │ └── globals.css
│ └── package.json
├── docker/
│ └── initdb/
│ └── 001_enable_pgvector.sql
├── docker-compose.yml
├── package.json
└── README.md
«««< HEAD
Backend (.env):
DATABASE_URL=postgresql://user:password@localhost:5432/stashly
OLLAMA_EMBEDDINGS_URL=http://127.0.0.1:11434/api/embeddings
PORT=3000
NODE_ENV=development
Frontend (.env.local):
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000
npm run test # Unit tests
npm run test:e2e # End-to-end tests
npm run test:cov # Coverage report
=======
5b413f236d3245f214f366f42003ff7ef5373b77
Database Migrations
Create a new migration after updating prisma/schema.prisma:
npm run prisma:migrate:dev -- --name add_new_field
Deploy migrations in production:
npm run prisma:migrate:deploy
Enable debug logging in the backend by setting:
DEBUG=Stashly:*
Frontend uses React DevTools; inspect network requests in browser DevTools.
docker build -t stashly:latest .
docker run -d -p 3000:3000 \
-e DATABASE_URL="postgresql://..." \
-e OLLAMA_EMBEDDINGS_URL="http://ollama:11434/api/embeddings" \
stashly:latest
We welcome contributions! Please follow these steps:
git checkout -b feature/your-feature-namegit commit -m "Add your feature"git push origin feature/your-feature-namePlease use GitHub Issues to report bugs or suggest features. Include:
This project is licensed under the MIT License. See LICENSE file for details. «««< HEAD
5b413f236d3245f214f366f42003ff7ef5373b77