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

Đang mở
#683 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
express, javascript, mongodb, node.js, react, vite

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 🎯

Ngôn ngữ chính
JavaScript
Star
39
Fork
105
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
22

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anoopcodehack/DevBoard

Tất cả issue của anoopcodehack/DevBoard

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.