This document outlines the high-level architecture of the Nexus application.
Nexus is structured as a monorepo, containing separate client (frontend) and server (backend) applications.
/Nexus
/client # Frontend (Vite + React + TypeScript)
/server # Backend (Express + Node + Mongoose)
/shared # Optional: shared types / utils
README.md
- Framework: React + TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS, Shadcn/UI
- State Management: Zustand is used for global state. It is divided into:
authStore: Manages user authentication, session, and user data.appStore: Manages non-auth global UI state, such as the name of the currently open canvas.canvasStore: Manages the state of the canvas itself, including shapes and history.
- Routing: React Router DOM
- Canvas: Konva.js (via react-konva) - Planned
- Data Fetching: @tanstack/react-query - Planned
- Runtime: Node.js + Express.js
- Database: MongoDB (Mongoose ODM)
- Authentication: JWT (JSON Web Tokens)
- Real-time Communication: Socket.IO - Planned
- User Registration/Login: Frontend sends credentials to
/api/auth/registeror/api/auth/login. - Backend Processing: Express handles the request, Mongoose interacts with MongoDB,
bcryptjshashes passwords,jsonwebtokengenerates JWTs. - Token Return: Backend sends JWT to frontend.
- Frontend State: Zustand
authStoresaves the JWT and user data tolocalStorageand in-memory state. - Protected Routes:
ProtectedRoutecomponent checksisAuthenticatedstatus fromauthStoreto grant/deny access.
- Microservices for specific functionalities.
- Dedicated API Gateway.
- Advanced caching strategies.