Full Stack Node.js React Advanced (Coding)
Advanced Full-Stack Coding Challenge:
This focused coding challenge evaluates candidates on advanced full-stack development, emphasizing proficiency in React's complex functionalities and Node.js with Express's secure backend operations. Candidates will demonstrate expertise in sophisticated React patterns and state management techniques.
On the backend, the challenge involves creating robust server solutions using Node.js and Express. This includes advanced route management, JWT authentication practices, secure password hashing, and the strategic use of express-rate-limit for defense against excessive requests.
Overall, this challenge directly assesses a candidate's practical skills in handling complex full-stack projects, requiring adept technical prowess and forward-thinking problem-solving in real-world development scenarios.Start Today
Develop an authentication system for an Express.js application.
The requirements are as follows:
- Hash passwords before storing them in an in-memory user store.
- Upon successful login, provide the user with a JWT set in a cookie.
- Middleware: Protected by JWT verification.
- Middleware: Protected by both JWT and role-checking middleware. Only users with the role
admin should access this.
- Clear the JWT cookie for the logged-in user.
You are expected to use the following libraries to achieve the above requirements:
express: For setting up the server and routes.
jsonwebtoken: For generating and verifying JSON Web Tokens.
bcryptjs: For hashing user passwords.
cookie-parser: For parsing cookies from requests.
Please ensure your solution integrates these libraries and endpoints appropriately.