🌟 wishare API

Welcome to the wishare API. The server is running successfully!

Available Endpoints:

Authentication:

POST /api/auth/register - Register a new user
POST /api/auth/login - Login user

Items:

GET /api/items - Get all items
POST /api/items - Create new item
GET /api/items/:id - Get single item
PATCH /api/items/:id - Update item
DELETE /api/items/:id - Delete item

Chat:

POST /api/chat - Start new chat
GET /api/chat - Get all chats
GET /api/chat/:id - Get single chat
POST /api/chat/:id/messages - Send message

Users:

GET /api/users/me - Get own profile
PATCH /api/users/me - Update profile
GET /api/users/:id - Get user profile
POST /api/users/:id/rate - Rate user

Upload:

POST /api/upload - Upload image
DELETE /api/upload/:filename - Delete image

Follow:

POST /api/follow/users/:userId/follow - Follow user
DELETE /api/follow/users/:userId/follow - Unfollow user
GET /api/follow/users/:userId/followers - Get followers
GET /api/follow/users/:userId/following - Get following
GET /api/follow/users/:userId/follow-status - Check follow status
GET /api/follow/users/:userId/follow-counts - Get follow counts

Notifications:

GET /api/notifications - Get user notifications
GET /api/notifications/unread-count - Get unread count
PATCH /api/notifications/:id/read - Mark as read
PATCH /api/notifications/mark-all-read - Mark all as read
DELETE /api/notifications/:id - Delete notification
GET /api/notifications/settings - Get notification settings
PUT /api/notifications/settings - Update notification settings

📱 Push Notifications (Enhanced):

POST /api/push/test/item - Send test item notification
POST /api/push/test/chat - Send test chat notification
POST /api/push/send/item-available - Send item available notification
POST /api/push/send/chat-message - Send chat message notification
POST /api/push/send/rating-received - Send rating notification
GET /api/users/me/badge-count - Get badge count
POST /api/users/me/reset-badge - Reset badge count

🎉 Sharries (Currency System):

POST /api/sharries/calculate - Calculate Sharries for item
POST /api/sharries/award - Award Sharries to user
GET /api/sharries/balance/:userId - Get user's Sharries balance
GET /api/sharries/transactions/:userId - Get Sharries transaction history

📧 Email Testing (Admin Only):

GET /api/email-test/status - Get email service status
POST /api/email-test/connection - Test SendGrid connection
POST /api/email-test/send - Send test invitation email
POST /api/email-test/send-custom - Send custom test email

Health Check:

GET /health - Health check

Note: All endpoints except registration and login require authentication via JWT token in the Authorization header.