Sign inSign up

ingemedio/nexo-api

By ingemedio

Updated 3 months ago

Backend API en Node.js y Express para Nexo, el gestor de mapas mentales.

Image
0

10K+

ingemedio/nexo-api repository overview

Backend API de Nexo — gestor de mapas mentales con autenticación y versionado.

Built with Node.js, Express, PostgreSQL, JWT y bcryptjs.

Uso con docker-compose (recomendado)

Usa esta imagen junto con ingemedio/nexo-frontend y PostgreSQL:

services:
  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      POSTGRES_DB: nexo
      POSTGRES_USER: nexo
      POSTGRES_PASSWORD: nexo
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U nexo -d nexo"]
      interval: 5s
      timeout: 3s
      retries: 10

  api:
    image: ingemedio/nexo-api:latest
    restart: unless-stopped
    ports:
      - "3001:3001"
    environment:
      PORT: 3001
      PGHOST: postgres
      PGPORT: 5432
      PGDATABASE: nexo
      PGUSER: nexo
      PGPASSWORD: nexo
      JWT_SECRET: cambia-esto-en-produccion
    depends_on:
      postgres:
        condition: service_healthy

  frontend:
    image: ingemedio/nexo-frontend:latest
    restart: unless-stopped
    ports:
      - "80:80"
    depends_on:
      - api

volumes:
  pgdata:

Variables de entorno

VariableDefectoDescripción
PORT3001Puerto del servidor
PGHOSTlocalhostHost PostgreSQL
PGPORT5432Puerto PostgreSQL
PGDATABASEnexoNombre BD
PGUSERnexoUsuario BD
PGPASSWORDnexoContraseña BD
JWT_SECRETSecreto para firmar tokens JWT

Endpoints

  • POST /api/auth/register — Registro de usuario
  • POST /api/auth/login — Inicio de sesión
  • GET /api/auth/me — Perfil del usuario autenticado
  • GET /api/mindmaps — Listar mapas del usuario
  • POST /api/mindmaps — Crear mapa
  • GET /api/mindmaps/:id — Obtener mapa
  • PUT /api/mindmaps/:id — Actualizar mapa
  • DELETE /api/mindmaps/:id — Eliminar mapa
  • GET /api/mindmaps/:id/versions — Listar versiones
  • POST /api/mindmaps/:id/versions — Guardar versión
  • DELETE /api/mindmaps/:id/versions/:vid — Eliminar versión

Tag summary

Content type

Image

Digest

sha256:a51aac3aa

Size

57.2 MB

Last updated

3 months ago

docker pull ingemedio/nexo-api