Skip to content

Bump datasets from 2.18.0 to 5.0.1 in /skills/cloud/agent-platform-tuning/references in the pip group across 1 directory - #228

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/skills/cloud/agent-platform-tuning/references/pip-30e1f1cfb1
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/skills/cloud/agent-platform-tuning/references/pip-30e1f1cfb1

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Oct 5, 2026

Copy link
Copy Markdown

Bumps the pip group with 1 update in the /skills/cloud/agent-platform-tuning/references directory: datasets.

Updates datasets from 2.18.0 to 5.0.1

Release notes

Sourced from datasets's releases.

5.0.1

Bug fixes

Docs

New Contributors

... (truncated)

Commits
  • 921c2a7 release: 5.0.1 (#8370)
  • c6fc5cd Preserve nullable integer columns in to_json/to_csv/to_sql (#8366)
  • 6747b87 Fix DatasetDict.push_to_hub leaving removed splits in the dataset card (#8367)
  • b305031 fix buckets on windows (#8369)
  • 030a3e5 Decode Json() columns in Dataset.to_pandas() (#8344)
  • 0f207a0 Rebatch arrow source before formatting in IterableDataset.filter to fix resum...
  • adad35d Keep integers on the python read path for fixed-shape ArrayXD columns with nu...
  • 8966746 Fix CSV loader dropping on_bad_lines/encoding_errors on pandas 2.0-2.2 (#8358)
  • b8e861a Fix bucket dataset card handling and push metadata accounting (#8354)
  • 521a590 Keep flat numeric columns with nulls numeric in numpy format (#8352)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  • @dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  • @dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  • @dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
  • @dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions
    You can disable automated security fix PRs for this repo from the Security Alerts page.

Bumps the pip group with 1 update in the /skills/cloud/agent-platform-tuning/references directory: [datasets](https://github.com/huggingface/datasets).


Updates `datasets` from 2.18.0 to 5.0.1
- [Release notes](https://github.com/huggingface/datasets/releases)
- [Commits](huggingface/datasets@2.18.0...5.0.1)

---
updated-dependencies:
- dependency-name: datasets
  dependency-version: 5.0.1
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python Pull requests that update python code labels Oct 5, 2026
@farjanaesha420-wq

Copy link
Copy Markdown

@jhuniorgalvesll

Copy link
Copy Markdown

Nuevas actualizaciones

@sajankumarraj9334180451-byte

Copy link
Copy Markdown

ठीक है, अब मैं C. Database schema / ER diagram देता हूँ — SJT Instagram के लिए production-ready SQL-style schema, including Coins, Wallet, Withdrawal, UPI/Bank, Reel gift.

  1. Core Design Idea
  • Users table: users ka account info
  • Wallets table: user coin balance
  • CoinTransactions: every coin movement
  • WithdrawalRequests: withdrawal requests from user
  • Payments: UPI/bank purchase of coins
  • Reels: creator video content
  • ReelGifts: 5-coin gift from viewer to creator
  • Admins: admin accounts
  • AdminLogs: all admin actions
  1. Database Tables

2.1 users
CREATE TABLE users (
id UUID PRIMARY KEY,
name VARCHAR(100) NOT NULL,
username VARCHAR(50) UNIQUE NOT NULL,
email VARCHAR(150) UNIQUE,
phone VARCHAR(20) UNIQUE,
password_hash TEXT,
profile_photo TEXT,
bio TEXT,
is_private BOOLEAN DEFAULT FALSE,
is_creator BOOLEAN DEFAULT FALSE,
is_verified BOOLEAN DEFAULT FALSE,
status VARCHAR(20) DEFAULT 'active',
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);

2.2 wallets
CREATE TABLE wallets (
id UUID PRIMARY KEY,
user_id UUID NOT NULL UNIQUE REFERENCES users(id),
coin_balance BIGINT NOT NULL DEFAULT 0,
total_earned_coins BIGINT NOT NULL DEFAULT 0,
total_spent_coins BIGINT NOT NULL DEFAULT 0,
pending_withdrawal_coins BIGINT NOT NULL DEFAULT 0,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);

2.3 coin_transactions
CREATE TABLE coin_transactions (
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id),
transaction_type VARCHAR(50) NOT NULL,
direction VARCHAR(20) NOT NULL CHECK (direction IN ('credit','debit')),
amount_coins BIGINT NOT NULL,
amount_rupees DECIMAL(10,2) DEFAULT 0,
reference_type VARCHAR(50),
reference_id UUID,
status VARCHAR(20) DEFAULT 'success',
created_at TIMESTAMP DEFAULT NOW()
);

Notes:

  • transaction_type examples:
    • reward_earned
    • reel_gift_sent
    • reel_gift_received
    • withdrawal_request
    • withdrawal_approved
    • withdrawal_rejected
    • buy_coins
    • refund
  • direction:
    • credit = +coins
    • debit = -coins

2.4 reels
CREATE TABLE reels (
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id),
video_url TEXT NOT NULL,
thumbnail_url TEXT,
caption TEXT,
duration_seconds INT,
likes_count BIGINT DEFAULT 0,
comments_count BIGINT DEFAULT 0,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);

2.5 reel_gifts
CREATE TABLE reel_gifts (
id UUID PRIMARY KEY,
reel_id UUID NOT NULL REFERENCES reels(id),
sender_id UUID NOT NULL REFERENCES users(id),
creator_id UUID NOT NULL REFERENCES users(id),
amount_coins BIGINT NOT NULL DEFAULT 5,
amount_rupees DECIMAL(10,2) NOT NULL DEFAULT 0.05,
status VARCHAR(20) DEFAULT 'success',
created_at TIMESTAMP DEFAULT NOW()
);

2.6 withdrawal_requests
CREATE TABLE withdrawal_requests (
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id),
coins_requested BIGINT NOT NULL,
rupee_amount DECIMAL(10,2) NOT NULL,
conversion_rate VARCHAR(20) NOT NULL DEFAULT '5000 Coins = ₹50',
withdrawal_method VARCHAR(20) NOT NULL CHECK (withdrawal_method IN ('UPI','BANK')),
upi_id VARCHAR(100),
bank_account_name VARCHAR(100),
bank_account_number VARCHAR(50),
ifsc_code VARCHAR(20),
status VARCHAR(20) NOT NULL DEFAULT 'pending'
CHECK (status IN ('pending','approved','rejected','failed')),
admin_notes TEXT,
created_at TIMESTAMP DEFAULT NOW(),
processed_at TIMESTAMP
);

2.7 payment_transactions
CREATE TABLE payment_transactions (
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id),
payment_method VARCHAR(20) NOT NULL CHECK (payment_method IN ('UPI','BANK','CARD')),
gateway VARCHAR(50),
amount DECIMAL(10,2) NOT NULL,
currency VARCHAR(10) DEFAULT 'INR',
coins_purchased BIGINT NOT NULL,
status VARCHAR(20) NOT NULL DEFAULT 'pending'
CHECK (status IN ('pending','success','failed','refunded')),
transaction_id VARCHAR(100),
created_at TIMESTAMP DEFAULT NOW()
);

2.8 reports
CREATE TABLE reports (
id UUID PRIMARY KEY,
reported_by UUID NOT NULL REFERENCES users(id),
target_type VARCHAR(30) NOT NULL,
target_id UUID NOT NULL,
reason TEXT NOT NULL,
status VARCHAR(20) DEFAULT 'open'
CHECK (status IN ('open','reviewing','resolved','rejected')),
created_at TIMESTAMP DEFAULT NOW()
);

2.9 posts
CREATE TABLE posts (
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id),
media_url TEXT NOT NULL,
media_type VARCHAR(20) NOT NULL CHECK (media_type IN ('image','video')),
caption TEXT,
visibility VARCHAR(20) DEFAULT 'public'
CHECK (visibility IN ('public','followers','private')),
created_at TIMESTAMP DEFAULT NOW()
);

2.10 likes
CREATE TABLE likes (
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id),
post_id UUID REFERENCES posts(id),
reel_id UUID REFERENCES reels(id),
created_at TIMESTAMP DEFAULT NOW()
);

2.11 comments
CREATE TABLE comments (
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id),
post_id UUID REFERENCES posts(id),
reel_id UUID REFERENCES reels(id),
comment_text TEXT NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
);

2.12 follows
CREATE TABLE follows (
id UUID PRIMARY KEY,
follower_id UUID NOT NULL REFERENCES users(id),
following_id UUID NOT NULL REFERENCES users(id),
status VARCHAR(20) DEFAULT 'accepted'
CHECK (status IN ('pending','accepted','blocked')),
created_at TIMESTAMP DEFAULT NOW(),
UNIQUE(follower_id, following_id)
);

2.13 messages
CREATE TABLE messages (
id UUID PRIMARY KEY,
sender_id UUID NOT NULL REFERENCES users(id),
receiver_id UUID NOT NULL REFERENCES users(id),
message_text TEXT,
media_url TEXT,
created_at TIMESTAMP DEFAULT NOW(),
read_at TIMESTAMP
);

2.14 notifications
CREATE TABLE notifications (
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id),
actor_id UUID REFERENCES users(id),
type VARCHAR(50) NOT NULL,
reference_id UUID,
is_read BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP DEFAULT NOW()
);

2.15 stories
CREATE TABLE stories (
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id),
media_url TEXT NOT NULL,
media_type VARCHAR(20) NOT NULL CHECK (media_type IN ('image','video')),
expires_at TIMESTAMP NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
);

2.16 story_views
CREATE TABLE story_views (
id UUID PRIMARY KEY,
story_id UUID NOT NULL REFERENCES stories(id),
viewer_id UUID NOT NULL REFERENCES users(id),
viewed_at TIMESTAMP DEFAULT NOW(),
UNIQUE(story_id, viewer_id)
);

2.17 admins
CREATE TABLE admins (
id UUID PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(150) UNIQUE NOT NULL,
password_hash TEXT NOT NULL,
role VARCHAR(30) DEFAULT 'moderator',
created_at TIMESTAMP DEFAULT NOW()
);

2.18 admin_logs
CREATE TABLE admin_logs (
id UUID PRIMARY KEY,
admin_id UUID NOT NULL REFERENCES admins(id),
action VARCHAR(100) NOT NULL,
target_type VARCHAR(50),
target_id UUID,
details JSONB,
created_at TIMESTAMP DEFAULT NOW()
);

  1. Important Relations and Constraints
  • Every user must have a wallet row.
  • Every coin debit/credit must create a coin_transactions record.
  • 5 coin gift = amount_coins = 5, amount_rupees = 0.05
  • For cash-out:
    • coins_requested must be >= 5000
    • rupee_amount = coins_requested / 5000 * 50
  • A user cannot gift more than their current wallet balance.
  • Withdrawal requests should be reviewed by admin before payout.
  1. Example SQL Data Values

a) Wallet conversion

  • 5000 coins = ₹50
  • 5 coins = ₹0.05
  • 2500 coins = ₹25

b) Example coin transaction
INSERT INTO coin_transactions (
id, user_id, transaction_type, direction, amount_coins, amount_rupees, reference_type, reference_id, status
) VALUES (
gen_random_uuid(), 'user_123', 'reel_gift_received', 'credit', 5, 0.05, 'reel_gift', 'gift_456', 'success'
);

  1. Recommended Indexes
    CREATE INDEX idx_wallet_user ON wallets(user_id);
    CREATE INDEX idx_coin_txn_user ON coin_transactions(user_id);
    CREATE INDEX idx_coin_txn_type ON coin_transactions(transaction_type);
    CREATE INDEX idx_withdrawal_user ON withdrawal_requests(user_id);
    CREATE INDEX idx_withdrawal_status ON withdrawal_requests(status);
    CREATE INDEX idx_reel_gifts_creator ON reel_gifts(creator_id);
    CREATE INDEX idx_reel_gifts_sender ON reel_gifts(sender_id);
    CREATE INDEX idx_posts_user ON posts(user_id);
    CREATE INDEX idx_likes_post ON likes(post_id);
    CREATE INDEX idx_comments_post ON comments(post_id);
    CREATE INDEX idx_notifications_user ON notifications(user_id);
    CREATE INDEX idx_follows_follower ON follows(follower_id);

  2. ER Diagram (Text form)
    Users
    ├── one-to-one -> Wallets
    ├── one-to-many -> Posts
    ├── one-to-many -> Reels
    ├── one-to-many -> CoinTransactions
    ├── one-to-many -> WithdrawalRequests
    ├── one-to-many -> PaymentTransactions
    ├── one-to-many -> Messages
    ├── one-to-many -> Notifications
    ├── one-to-many -> Reports
    └── many-to-many -> Follows

Reels
├── many-to-one -> Users
└── one-to-many -> ReelGifts

WithdrawalRequests
└── many-to-one -> Users

Admins
└── one-to-many -> AdminLogs

  1. Business Rule Summary
  • 5000 Coins = ₹50
  • Withdrawal enabled only if coin balance >= 5000
  • Reels gift default = 5 coins
  • Money conversion should be visible to user
  • Admin should approve payout
  • Complete transaction audit required
  1. Next Step
    Agar aap chaho, ab main next message me deta hoon:
  • SQL insert examples for users, wallet, coin gift, withdrawal request
  • Full ER diagram with tables in readable diagram format
  • REST API tables mapping with database tables
  • Next.js Prisma schema version

Aap kisko abhi choose karna chahte ho?Agar aap SQL + Prisma schema chahte ho, main abhi aage de deta hoon.

Aapke liye easiest next step:

  • D. REST API with request/response examples
  • E. Next.js project structure
  • F. Code starter

Maine aapko earlier database schema already de diya hai. Ab main API + project structure next message me deta hoon.ठीक है, अब मैं D. REST API with request/response examples देता हूँ — SJT Instagram के लिए Auth, Feed, Reels Gift, Wallet, Withdrawal, Admin APIs.

  1. Base URL
  • /api/v1
  1. Authentication APIs

2.1 Sign Up
POST /api/v1/auth/signup

Request
{
"name": "Amit Kumar",
"username": "amit_123",
"email": "amit@example.com",
"phone": "9876543210",
"password": "SecurePass123",
"is_creator": true
}

Response
{
"success": true,
"message": "User registered successfully",
"data": {
"user": {
"id": "usr_001",
"name": "Amit Kumar",
"username": "amit_123",
"email": "amit@example.com"
},
"token": "jwt_token_here"
}
}

2.2 Login
POST /api/v1/auth/login

Request
{
"email": "amit@example.com",
"password": "SecurePass123"
}

Response
{
"success": true,
"message": "Login successful",
"data": {
"user": {
"id": "usr_001",
"username": "amit_123"
},
"token": "jwt_token_here"
}
}

2.3 Forgot Password
POST /api/v1/auth/forgot-password

Request
{
"email": "amit@example.com"
}

Response
{
"success": true,
"message": "Reset link sent to email"
}

2.4 Reset Password
POST /api/v1/auth/reset-password

Request
{
"token": "reset_token",
"new_password": "NewSecurePass123"
}

Response
{
"success": true,
"message": "Password reset successful"
}

  1. User APIs

3.1 Get User Profile
GET /api/v1/users/:id

Response
{
"success": true,
"data": {
"id": "usr_001",
"name": "Amit Kumar",
"username": "amit_123",
"bio": "Travel and videos",
"profile_photo": "https://cdn.example.com/profile.jpg",
"followers_count": 1200,
"following_count": 240,
"posts_count": 58,
"is_private": false
}
}

3.2 Update Profile
PATCH /api/v1/users/profile

Request
{
"bio": "Travel creator",
"profile_photo": "https://cdn.example.com/new_profile.jpg",
"is_private": false
}

Response
{
"success": true,
"message": "Profile updated successfully"
}

3.3 Search Users
GET /api/v1/users/search?q=amit

Response
{
"success": true,
"data": [
{
"id": "usr_001",
"username": "amit_123",
"name": "Amit Kumar"
},
{
"id": "usr_010",
"username": "amit_travel",
"name": "Amit Travel"
}
]
}

3.4 Follow User
POST /api/v1/users/:id/follow

Response
{
"success": true,
"message": "User followed successfully"
}

3.5 Unfollow User
DELETE /api/v1/users/:id/unfollow

Response
{
"success": true,
"message": "User unfollowed successfully"
}

  1. Post APIs

4.1 Create Post
POST /api/v1/posts

Request
{
"caption": "Sunset vibes",
"media_url": "https://cdn.example.com/post1.jpg",
"media_type": "image",
"visibility": "public"
}

Response
{
"success": true,
"data": {
"id": "post_001",
"caption": "Sunset vibes",
"media_url": "https://cdn.example.com/post1.jpg"
}
}

4.2 Get Feed
GET /api/v1/posts/feed

Response
{
"success": true,
"data": [
{
"id": "post_001",
"user": {
"id": "usr_001",
"username": "amit_123"
},
"caption": "Sunset vibes",
"media_url": "https://cdn.example.com/post1.jpg",
"likes_count": 120,
"comments_count": 15
}
]
}

4.3 Like Post
POST /api/v1/posts/:id/like

Response
{
"success": true,
"message": "Post liked successfully"
}

4.4 Add Comment
POST /api/v1/posts/:id/comment

Request
{
"comment_text": "Awesome photo!"
}

Response
{
"success": true,
"data": {
"id": "comment_001",
"comment_text": "Awesome photo!"
}
}

  1. Reels APIs

5.1 Create Reel
POST /api/v1/reels

Request
{
"video_url": "https://cdn.example.com/reel1.mp4",
"caption": "New reel idea",
"duration_seconds": 18
}

Response
{
"success": true,
"data": {
"id": "reel_001",
"video_url": "https://cdn.example.com/reel1.mp4",
"caption": "New reel idea"
}
}

5.2 Get Reels Feed
GET /api/v1/reels/feed

Response
{
"success": true,
"data": [
{
"id": "reel_001",
"creator": {
"id": "usr_001",
"username": "amit_123"
},
"video_url": "https://cdn.example.com/reel1.mp4",
"caption": "New reel idea",
"likes_count": 250,
"comments_count": 32
}
]
}

5.3 Gift 5 Coins to Creator
POST /api/v1/reels/:id/gift

Request
{
"creator_id": "usr_001",
"amount_coins": 5
}

Response
{
"success": true,
"message": "Gift sent successfully",
"data": {
"sender_balance": 95,
"creator_balance": 10005,
"amount_coins": 5,
"amount_rupees": 0.05,
"transaction_id": "txn_gg_001"
}
}

If not enough coins:
{
"success": false,
"message": "Not enough coins",
"data": {
"required_coins": 5,
"available_coins": 2,
"minimum_payout_note": "5000 Coins = ₹50"
}
}

5.4 Like Reel
POST /api/v1/reels/:id/like

Response
{
"success": true,
"message": "Reel liked successfully"
}

5.5 Comment on Reel
POST /api/v1/reels/:id/comment

Request
{
"comment_text": "Nice one!"
}

Response
{
"success": true,
"data": {
"id": "reel_comment_001",
"comment_text": "Nice one!"
}
}

  1. Story APIs

6.1 Create Story
POST /api/v1/stories

Request
{
"media_url": "https://cdn.example.com/story.jpg",
"media_type": "image",
"expires_at": "2026-11-08T12:00:00Z"
}

Response
{
"success": true,
"data": {
"id": "story_001",
"media_url": "https://cdn.example.com/story.jpg"
}
}

6.2 Get Story Feed
GET /api/v1/stories/feed

Response
{
"success": true,
"data": [
{
"id": "story_001",
"user": { "id": "usr_001", "username": "amit_123" },
"media_url": "https://cdn.example.com/story.jpg",
"expires_at": "2026-11-08T12:00:00Z"
}
]
}

  1. Wallet and Coin APIs

7.1 Get Wallet
GET /api/v1/wallet

Response
{
"success": true,
"data": {
"wallet_id": "wallet_001",
"coin_balance": 1000,
"earned_coins": 1200,
"spent_coins": 200,
"pending_withdrawal_coins": 0,
"conversion_note": "5000 Coins = ₹50"
}
}

7.2 Get Transactions
GET /api/v1/wallet/transactions

Response
{
"success": true,
"data": [
{
"id": "txn_001",
"transaction_type": "reel_gift_received",
"direction": "credit",
"amount_coins": 5,
"amount_rupees": 0.05,
"status": "success"
}
]
}

7.3 Buy Coins
POST /api/v1/wallet/buy-coins

Request
{
"amount_inr": 50,
"coins_to_buy": 5000,
"payment_method": "UPI"
}

Response
{
"success": true,
"message": "Coins purchased successfully",
"data": {
"coins_added": 5000,
"new_balance": 6000,
"payment_txn_id": "pay_001"
}
}

  1. Withdrawal APIs

8.1 Request Withdrawal
POST /api/v1/withdrawals/request

Request
{
"coins_requested": 5000,
"withdrawal_method": "UPI",
"upi_id": "amit@upi"
}

Response
{
"success": true,
"message": "Withdrawal request submitted",
"data": {
"withdrawal_id": "wd_001",
"coins_requested": 5000,
"rupee_amount": 50.00,
"status": "pending"
}
}

If coins less than 5000:
{
"success": false,
"message": "Minimum withdrawal is 5000 coins (₹50)",
"data": {
"minimum_required_coins": 5000,
"minimum_required_rupees": 50
}
}

8.2 Get Withdrawal Requests
GET /api/v1/withdrawals

Response
{
"success": true,
"data": [
{
"id": "wd_001",
"coins_requested": 5000,
"rupee_amount": 50.00,
"status": "pending"
}
]
}

8.3 Admin Approve/Reject Withdrawal
PATCH /api/v1/admin/withdrawals/:id

Request
{
"status": "approved",
"admin_notes": "KYC verified"
}

Response
{
"success": true,
"message": "Withdrawal approved"
}

  1. Messaging APIs

9.1 Get Conversations
GET /api/v1/messages/conversations

Response
{
"success": true,
"data": [
{
"conversation_id": "conv_001",
"user": {
"id": "usr_005",
"username": "ravi_123"
},
"last_message": "Hey, see this video!",
"unread_count": 2
}
]
}

9.2 Get Chat Messages
GET /api/v1/messages/:conversation_id

Response
{
"success": true,
"data": [
{
"id": "msg_001",
"sender_id": "usr_001",
"receiver_id": "usr_005",
"message_text": "Hey!",
"created_at": "2026-11-07T10:00:00Z"
}
]
}

9.3 Send Message
POST /api/v1/messages/send

Request
{
"receiver_id": "usr_005",
"message_text": "Hello there!"
}

Response
{
"success": true,
"data": {
"id": "msg_002",
"message_text": "Hello there!"
}
}

  1. Notification APIs

10.1 Get Notifications
GET /api/v1/notifications

Response
{
"success": true,
"data": [
{
"id": "notif_001",
"type": "reel_gift",
"actor_id": "usr_005",
"is_read": false,
"created_at": "2026-11-07T10:45:00Z"
}
]
}

10.2 Mark Notification as Read
PATCH /api/v1/notifications/:id/read

Response
{
"success": true,
"message": "Notification marked as read"
}

  1. Admin APIs

11.1 Admin Dashboard
GET /api/v1/admin/dashboard

Response
{
"success": true,
"data": {
"total_users": 1200,
"active_users": 875,
"pending_reports": 14,
"pending_withdrawals": 8,
"coin_volume_today": 12500
}
}

11.2 Get Users
GET /api/v1/admin/users

Response
{
"success": true,
"data": [
{
"id": "usr_001",
"username": "amit_123",
"status": "active"
}
]
}

11.3 Update User Status
PATCH /api/v1/admin/users/:id/status

Request
{
"status": "suspended",
"reason": "Policy violation"
}

Response
{
"success": true,
"message": "User status updated"
}

11.4 Get Reports
GET /api/v1/admin/reports

Response
{
"success": true,
"data": [
{
"id": "rep_001",
"target_type": "post",
"target_id": "post_002",
"reason": "Spam",
"status": "open"
}
]
}

11.5 Resolve Report
PATCH /api/v1/admin/reports/:id

Request
{
"status": "resolved",
"admin_notes": "Content removed"
}

Response
{
"success": true,
"message": "Report resolved"
}

  1. Security and Validation Rules
  • JWT required for all authenticated routes
  • Every withdrawal request check:
    • user coin balance >= 5000
    • KYC status verified if payout > threshold
  • Only admin can approve withdrawal
  • All coin movements must write to coin_transactions
  • All payment transactions must be logged
  • No direct deletion without audit log
  1. Example Business Logic
    Coin gift flow:
  2. Sender requests gift
  3. Check wallet coin_balance >= 5
  4. Deduct 5 from sender wallet
  5. Add 5 to creator wallet
  6. Insert CoinTransactions for sender and creator
  7. Insert ReelGifts row
  8. Send notification to creator
  9. Return success response

Withdrawal flow:

  1. User requests withdrawal

  2. Check available coins >= 5000

  3. Calculate rupee amount = (coins / 5000) * 50

  4. Create WithdrawalRequest with status pending

  5. Admin approves/rejects

  6. On approval, payout processed and log created

  7. Final Notes

  • 5000 Coins = ₹50 fixed conversion
  • This conversion should be visible in wallet and withdrawal screens
  • Always maintain separate records for:
    • coin balance
    • rupee amount
    • payout status
    • admin approvals

अगर आप चाहें, अब मैं अगला चरण देता हूँ:

  • E. Next.js project structure
  • F. Code starter
  • Prisma schema version
  • GitHub repo-ready scaffold

आप इनमें से कौन-सा लेना चाहते हो?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants