Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Track user last active time in database 🟢

Open Beginner friendly
#587 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, mongodb, nodejs

Research direction

Start with server/models/User.js and server/middleware/auth.js, then locate the GET /api/auth/me route. Check how the authenticated user is found and returned, and run the relevant existing tests. Done when the user’s last-active time is stored and updated on authenticated requests, and is included in the /api/auth/me response.

Written by the indexing model from the issue text.

Description

good first issue

Track user last active time in database 🟢

File: server/models/User.js + server/middleware/auth.js

No record of when users were last active 💀
Can't show "active 2h ago" anywhere fr!!

Fix: add lastActive to User model:
lastActive: {
type: Date,
default: Date.now
}

// update on every authenticated request
// in middleware/auth.js after finding user:
await User.findByIdAndUpdate(
decoded.id,
{ lastActive: new Date() },
{ timestamps: false }
)

// expose in GET /api/auth/me route:
res.json({
...user.toObject(),
lastActive: user.lastActive
})

~8 lines across 2 files!
No frontend changes needed yet 🎯
Foundation for online presence feature!! 🔥

Dominant language
JavaScript
Stars
39
Forks
105
Avg merge
1d 12h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anoopcodehack/DevBoard

All issues in anoopcodehack/DevBoard

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.