
Overview
An electronics e-commerce platform built by a team of two. The Next.js storefront and the React admin dashboard are built, and the PostgreSQL schema is designed in Prisma. I built the Express API and most of the admin dashboard, and we built the storefront together. The API is in progress: admin login, invite-based OTP login for staff, JWT access tokens with rotating refresh tokens, role-based access and rate limiting are done. Next come the product, cart and order APIs, and connecting the storefront and admin to them.
Key Features
Prisma/PostgreSQL schema for users, products, categories, carts, wishlists, addresses and orders
Password login for admins and invite-based OTP login for staff, both issuing JWTs
Refresh tokens stored as hashes and replaced on every use; logout revokes them
Role-based access middleware, plus stricter rate limits on the login and OTP routes
React admin dashboard for products, categories, orders, customers and team
Next.js storefront pages for catalogue, product, cart, wishlist and account (not yet connected to the API)
Technical Challenges
Making a stolen refresh token work only once, by storing tokens as hashes and replacing them on every refresh
Supporting two kinds of login: passwords for admins, and emailed one-time codes for invited staff
Designing the whole schema up front, so the storefront, admin and API share one data model