diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9fc57c4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +## [1.0.0] - YYYY-MM-DD +### Ajouté +- Recherche full texte. +- Archivage de liens (TXT et HTML). +- Gestion des tags. +- Navigation vers les liens entrants et sortants. +- Interface de recherche avec surlignage des résultats. + diff --git a/CloudronManifest.json b/CloudronManifest.json new file mode 100644 index 0000000..084e054 --- /dev/null +++ b/CloudronManifest.json @@ -0,0 +1,26 @@ +{ + "id": "be.zoemp.cinekids", + "title": "Cine Kids", + "author": "Morgan", + "description": "file://DESCRIPTION.md", + "changelog": "file://CHANGELOG.md", + "tagline": "Ciné-agrégateur multi-source pour enfants.", + "version": "1.0.0", + "healthCheckPath": "/search?q=test", + "httpPort": 3000, + "addons": { + "localstorage": {} + }, + "manifestVersion": 2, + "website": "https://zoemp.be/cine-kids", + "contactEmail": "morgan@zoemp.be", + "icon": "file://logo.png", + "tags": [ + "cinema", + "children", + "cloudron" + ], + "minBoxVersion": "7.5.0", + "optionalSso": false +} + diff --git a/DESCRIPTION.md b/DESCRIPTION.md new file mode 100644 index 0000000..1e6c7b9 --- /dev/null +++ b/DESCRIPTION.md @@ -0,0 +1,18 @@ +# Cine Kids + +Cine Kids est un agrégateur multi-source pour trouver rapidement les avis, classifications d’âge et résumés de films pour enfants. +Utile pour les parents qui veulent éviter la merde industrielle et savoir ce que leurs enfants vont regarder. + +## Fonctionnalités principales + +- Recherche simultanée sur plusieurs bases (Cinecheck, CommonSense, Filmages, etc). +- Synthèse et fusion des résultats (titre, année, résumé, âge recommandé, pictogrammes…). +- Interface simple : tu cherches, tu obtiens toutes les infos utiles d’un coup. +- Donne accès direct aux fiches originales pour vérif rapide. + +Idéal pour : +- Filtrer les films grand public. +- Repérer d’un coup d’œil les critères d’âge, la violence, la pub ou les contenus toxiques. +- Éviter de perdre 20 minutes sur 5 sites différents pour chaque film. + + diff --git a/Dockerfile.cloudron b/Dockerfile.cloudron new file mode 100644 index 0000000..86ccb6f --- /dev/null +++ b/Dockerfile.cloudron @@ -0,0 +1,23 @@ +FROM debian:stable-slim + +RUN apt-get update && apt-get install -y curl ca-certificates bash xz-utils && apt-get clean && rm -rf /var/lib/apt/lists/* + +ARG NODE_VERSION=20.12.2 +RUN curl -fsSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz \ + | tar -xJ -C /usr/local --strip-components=1 + +RUN mkdir -p /app/code /app/data + +COPY ./ /app/code/ +COPY ./public/ /app/code/public/ +WORKDIR /app/code/ + +RUN npm ci --omit=dev + +VOLUME ["/app/data"] + +COPY start.sh /app/code/ +RUN chmod +x /app/code/start.sh + +CMD ["/app/code/start.sh"] + diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8acdd82 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.1 diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..1a53ca5 --- /dev/null +++ b/build.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -x +set -eu + +docker build --platform linux/amd64 -t dr.zoemp.be/cine-kids:$(cat VERSION) -f Dockerfile.cloudron . +docker push dr.zoemp.be/cine-kids:$(cat VERSION) +cloudron update --image dr.zoemp.be/cine-kids:$(cat VERSION) --app cine-kids + diff --git a/bump_version.sh b/bump_version.sh new file mode 100755 index 0000000..a5b5e42 --- /dev/null +++ b/bump_version.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Read current version +VERSION=$(cat VERSION) + +# Split version into components +IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" + +# Decide which part to bump based on the commit type +case $1 in + major) + ((MAJOR++)) + MINOR=0 + PATCH=0 + ;; + minor) + ((MINOR++)) + PATCH=0 + ;; + patch) + ((PATCH++)) + ;; + *) + echo "Usage: $0 {major|minor|patch}" + exit 1 + ;; +esac + +# Construct the new version +NEW_VERSION="$MAJOR.$MINOR.$PATCH" + +# Save the new version to the VERSION file +echo "$NEW_VERSION" > VERSION +echo "Version bumped to $NEW_VERSION" + +git add VERSION +git tag "v$MAJOR.$MINOR.$PATCH" +git push origin "v$MAJOR.$MINOR.$PATCH" diff --git a/dev.sh b/dev.sh new file mode 100755 index 0000000..8521b48 --- /dev/null +++ b/dev.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -x +set -eu + +docker build --platform linux/amd64 -t dr.zoemp.be/cine-kids:$(cat VERSION) -f Dockerfile.cloudron . +docker run --platform linux/amd64 --rm -it -v "$(pwd)/data:/app/data/" -p 3000:3000 dr.zoemp.be/cine-kids:$(cat VERSION) + +# Optionnel : test d'API locale après boot +# sleep 2 +# curl http://localhost:3000/search?q=test || echo "API failed (normal si pas de data mock)" + diff --git a/docker-compose.cloudron.yml b/docker-compose.cloudron.yml new file mode 100644 index 0000000..ab77b70 --- /dev/null +++ b/docker-compose.cloudron.yml @@ -0,0 +1,20 @@ +services: + cine-kids: + build: + context: . + dockerfile: Dockerfile.cloudron + ports: + - "3000:3000" + volumes: + - ./app:/app/code + - ./data:/app/data + environment: + - CLOUDRON_APP_ORIGIN=https://your-cloudron-origin.com + - CLOUDRON_APP_DOMAIN=yourdomain.cloudron + user: "${MY_UID}:${MY_GID}" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3000/search?q=test"] + interval: 2s + timeout: 2s + retries: 3 + diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..30f4686 Binary files /dev/null and b/logo.png differ diff --git a/patch.sh b/patch.sh new file mode 100755 index 0000000..b5aff6f --- /dev/null +++ b/patch.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -x +set -eu +./bump_version.sh patch +./build.sh diff --git a/frontend.html b/public/index.html similarity index 98% rename from frontend.html rename to public/index.html index c884b74..fd12dd1 100644 --- a/frontend.html +++ b/public/index.html @@ -32,6 +32,7 @@
Recherche en cours...
'; - + try { const response = await fetch(`http://localhost:3000/search?q=${encodeURIComponent(query)}`); if (!response.ok) { diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 0000000..30f4686 Binary files /dev/null and b/public/logo.png differ diff --git a/server.js b/server.js index ccf75ae..279638e 100644 --- a/server.js +++ b/server.js @@ -1,4 +1,5 @@ const express = require('express'); +const path = require('path'); const cors = require('cors'); const cinecheck = require('./aggregators/cinecheck-adapter'); const commonsense = require('./aggregators/commonsense-adapter'); @@ -9,7 +10,7 @@ const { mergeResults } = require('./merge'); const app = express(); app.use(cors()); - +app.use(express.static(path.join(__dirname, 'public'))); app.get('/search', async (req, res) => { const q = req.query.q; if (!q) { diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..9364104 --- /dev/null +++ b/setup.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail + +export MY_UID=$(id -u) +export MY_GID=$(id -g) +docker compose down +docker compose up --build --detach --timestamps +docker compose logs --follow | grep -E 'python|error|app' diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..b0901dc --- /dev/null +++ b/start.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -eu +echo "Starting Cine-Kids (Node.js)" +cd /app/code + +export NODE_ENV=production +export PORT=3000 + +exec node server.js +