AOSSIE-Org / AOSSIE-Org/Perspective

Feat: Add User Authentication and Authorization System (Signup/Login)

Đang mở
#119 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
50
Fork
78
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Is your feature request related to a problem? Please describe.

Currently, the Perspective application lacks user authentication and authorization mechanisms. This means:
- Users cannot create accounts or maintain personalized sessions
- There's no way to track individual usage or enforce rate limiting per user
- Saved analyses, chat history, and preferences cannot be persisted across sessions
- The application cannot scale to a production-ready system with proper access control
- No protection exists for API endpoints against abuse or unauthorized access

## Describe the solution you'd like

Implement a comprehensive authentication and authorization system with the following features:

**Backend (FastAPI):**
- User registration endpoint with email verification
- Secure login/logout functionality using JWT tokens
- Password hashing with bcrypt or argon2
- Token refresh mechanism for extended sessions
- Protected API routes with authentication middleware
- Rate limiting per authenticated user
- User profile management (view/update profile)

**Frontend (Next.js):**
- Clean signup/login forms with validation
- Secure token storage (httpOnly cookies or secure localStorage)
- Authentication state management (Context API or Zustand)
- Protected routes that redirect unauthenticated users
- User profile dashboard
- Session persistence and auto-refresh
- Logout functionality with token cleanup

**Database:**
- User table with fields: id, email, username, hashed_password, created_at, is_verified
- Integration with MongoDB database for user-specific data

## Potential Impact

**Who will benefit:**
- **End users** - Personalized experience, saved history, secure access
- **Project maintainers** - Better abuse prevention, usage analytics, scalable infrastructure
- **Contributors** - Foundation for advanced features (sharing, collaboration, premium tiers)
- **Community** - Production-ready system that can be deployed publicly

**Expected impact:**
- **Security**: Prevents API abuse and unauthorized access
- **Scalability**: Enables per-user rate limiting and resource management
- **User Experience**: Persistent sessions, saved preferences, analysis history
- **Monetization potential**: Foundation for freemium/premium features
- **Data privacy**: User-specific data isolation and GDPR compliance readiness
- **Analytics**: Track user engagement, popular features, and system usage

@ParagGhatage i have been working on the code for this issue. once this is approved by you i shall raise the pr.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.