See Chapter 5. Practice Project: Creating a REST API with AI

DatabaseUserModelAPIClientDatabaseUserModelAPIClientUser Creation Flow{email, password}User Login Flow{email, password}POST /api/userscreateUser(data)Validate email formatCheck if email existsEmail statusValidate passwordHash passwordInsert userUser createdReturn user (without password)201 CreatedPOST /api/auth/loginauthenticateUser(data)Get user by emailUser dataVerify passwordReturn authenticated user200 OK with token