Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
a4724df
add environment configuration and improve recommendation engine tests
nicolas-alv3 Apr 17, 2025
076f429
refactor: update import paths and implement recommendation engine fac…
nicolas-alv3 May 2, 2025
1b6bef4
feat: add email verification process with token generation and valida…
nicolas-alv3 May 5, 2025
7d9f2d7
feat: add Docker support with build and push script, update app confi…
nicolas-alv3 Oct 4, 2025
70083f9
fix: correct mongodb service dependency in docker-compose.yml
nicolas-alv3 Oct 4, 2025
5274271
feat: update Docker setup for production build and environment variables
nicolas-alv3 Oct 4, 2025
8aea2ff
feat: update docker-compose for MongoDB and enable HTTPS in main.ts
nicolas-alv3 Oct 10, 2025
4f117b9
fix: update MongoDB image version to 4.4 and remove HTTPS options fro…
nicolas-alv3 Oct 14, 2025
b8e96d2
feat: update MongoDB environment variables and adjust global API prefix
nicolas-alv3 Oct 14, 2025
5ae2297
fix: use FRONTEND_URL environment variable for email verification link
nicolas-alv3 Oct 14, 2025
20b585e
fix: use FRONTEND_URL environment variable for email verification link
nicolas-alv3 Oct 14, 2025
4a346ea
fix: remove unnecessary await from sendMail calls in auth.service.ts
nicolas-alv3 Oct 16, 2025
11c2a61
feat: add endpoint to remove useless tasks from a project and impleme…
nicolas-alv3 Oct 16, 2025
b87170b
refactor: simplify validation methods in task entity by removing unne…
nicolas-alv3 Oct 16, 2025
6574a35
feat: add manualLocation property to project DTO and related files
nicolas-alv3 Oct 16, 2025
0650a4d
fix: improve point-in-polygon check and refine date range validation …
nicolas-alv3 Oct 16, 2025
fca5ea4
feat: add public endpoint to retrieve project details by ID
nicolas-alv3 Oct 17, 2025
838c871
feat: enhance point rule logic to include contribution requirement in…
nicolas-alv3 Oct 17, 2025
cb44281
feat: update point calculation to require contribution for scoring
nicolas-alv3 Oct 17, 2025
229af7b
feat: limit check-ins retrieved by project ID to 8 and set default fo…
nicolas-alv3 Oct 17, 2025
bfefb93
feat: sort check-ins by datetime in findByProjectId and retrieve user…
nicolas-alv3 Oct 18, 2025
6959a13
feat: improve user contribution check for task recommendations
nicolas-alv3 Oct 18, 2025
f47ffb2
feat: improve task recommendation logic for solvedBy user retrieval
nicolas-alv3 Oct 18, 2025
a1efa2f
feat: set default value for manualLocation to false in project schema
nicolas-alv3 Oct 21, 2025
b33a98b
feat: refactor badge rule matching to include contribution verification
nicolas-alv3 Oct 22, 2025
0a21d92
feat: change time fields to use Date type for better accuracy in time…
nicolas-alv3 Oct 22, 2025
1f5a70d
solve #7 and fix tests
nicolas-alv3 Oct 23, 2025
c7f8e6f
feat: add endpoint to retrieve public projects
nicolas-alv3 Oct 23, 2025
d0522fc
fix lint
nicolas-alv3 Oct 23, 2025
3f60064
refactor: remove unused userId parameter from leaderboard retrieval
nicolas-alv3 Oct 23, 2025
ed9770a
feat: update date range validation to use Date objects for improved a…
nicolas-alv3 Oct 24, 2025
1d881c7
feat: add support for ELASTIC gamification strategy in badge and lead…
nicolas-alv3 Nov 4, 2025
1337c24
fix: add null checks to prevent errors in gamification and task entities
nicolas-alv3 Nov 4, 2025
0e2d98e
feat: implement badges-first leaderboard engine and refactor leaderbo…
nicolas-alv3 Nov 6, 2025
3646192
fix: correct spelling of recommendationStrategy and update related re…
nicolas-alv3 Nov 7, 2025
b305675
test: add unit tests for UserController, AuthService, and UserService
nicolas-alv3 Dec 4, 2025
3e91e0e
feat: add CheckinBuilder and ProjectBuilder classes with fluent inter…
nicolas-alv3 Dec 6, 2025
7b3c540
test: add unit tests for GamificationService methods
nicolas-alv3 Dec 6, 2025
3e00836
test: add unit tests for TaskService and enhance time restriction tests
nicolas-alv3 Dec 6, 2025
e201363
test: add unit tests for ProjectService methods
nicolas-alv3 Dec 6, 2025
8bebc24
add test to improve coverage
nicolas-alv3 Dec 31, 2025
c585ad4
fix eslint
nicolas-alv3 Dec 31, 2025
d497dfb
add license
nicolas-alv3 Dec 31, 2025
37b2a1e
update docker compose
nicolas-alv3 Feb 21, 2026
1b5b5cc
fix(auth): replace bcrypt with bcryptjs
lucas-matw-unq Feb 23, 2026
39bc02a
feat: allow image checkin in backend
lucas-matw-unq Mar 8, 2026
0730fd2
test: fix backend tests broken by image checkin and req parameter cha…
lucas-matw-unq Mar 8, 2026
0ac4c4b
chore: ignore all .env files
lucas-matw-unq Mar 10, 2026
1359e8f
feat: move secrets to .env and refactor checkin service
lucas-matw-unq Mar 11, 2026
50686a1
fix(checkin): correctly map imageRef in CheckInDao to persist in MongoDB
lucas-matw-unq Mar 12, 2026
55609da
feat: support multiple images per check-in (up to 3)
lucas-matw-unq Mar 14, 2026
cac451d
fix: make init-garage.sh robust by dynamic layout versioning
lucas-matw-unq Mar 20, 2026
72e760d
refactor: replace magic number 3 with MAX_IMAGES_PER_CHECKIN constant
lucas-matw-unq Mar 20, 2026
0ad9094
feat(backend): add StorageController for file serving and update Stor…
lucas-matw-unq Mar 21, 2026
8ff22a2
Merge pull request #26 from lucas-matw-unq/feature/allow-image-checkin
lucas-matw-unq Mar 22, 2026
9847b2c
feat: setup multi-stage build for Northflank production deployment
lucas-matw-unq Mar 29, 2026
1446d22
fix: update Dockerfile CMD to point to dist/src/main.js
lucas-matw-unq Mar 29, 2026
2ce4b0a
Configure production deployment for Northflank
lucas-matw-unq Mar 29, 2026
a552f15
fix(auth): await sendMail and use NestJS Logger for email errors
lucas-matw-unq Apr 4, 2026
dd1dd21
chore: sync fork with upstream cientopolis/rayuela-NodeBackend
lucas-matw-unq Apr 4, 2026
9569396
test(auth): update specs for async sendMail and NestJS Logger
lucas-matw-unq Apr 4, 2026
e7023aa
Merge pull request #29 from lucas-matw-unq/fix/email-send-await-logging
lucas-matw-unq Apr 4, 2026
893ec83
Merge branch 'main' into feat/northflank-deployment
lucas-matw-unq Apr 4, 2026
dea6dc6
Merge branch 'main' into feat/northflank-deployment
lucas-matw-unq Apr 5, 2026
7b348ce
feat(http): add HTTP request logging middleware
lucas-matw-unq Apr 5, 2026
3b6ca16
bug fix: Leaderbord update after checkin with points
FranciscoPerezRamos Apr 6, 2026
3658905
fix: replace stale user reference in _users before leaderboard sort
lucas-matw-unq Apr 6, 2026
6c07d2d
chore: resolve merge conflict with main (same fix, drop duplicate com…
lucas-matw-unq Apr 6, 2026
a68aae8
chore: restore code comment removed during conflict resolution
lucas-matw-unq Apr 6, 2026
fdd2aac
chore: remove postman collection and add Spanish comments to Dockerfile
lucas-matw-unq Apr 6, 2026
436adb0
Merge pull request #33 from lucas-matw-unq/feat/northflank-deployment
FranciscoPerezRamos Apr 6, 2026
f2a19f4
feat: implement docsify documentation for backend documentation (#36)
lucas-matw-unq Apr 19, 2026
4e025cf
docs: consolidate CI/CD and detailed garage info into deployment (#37)
lucas-matw-unq Apr 19, 2026
753cfd8
feat: implement Analytics API
lucas-matw-unq Apr 19, 2026
1322818
fix(backend): support projectId filter in summary endpoint
lucas-matw-unq Apr 22, 2026
62b3c6e
feat(05-01): add startDate/endDate query params to analytics controller
lucas-matw-unq Apr 25, 2026
ce0402d
feat(05-01): add date-range filtering to analytics DAO
lucas-matw-unq Apr 25, 2026
aa94a62
feat(05-01): pass startDate/endDate through analytics service layer
lucas-matw-unq Apr 25, 2026
3b6e33f
fix(05-01): fix PipelineStage type for dateRangeMatch return value
lucas-matw-unq Apr 25, 2026
28e0abf
docs: add analytics data extraction guide with performance analysis
lucas-matw-unq Apr 25, 2026
3cdef06
docs: add screenshots of the analytics dashboard
lucas-matw-unq Apr 26, 2026
873ce1d
docs: fix screenshots to show the actual analytics dashboard
lucas-matw-unq Apr 26, 2026
d5d3135
Merge pull request #39 from lucas-matw-unq/feat/analytics-dashboard
FranciscoPerezRamos Apr 26, 2026
bd14b12
infra: implement AGENTS.md for shared agent instructions (#40)
lucas-matw-unq Apr 26, 2026
3aa3cbf
Add Google Auth login (#38)
FranciscoPerezRamos Apr 26, 2026
98e9f68
feature: Refresh token rotation. Automatic token refresh, the user do…
FranciscoPerezRamos May 1, 2026
42c7ddb
docs: integrate mobile architecture documentation into docsify
lucas-matw-unq May 9, 2026
a245996
feature(checkin): Idempotency-Key, image validation, /health (#42)
FranciscoPerezRamos May 9, 2026
29516b7
Merge pull request #43 from Rayuela-v2/feat/mobile-docs
FranciscoPerezRamos May 12, 2026
52223a7
docs: add offline sync architecture documentation (#47)
lucas-matw-unq May 13, 2026
86b7f33
docs: add offline sync link to sidebar (#48)
lucas-matw-unq May 13, 2026
085a2c4
Feature/checkins admin view (#45)
FranciscoPerezRamos May 29, 2026
a478ac2
feat: add query filters and badge filter for community stats (#53)
lucas-matw-unq Jun 7, 2026
8f25096
docs: update test environment documentation to Rayuela-v2 org and mai…
lucas-matw-unq Jun 7, 2026
fea47cd
docs: add mobile APK connection to deployment diagram and section
lucas-matw-unq Jun 7, 2026
e3d5e84
feat: add task type description support with external link
lucas-matw-unq Jun 10, 2026
98143ec
refactor(project): replace taskTypes any[] with string | TaskType union
lucas-matw-unq Jun 14, 2026
439425c
Merge pull request #54 from Rayuela-v2/feature/task-type-description
FranciscoPerezRamos Jun 15, 2026
6e36b3c
docs: add gamification & badges architecture page with interactive co…
lucas-matw-unq Jun 21, 2026
68e7bf8
docs: add badge graph drawing and simulation tool to project docs (#55)
lucas-matw-unq Jul 5, 2026
8f8c07e
Fix: La sesion del usuario se estaba expirando. Ahora para el usuario…
FranciscoPerezRamos Jul 29, 2026
a325bc0
New updateUserInfo endpoint. Add description to the user schema
FranciscoPerezRamos Jul 31, 2026
eb1fcbf
Add statsByUser endpoint to get all the stas in the profile
FranciscoPerezRamos Jul 31, 2026
a39789d
feat: replace bipartite matching with recursive DAG evaluation in gam…
lucas-matw-unq Aug 1, 2026
45bc027
fix(gamification): handle HTTP exceptions and auto-create template wh…
lucas-matw-unq Aug 1, 2026
6953699
Ahora se guarda un expiresAt y mas data sobre porque se puse en faded…
FranciscoPerezRamos Aug 10, 2026
152abfb
Merge pull request #58 from Rayuela-v2/feautre/faded-badge
FranciscoPerezRamos Aug 10, 2026
fef7763
refactor(auth): extract email templates and align sender header with …
lucas-matw-unq Aug 22, 2026
ea47016
docs: add badge fading documentation under adaptive gamification stra…
lucas-matw-unq Aug 25, 2026
fc0dca0
perf(task): optimize admin tasks retrieval and eliminate N+1 queries …
lucas-matw-unq Aug 28, 2026
c8a6f09
Add badge fading as option
FranciscoPerezRamos Sep 4, 2026
b90e5d8
Merge remote-tracking branch 'origin/main' into feature/badge-fading
FranciscoPerezRamos Sep 4, 2026
9ea4be8
Strengthen badge fading strategy tests
FranciscoPerezRamos Sep 4, 2026
3dd00e7
docs(gamification): integrate vanishing badges heuristics simulator i…
lucas-matw-unq Sep 5, 2026
43c3246
Validate project strategies and fix badges-first assignability
FranciscoPerezRamos Sep 6, 2026
da3f62a
Merge pull request #66 from Rayuela-v2/feature/badge-fading
FranciscoPerezRamos Sep 6, 2026
bb09d5b
Remove dead safeHashCompare helper from auth.service
FranciscoPerezRamos Sep 6, 2026
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
17 changes: 0 additions & 17 deletions .env.test

This file was deleted.

8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ lerna-debug.log*
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test
.env.production.local
.env.development
.env*

# temp directory
.temp
Expand All @@ -59,3 +55,5 @@ pids

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
CLAUDE.md
GEMINI.md
54 changes: 54 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# AGENTS.md

This file serves as the unified source of truth for all AI agents (Claude Code, Gemini CLI, etc.) working on the Rayuela project.

## Project Overview

Rayuela is a full-stack citizen science platform with adaptive gamification for crowdsourced data collection. It is a monorepo with two main packages:

- `rayuela-NodeBackend/` — NestJS + TypeScript REST API (MongoDB + Garage S3)
- `rayuela-frontend/` — Vue 3 + Vite SPA (Vuetify + Vuex)

**GitHub Project:** [Rayuela Workspace Board](https://github.com/orgs/Rayuela-v2/projects/1/views/1)

## Mandatory Development Rules
- **ORG REPOSITORIES:** ALWAYS work exclusively in the repositories under the `Rayuela-v2` organization. NEVER perform actions in `cientopolis` source repositories.
- **ISSUE TRACKING:** All issues are tracked in: [Rayuela-v2/rayuela-NodeBackend](https://github.com/Rayuela-v2/rayuela-NodeBackend)
- **NO AI SIGNATURES:** Do not include agent signatures or attribution lines in PR descriptions or commits.

## Development Commands

### Backend (`rayuela-NodeBackend/`)
- `npm run start:dev` — Development with watch mode
- `npm run build` — Compile TypeScript to dist/
- `npm run test` — Jest unit tests
- `npm run test:e2e` — End-to-end tests
- `npm run lint` — ESLint with auto-fix
- `npm run format` — Prettier formatting
- **Infrastructure:** `docker-compose up -d mongodb garage` (then `bash ../init-garage.sh` if first time)

### Frontend (`rayuela-frontend/`)
- `npm run dev` — Vite dev server (http://localhost:5173)
- `npm run build` — Production build
- `npm run test:unit` — Vitest unit tests
- `npm run test:e2e` — Playwright e2e tests
- `npm run lint` — ESLint with auto-fix

## Architecture

### Backend (NestJS)
- API Prefix: `/v1`
- Swagger Docs: `/docs`
- Pattern: `controller → service → DAO/schema (persistence/) → entities/ + dto/`
- **Gamification Engine:** Pluggable strategy-pattern engine in `src/module/gamification/entities/engine/`.

### Frontend (Vue 3)
- UI Library: Vuetify 3
- State: Vuex
- API Layer: `src/services/`
- i18n: `src/locales/` (ES primary, EN secondary)

## Environment Variables
- Backend uses `.env.development` or `.env.production`.
- Frontend uses `.env` with `VITE_` prefix.
- Key secrets: `DB_CONNECTION`, `JWT_SECRET`, `S3_ACCESS_KEY`, `S3_SECRET_KEY`.
41 changes: 32 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
# Usar una imagen base de Node.js consistente
FROM node:20-alpine
# ─── Stage 1: Build ───────────────────────────────────────────────────────────
# Usamos Node 20 sobre Alpine (imagen liviana) como entorno de compilación
FROM node:20-alpine AS build

# Establecer el directorio de trabajo
# Directorio de trabajo dentro del contenedor donde se copiará el código
WORKDIR /usr/src/app

# Copiar solo los archivos de manifiesto del paquete para aprovechar el caché de Docker
# Copiamos solo los manifiestos de dependencias primero para aprovechar
# la caché de capas de Docker: si package*.json no cambia, npm install no se repite
COPY package*.json ./

# Instalar dependencias (esto se ejecutará dentro del contenedor Alpine)
# Instalamos todas las dependencias (incluyendo devDependencies necesarias para compilar)
RUN npm install

# Copiar el resto del código (esto será sobrescrito por el volumen de docker-compose, pero es buena práctica tenerlo)
# Copiamos el resto del código fuente
COPY . .

# El comando para iniciar la app en modo de desarrollo (usando ts-node-dev o similar)
# docker-compose anulará este CMD, pero lo dejamos como referencia.
CMD ["npm", "run", "start:dev"]
# Compilamos TypeScript a JavaScript (genera la carpeta dist/)
RUN npm run build

# ─── Stage 2: Runtime ─────────────────────────────────────────────────────────
# Nueva imagen limpia de Node 20 Alpine; no incluye el código fuente ni devDependencies
FROM node:20-alpine

# Mismo directorio de trabajo que en la etapa de build
WORKDIR /usr/src/app

# Copiamos los manifiestos para instalar solo dependencias de producción
COPY package*.json ./

# Instalamos únicamente las dependencias de producción (sin devDependencies)
RUN npm install --only=production

# Copiamos el código compilado desde la etapa de build
COPY --from=build /usr/src/app/dist ./dist

# Exponemos el puerto en el que escucha la aplicación NestJS
EXPOSE 3000

# Comando de inicio: ejecuta el archivo principal compilado
CMD ["node", "dist/src/main"]
Comment on lines +40 to +41
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,25 @@ $ npm install

## Running the app

```bash
# development
$ npm run start
1. **Start Docker Services** (MongoDB & Garage):
```bash
$ docker-compose up -d
```

# watch mode
$ npm run start:dev
2. **Initialize Garage** (First time only):
```bash
$ bash ../init-garage.sh
```

# production mode
$ npm run start:prod
```
3. **Start Backend**:
```bash
# watch mode
$ npm run start:dev
```

## Google auth setup

Para habilitar el login y registro con Google, configurar `GOOGLE_CLIENT_ID` con el Client ID Web generado en Google Cloud en `.env` or `.env.development`.

## Test

Expand Down
29 changes: 23 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,51 @@ services:
build:
context: .
dockerfile: Dockerfile
# Agrega este comando para iniciar en modo desarrollo
command: npm run start:dev
ports:
- '3000:3000' # El puerto por defecto de NestJS es 3000
- '3000:3000'
- '9229:9229'
env_file:
- .env
environment:
- NODE_ENV=development
- DB_CONNECTION=mongodb://root:root@mongodb:27017
- S3_ENDPOINT=http://garage:3900
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- mongodb
- garage
networks:
- rayuela_net
mongodb:
image: mongo:4.4
container_name: mongodb
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
env_file:
- .env
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
networks:
- rayuela_net
garage:
image: dxflrs/garage:v2.2.0
container_name: garage
ports:
- "3900:3900" # S3 API
- "3901:3901" # RPC
- "3902:3902" # Web
- "3903:3903" # Admin API
volumes:
- ./garage.toml:/etc/garage.toml
- garage_data:/data
networks:
- rayuela_net

volumes:
mongodb_data:
garage_data:

networks:
rayuela_net:
Expand Down
Empty file added docs/.nojekyll
Empty file.
13 changes: 13 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Rayuela Backend Documentation

Welcome to the official documentation for the **Rayuela Backend**.

This repository contains the NestJS-based REST API and management backend for the Rayuela platform.

## Quick Links
- [Deployment](deployment)
- [Gamification Architecture](gamification-badges)
- [Adaptive Gamification: Badge Fading](adaptive-gamification/badge-fading)
- [Vanishing Badges Simulator](adaptive-gamification/simulator)
- [Mobile Architecture](mobile/)
- [GitHub Repository](https://github.com/Rayuela-v2/rayuela-NodeBackend)
19 changes: 19 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- [Home](README.md)
- [Deployment & Infrastructure](deployment.md)
- [Analytics Data Extraction](analytics-queries.md)
- [Gamification & Badges Architecture](gamification-badges.md)
- <a href="directed_graph_tool.html" target="_blank">Badge Graph Drawing Tool</a>

- **Adaptive Gamification Strategies**
- [Badge Fading](adaptive-gamification/badge-fading.md)
- [Vanishing Badges Simulator](adaptive-gamification/simulator.md)
- <a href="vanishing_badges_simulator.html" target="_blank">Simulator (Fullscreen ↗)</a>

- **Mobile Application**
- [Architecture Overview](mobile/README.md)
- [Offline Sync Architecture](mobile/offline-sync.md)
- [Project & Feature Structure](mobile/architecture.md)
- [Technical Details](mobile/technical-details.md)
- [Core Workflows](mobile/workflows.md)
- [UI Dissected](mobile/ui-dissection.md)
- [Reference & Stats](mobile/reference.md)
Loading