User Management¶
User profiles, account settings, and administration.
User Model¶
Features¶
User Profiles¶
- View profile information
- Update name and email
- Change password
- Profile picture (extend as needed)
Account Settings¶
- Email preferences
- Password management
- Account deletion (extend as needed)
Admin Management (Top G+)¶
- View all users via Admin Panel
- Search and filter users
- Monitor user activity
- Track payment status
Quick Tasks¶
Update Profile¶
| TypeScript | |
|---|---|
Get Current User¶
| TypeScript | |
|---|---|
API Endpoints¶
GET /api/auth/current- Get current userPUT /api/auth/profile- Update profilePOST /api/auth/forgot-password- Request password resetPOST /api/auth/reset-password- Reset password
User Creation¶
Via Signup¶
Users self-register at /signup page.
Via Admin (Top G+)¶
| Bash | |
|---|---|
| |
Via API¶
| Bash | |
|---|---|
| |
Extending User Model¶
Add Fields¶
-
Update model in
app/models.py: -
Create migration:
-
Update schemas in
app/schemas/user.py -
Regenerate API client:
Bash
Security¶
Password Hashing¶
- Bcrypt algorithm
- Automatic salting
- Never store plain text
Email Verification¶
Field exists (verified: bool) but flow not implemented.
Extend as needed for email verification.
Superuser Protection¶
- Admin panel requires
is_superuser=True - Regular users cannot elevate privileges
- Separate authentication from main app
Related Documentation¶
- Authentication - Login system
- Admin Panel - User administration (Top G+)
- Articles - User's content
- Database Guide - Schema details
Files Reference¶
app/models.py- User modelapp/services/users_service.py- User logicapp/schemas/user.py- User schemasapp/commands/create_superuser.py- Superuser creationfrontend/src/pages/Profile/EditProfile.tsx- Profile pagefrontend/src/hooks/api/useCurrentUser.ts- Current user hook