Project

General

Profile

Task #140

Updated by Varsha N 10 days ago

MODULE: Guest Frontend – Enterprise Self Registration & Login 
 Navigation: Public URL β†’ Login / Register 
 🎯 TASK OBJECTIVE 
 Develop a public guest login system where: 
 User can login using username & password 
 If no account β†’ register enterprise 
 After registration: 
 System auto-generates username 
 System auto-generates password 
 Email sent to registered email 
 User logs in β†’ redirected to Home page 

 FRONTEND IMPLEMENTATION 
 1. Login Page UI 
 Public page (no authentication required). 
 Fields: 
 Username 
 Password 
 Login Button 
 Below Login button: 
 Doesn’t have an account? Register here! 
 (Register here β†’ navigates to registration page) 

 2. Registration Page UI 
 Fields required: 
 Name (Enterprise Name) 
 Mobile 
 Email 
 Address 
 Register Button 

 3. After Registration (Frontend Flow) 
 On successful registration: 
 Show message: 
 Registration successful. 
 Login credentials have been sent to your email. 
 Redirect to Login page. 

 DATABASE CHANGES 
 We need changes in: 
 enterprise_master 
 users_login 

 >enterprise_master (Should update during Registration) 
 id (PK) 
 enterprise_name  
 mobile 
 email 
 address 
 created_date 

 >users_login(It should also create during registration) 
 id PK  
 password (hashed) 
 last_login (datetime) 
 is_superuser tinyint 
 username varchar(150)  
 first_name varchar(150)  
 last_name varchar(150)  
 email varchar(254)  
 is_staff tinyint(1)  
 is_active tinyint(1)  
 date_joined datetime(6)  
 enterprise_id (FK) 

 Backend Processing Steps: 
 Create new record in enterprise_master 
 Get enterprise_id (auto increment ID) 
 πŸ”Ή Generate Username 
 Format: 
 registration_name@enterprise_id 
 Example: 
 happy_pets@1 
 (Convert name to lowercase, remove spaces and replace underscore) 
 πŸ”Ή Generate Password 
 Format: 
 DDMMYYYYHHMMSS 
 Example: 
 17022025153045 
 (Use current date + time) 

 πŸ”Ή Insert into users table 
 enterprise_id 
 username 
 hashed password 
 is_active = TRUE 

 
 βœ… 2️⃣ Send Email 
 --------- 
 Email should contain: 
 Subject: 
 Welcome to VETSLAB 
 Body: 
 Your enterprise has been registered successfully. 
 Enterprise Name: "Enterprice_name" 
 Username: enterprice_name@1 
 Password: DDMMYYYYHHMMSS 
 Login Here: 
 https://yourdomain.com/login 
 Thank you. 

 Validate: 
 Username exists 
 Password correct 
 is_active = True 

 πŸ” VALIDATIONS REQUIRED 
 Registration: 

 βœ” Email must be unique 
 βœ” Mobile must be unique 
 βœ” Name required 
 βœ” Email format validation 
 βœ” Password must be hashed 

 πŸ”„ FLOW SUMMARY: SUMMARY 
 User opens website 
 Click Register 
 Fill form 
 System creates enterprise 
 System generates credentials 
 Email sent 
 User logs in 
 Redirect to Home

Back