You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# DatabaseMONGODB_URI=mongodb://localhost:27017/sentinel# RedisREDIS_URL=redis://localhost:6379# AuthenticationJWT_SECRET=your-super-secret-jwt-key-min-32-charsJWT_EXPIRES_IN=7d# ApplicationNEXT_PUBLIC_APP_URL=http://localhost:3000NEXT_PUBLIC_SOCKET_URL=http://localhost:3001# Optional: Cloudinary for media uploadsCLOUDINARY_CLOUD_NAME=your-cloud-nameCLOUDINARY_API_KEY=your-api-keyCLOUDINARY_API_SECRET=your-api-secret
Running the Application
Development mode (runs Next.js on port 3000):
npm run dev
Socket.IO server (runs on port 3001):
npm run socket
Production build:
npm run build
npm start
Running with Docker (Optional)
# Start MongoDB and Redis
docker-compose up -d mongo redis
# Run the application
npm run dev
π‘ API Endpoints
Authentication
Method
Endpoint
Description
POST
/api/auth/register
Register new user
POST
/api/auth/login
Login user
POST
/api/auth/logout
Logout user
GET
/api/auth/me
Get current user
Users
Method
Endpoint
Description
GET
/api/users
List users
GET
/api/users/[username]
Get user profile
PUT
/api/users/[username]
Update profile
POST
/api/users/[username]/experience
Add experience
POST
/api/users/[username]/education
Add education
Network
Method
Endpoint
Description
POST
/api/network/connect
Send connection request
POST
/api/network/accept
Accept connection
GET
/api/network/connections
List connections
DELETE
/api/network/[connectionId]
Remove connection
Posts
Method
Endpoint
Description
GET
/api/posts
List posts
POST
/api/posts
Create post
GET
/api/posts/[id]
Get post
PUT
/api/posts/[id]
Update post
DELETE
/api/posts/[id]
Delete post
POST
/api/posts/[id]/like
Toggle like
POST
/api/posts/[id]/comment
Add comment
Media
Method
Endpoint
Description
GET
/api/media
List all media
POST
/api/media
Upload media
GET
/api/media/[id]
Get media item
DELETE
/api/media/[id]
Delete media
POST
/api/media/[id]/like
Toggle like
POST
/api/media/[id]/comment
Add comment
GET
/api/media/user/[username]
User's media gallery
Chat
Method
Endpoint
Description
GET
/api/chat/conversation
List conversations
POST
/api/chat/conversation
Create conversation
POST
/api/chat/group
Create group chat
GET
/api/chat/messages/[conversationId]
Get messages
POST
/api/chat/messages/[conversationId]
Send message
PUT
/api/chat/messages/[conversationId]/seen
Mark as seen
Feed
Method
Endpoint
Description
GET
/api/feed
Get unified chronological feed
π Socket.IO Events
Client β Server
Event
Payload
Description
message:send
{ conversationId, content }
Send message
message:seen
{ conversationId, messageId }
Mark seen
typing:start
{ conversationId }
Start typing
typing:stop
{ conversationId }
Stop typing
join:conversation
conversationId
Join room
leave:conversation
conversationId
Leave room
Server β Client
Event
Payload
Description
message:new
Message
New message received
message:seen
{ messageId, userId }
Message was seen
user:typing
{ conversationId, userId }
User is typing
user:online
userId
User came online
user:offline
userId
User went offline
π Authentication
The platform uses JWT tokens stored in HTTP-only cookies for security:
Tokens are automatically included in API requests
Protected routes redirect to login if unauthenticated
Role-based access control for admin features
π¨ Theming
The platform uses a custom Tailwind theme with:
Primary brand colors
Surface colors for cards and backgrounds
Semantic colors (success, warning, error)
Custom animations (fade-in, slide-up)
π± Responsive Design
The platform is fully responsive with:
Mobile-first approach
Adaptive layouts for tablet and desktop
Touch-friendly interactions
Native-like mobile experience
π§ͺ Testing
# Run unit tests
npm run test# Run e2e tests
npm run test:e2e