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

Offen
#683 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
72/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
express, javascript, mongodb, node.js, react, vite

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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 🎯

Vorherrschende Sprache
JavaScript
Sterne
39
Forks
105
Ø Merge
2 T. 10 Std.
Gemergte PRs (30 T.)
22

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus anoopcodehack/DevBoard

Alle Issues in anoopcodehack/DevBoard

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.