NPMChat v1.0
Built with Next.js & TypeScript
The frontend is a Next.js application built with TypeScript and Tailwind CSS.
src/app: Routes and Page layouts.src/components: UI components (organized by feature).src/lib: Utility functions and shared helpers.src/app/AuthContext.tsx: Manages user login/logout/session.src/app/MessageContext.tsx: Manages active chat state, socket events, and message history.Stores the user object and provides methods:
login(data)signup(data)logout()updateProfile(data)The "Engine" of the chat UI:
socket connection.users (sidebar list) and messages (active conversation).newMessage and getOnlineUsers.The socket is initialized in MessageContext as soon as the user is authenticated.
io(BACKEND_URL, { query: { userId } })send-messagenewMessage, getOnlineUsers, messageSeenThe project uses a Neo-Brutalist aesthetic:
border-2 border-black).shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]).