DevTerm Network provides comprehensive statistics and analytics powered by MongoDB aggregation queries and ASCII chart visualization. Track your activity, analyze post performance, and view trends.
- User Statistics: Karma, posts, likes, followers, top tags
- Post Analytics: Likes, comments, views, engagement rate
- Daily Activity: ASCII charts showing activity over time
- Trending Tags: Most popular tags across the platform
- Platform Stats: Global metrics and insights
statsShows your overall statistics including:
- Username and karma
- Total posts created
- Likes and comments received
- Follower/following counts
- Top 5 tags you use
- Account creation date
Example Output:
📊 Your Statistics
Username: johndoe
Karma: 1,234 ⭐
Joined: 2026-01-15
Activity:
📝 Posts: 42
👍 Likes Received: 156
💬 Comments Received: 89
Network:
👥 Followers: 23
👤 Following: 15
Top Tags:
1. #javascript (12 posts)
2. #react (8 posts)
3. #nodejs (6 posts)
stats <post-id>Analyzes a specific post with detailed metrics:
- Like count
- Comment count
- View count
- Engagement rate (%)
- Top commenters
- Tags
Example:
stats post123Output:
📊 Post Statistics
Post ID: post123
Author: johndoe
Type: code
Created: 2/8/2026
Engagement:
👍 Likes: 42
💬 Comments: 18
👁️ Views: 250
📈 Engagement Rate: 24.00%
Top Commenters:
1. alice (5 comments)
2. bob (3 comments)
3. charlie (2 comments)
Tags: javascript, async, promises
stats --daily [--days=7]Generates an ASCII chart showing your daily activity (posts + comments).
Parameters:
--days: Number of days to analyze (default: 7, max: 30)
Example:
stats --daily
stats --daily --days=14Output:
📈 Daily Activity (Last 7 Days)
10.00 ┤ ╭╮
8.00 ┤ ╭╯╰╮
6.00 ┤ ╭╯ ╰╮
4.00 ┤ ╭╯ ╰╮
2.00 ┤╭─╯ ╰─╮
0.00 ┼╯ ╰
Total Activity: 45
Average Daily: 6.43
Period: 2026-02-01 to 2026-02-08
User Stats Query:
// Total likes received
Post.aggregate([
{ $match: { author: userId } },
{ $project: { likeCount: { $size: '$likes' } } },
{ $group: { _id: null, total: { $sum: '$likeCount' } } }
])
// Top tags
Post.aggregate([
{ $match: { author: userId } },
{ $unwind: '$tags' },
{ $group: { _id: '$tags', count: { $sum: 1 } } },
{ $sort: { count: -1 } },
{ $limit: 5 }
])Post Stats Query:
// Top commenters
Comment.aggregate([
{ $match: { post: postId } },
{ $group: { _id: '$author', count: { $sum: 1 } } },
{ $sort: { count: -1 } },
{ $limit: 3 },
{ $lookup: {
from: 'users',
localField: '_id',
foreignField: '_id',
as: 'user'
}}
])Daily Activity Query:
Post.aggregate([
{
$match: {
author: userId,
createdAt: { $gte: startDate }
}
},
{
$group: {
_id: {
$dateToString: { format: '%Y-%m-%d', date: '$createdAt' }
},
count: { $sum: 1 }
}
},
{ $sort: { _id: 1 } }
])Powered by asciichart library:
Configuration:
{
height: 10, // Chart height in lines
format: (x) => x.toFixed(0), // Number formatting
padding: ' ' // Left padding
}Features:
- Auto-scaling to fit data range
- Unicode box-drawing characters
- Customizable height and padding
- Smooth curves for trends
engagementRate = ((likes + comments) / views) * 100- Measures how engaging content is
- Higher rate = more interactive audience
- Typical good rate: 10-30%
GET /api/stats/user/:userId?
Authorization: Bearer <token>
GET /api/stats/post/:postId
Authorization: Bearer <token>
GET /api/stats/daily?days=7
Authorization: Bearer <token>
GET /api/stats/trending?limit=10
Authorization: Bearer <token>
GET /api/stats/platform
Authorization: Bearer <token>
Stats can be cached in Redis for faster access:
// Cache user stats for 5 minutes
redis.setex(`stats:user:${userId}`, 300, JSON.stringify(stats));
// Cache trending tags for 1 hour
redis.setex('stats:trending', 3600, JSON.stringify(tags));- Indexes on
author,createdAt,tags - Aggregation pipeline optimization
- Limit result sets appropriately
- Use projection to reduce data transfer
# Check daily to see growth
stats
stats --daily# See which posts perform best
stats post123
stats post456# View your activity patterns
stats --daily --days=30# Check multiple posts
stats postA
stats postB
# Compare engagement ratesKarma: Points earned from creating content and receiving engagement
Posts: Total number of posts you've created
Likes Received: Sum of all likes on your posts
Comments Received: Total comments on your posts
Engagement Rate: Percentage of viewers who interacted (liked/commented)
Top Tags: Your most frequently used tags
Daily Activity: Posts + comments created per day
- Check Stats Regularly: Monitor your growth weekly
- Analyze Top Posts: Learn what content resonates
- Track Engagement: Aim for >15% engagement rate
- Use Popular Tags: Check trending tags for visibility
- Maintain Consistency: Daily activity chart should show steady activity
- Real-time stats updates via WebSocket
- Comparative analytics (vs. other users)
- Predictive trends with ML
- Export stats as CSV/JSON
- Custom date ranges
- Hourly activity breakdown
- Follower growth charts
- Tag correlation analysis
- Content recommendations based on stats
Happy Analyzing! 📊
Type stats to see your overview, stats <post-id> for post analytics, or stats --daily for your activity chart!