How ceurrutia/login-register-auth works
Project type and purpose
• This is a full-stack web application providing user authentication (login/register) and museum management.
• The frontend is a React single-page application; the backend is a Node.js/Express REST API using Bcrypt for password hashing, JWT for stateless auth, and MongoDB (via Mongoose) for persistence.
File structure
• Top-level:
• client/ – the React front-end
• src/ – the Node/Express back-end
• client/ contains:
• src/components, src/pages – UI components and views (Home, Admin, Login, Register, Profile, CreateMuseum)
• src/api – axios instance and auth API wrappers
• src/context/AuthContext.jsx – client-side auth state and JWT management
• src/ contains (backend):
• index.js/app.js – Express app entrypoint, middleware registration
• routes/ – REST routes (auth.routes.js, museum.routes.js)
• controllers/ – request handlers implementing business logic
• models/ – Mongoose schemas (user.model.js, museum.model.js)
• middlewares/ – token validation & request payload validation
• libs/jwt.js – JWT creation/verification utilities
• db.js/config.js – database connection and environment config
• schemas/ – validation schemas for incoming payloads
README
• Confirms core technologies: Node.js, Express, Bcrypt, JWT.
• Project focus: login/register authentication flow plus protected museum-related CRUD functionality.
Detail and clarity
• Both happy-path (valid token, CRUD operations) and error-paths (invalid token, validation errors).