Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8e4ed93
chore: update dependecies, workflows
akiunite Oct 13, 2025
ca308cd
ci(cd): basic ci/cd setup
akiunite Oct 13, 2025
8871d98
docs: add db structure image
akiunite Oct 13, 2025
2bdbc06
feat: initial ingredients data parser
akiunite Oct 20, 2025
35f82ce
feat: pool management, test endpoint
akiunite Oct 21, 2025
54d919f
chore: update packages, scripts
akiunite Oct 21, 2025
7f0d9d5
chore: setup dir structure
akiunite Oct 21, 2025
0dcc0d4
feat: database init
akiunite Oct 21, 2025
d8b5f70
feat: basic embedding service (search + embed)
akiunite Oct 21, 2025
1c50ff8
feat: basic ocr service (mistral + gemini)
akiunite Oct 21, 2025
9d8d948
chore: update file names
akiunite Oct 31, 2025
a84afd3
chore: add multipart, cors, new routes
akiunite Oct 31, 2025
d515163
chore: update packages
akiunite Oct 31, 2025
9aef3dd
chore: update db schema
akiunite Oct 31, 2025
2cca8ca
feat: add toothpaste creation service
akiunite Oct 31, 2025
d1d5690
feat: add toothpaste get by id/all services
akiunite Oct 31, 2025
73f37f7
chore: add toothpaste routes
akiunite Oct 31, 2025
024b7b7
chore: add future deployment templates
akiunite Oct 31, 2025
689da1f
feat: add toothpaste controllers
akiunite Oct 31, 2025
136290b
chore: update packages
akiunite Nov 3, 2025
5524d71
chore: analysis system prompt
akiunite Nov 3, 2025
41df2aa
feat: fuzzy search ingredient, embeddings using gemini instead mistral
akiunite Nov 3, 2025
521b2d5
feat: add image uploader to allas
akiunite Nov 3, 2025
a688ea6
feat: updated analyzer service
akiunite Nov 5, 2025
9dad76c
chore: add .env template
akiunite Nov 5, 2025
113e470
chore: update gitignore
akiunite Nov 5, 2025
6e4e982
feat: add ingredient extractor service
akiunite Nov 5, 2025
ee217f7
feat: add toothpaste creator service
akiunite Nov 5, 2025
e9f6794
chore: update packages
akiunite Nov 13, 2025
7c3ffcc
chore: add docker template
akiunite Nov 13, 2025
cfaedfd
chore: minor updates
akiunite Nov 13, 2025
123a560
chore: image -> file
akiunite Nov 13, 2025
8e786e3
chore: minor fixes, adjustments, improvements
akiunite Nov 13, 2025
3f9aa0c
feat: replace gemini with mistral, embeddings with fuzzy
akiunite Nov 13, 2025
3250312
chore: legacy ingredients extractor from image
akiunite Nov 13, 2025
94451ca
feat: add links and cas generator
akiunite Nov 13, 2025
46db64b
feat: add ingredient scraper, ocr extractor
akiunite Nov 13, 2025
f965283
chore: add parsed files
akiunite Nov 13, 2025
9013b24
feat: ingreadient db loader
akiunite Nov 13, 2025
f24bfd5
chore: update .env template
akiunite Nov 13, 2025
a7ff6fd
chore: remove logs
akiunite Nov 13, 2025
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
21 changes: 21 additions & 0 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [
2,
"always",
[
"feat",
"fix",
"docs",
"style",
"refactor",
"perf",
"test",
"chore",
"ci",
"build",
],
],
},
};
53 changes: 53 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Node dependencies
node_modules
npm-debug.log
yarn-error.log

# Logs and runtime data
*.log
logs
pids
*.pid
*.seed
*.pid.lock

# Build artifacts (if any)
dist
build
coverage

# Environment and secrets
.env
.env.*
!.env.example

# Version control and CI/CD
.idea
.git
.gitignore
.gitattributes
.github
.gitlab-ci.yml

# Editor & OS files
.DS_Store
*.swp
*.swo
.vscode
.idea
*.bak
Thumbs.db

# Docker/OpenShift build files that shouldn’t go inside image
openshift/
docker-compose.yml
Dockerfile.dev
README.md
test
tests
__tests__
docs

# Cache
.npm
.cache
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
MISTRAL_API_KEY=
GEMINI_API_KEY=
DATABASE_URL=
ALLAS_ENDPOINT=https://a3s.fi
ALLAS_BUCKET=
ALLAS_ACCESS_KEY=
ALLAS_SECRET_KEY=
ALLAS_UPLOAD_ENDPOINT=
33 changes: 33 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "CodeQL Config"
paths-ignore:
- "node_modules/"
- "openshift/"
- "dbinit/"
- "dist/"
- "build/"
- "coverage/"
- "**/.husky/**"
- "**/.idea/**"
- "scripts"
- "*.min.js"
- "*.test.ts"
- "*.test.js"
- "*.spec.ts"
- "*.spec.js"
- "__tests__/"
- "test/"
- "tests/"
- "*.d.ts"
- "public/"
- "static/"
queries:
- name: security-extended
uses: security-extended
- name: security-and-quality
uses: security-and-quality
# Query filters
query-filters:
- exclude:
id: js/unused-local-variable
- exclude:
id: js/debugger-statement
19 changes: 19 additions & 0 deletions .github/prompts/pr_summary_prompt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
messages:
- role: user
content: |
Analyze this pull request and provide a clear, concise summary that anyone can understand.

Title: "{{title}}"
Description: "{{description}}"

Code Changes:
```
{{diff}}
```

Please summarize:
- What this PR does (the main purpose)
- Key changes made in the code
- Any important details worth noting

Keep it simple and focused. Use bullet points or short paragraphs as needed.
32 changes: 32 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "CodeQL Security Analysis"
on:
workflow_run:
workflows: ["YAML Lint"]
types:
- completed
pull_request:
branches: ["main"]
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['javascript', 'typescript']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
20 changes: 20 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: release-please

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: googleapis/release-please-action@v4
with:
release-type: node
token: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/yaml-scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "YAML Lint"
on:
pull_request:
branches: [main]
jobs:
yaml-lint:
name: Lint YAML files
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install yamllint
run: sudo apt-get update && sudo apt-get install -y yamllint
- name: Run yamllint
run: |-
yamllint -d '{"extends": "default", "rules": {"line-length": false}}' .
continue-on-error: true
31 changes: 30 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
.node_modules
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage


# production
/build

# misc
.DS_Store
.idea
*.pem

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

1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Stage 1: Install dependencies
FROM node:20-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production && \
npm cache clean --force

# Stage 2: Production runtime
FROM node:20-alpine AS runner
WORKDIR /app

ENV NODE_ENV=production

# Copy dependencies and application code
COPY --from=deps /app/node_modules ./node_modules
COPY . .

EXPOSE 3000
ENV HOST=0.0.0.0
ENV PORT=3000

# Stage 3: Start the application
CMD ["node", "server.js"]
Binary file added docs/assets/db_structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 0 additions & 22 deletions index.js

This file was deleted.

43 changes: 0 additions & 43 deletions mock_test.js

This file was deleted.

25 changes: 22 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,43 @@
"name": "PastePick-server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "server.js",
"scripts": {
"dev": "nodemon server.js",
"start": "node server.js",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "husky"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"biome format --write"
]
},
"keywords": [],
"author": "",
"license": "MIT",
"packageManager": "pnpm@10.13.1",
"type": "module",
"dependencies": {
"@aws-sdk/client-s3": "^3.917.0",
"@fastify/cors": "^11.1.0",
"@fastify/multipart": "^9.3.0",
"@google/genai": "^1.25.0",
"@mistralai/mistralai": "^1.10.0",
"@xenova/transformers": "^2.17.2",
"axios": "^1.13.2",
"dotenv": "^17.2.2",
"fastify": "^5.6.0",
"form-data": "^4.0.4",
"fuse.js": "^7.1.0",
"pg": "^8.16.3"
},
"devDependencies": {
"@biomejs/biome": "2.2.6",
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"husky": "^9.1.7",
"lint-staged": "^16.2.4",
"nodemon": "^3.1.10"
}
}
}
Loading
Loading