Generate a public read-only link to share your board🔗

Abierto
#683 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
express, javascript, mongodb, node.js, react, vite

Línea de trabajo

Start with server/models/User.js and the existing route setup to see how authentication and task queries are handled; then read App.jsx and the client page routing. Implement the public share route and read-only page described in the issue, and add the navbar controls. Done means sharing can be enabled and disabled, the public link shows only the listed task fields, and visitors cannot edit or drag tasks.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement good first issue

Generate a public read-only link to share your board🔗

Files: server/models/User.js + server/routes/share.js (new)
+ client/src/pages/SharedBoard.jsx (new) + App.jsx

Want to show your board to a mentor or recruiter without
making them sign up? Can't right now 💀

// User.js
shareToken: { type: String, default: null }

// routes/share.js
const crypto = require('crypto')

router.post('/enable', protect, async (req, res) => {
const token = crypto.randomBytes(16).toString('hex')
await User.findByIdAndUpdate(req.user._id, { shareToken: token })
res.json({ url: ${process.env.FRONTEND_URL}/share/${token} })
})

router.delete('/disable', protect, async (req, res) => {
await User.findByIdAndUpdate(req.user._id, { shareToken: null })
res.json({ message: 'Sharing disabled' })
})

// public, no auth middleware:
router.get('/:token', async (req, res) => {
const user = await User.findOne({ shareToken: req.params.token })
if (!user) return res.status(404).json({ message: 'Not found' })
const tasks = await Task.find({ assignee: user._id })
.select('title status priority tags createdAt')
res.json({ owner: user.name, tasks })
})

Note: .select() leaves out description, snippets and notes on
purpose, so nothing private leaks.

Client: new /share/:token route rendering the board with no
drag-drop and no edit buttons. Add "Enable / Disable sharing"
in the navbar.

~50 lines across 4 files 🎯

Lenguaje dominante
JavaScript
Estrellas
39
Forks
105
Merge medio
2 d 10 h
PR fusionados (30 d)
22

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de anoopcodehack/DevBoard

Todos los issues de anoopcodehack/DevBoard

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.