-
Notifications
You must be signed in to change notification settings - Fork 24
Implement Email/Password Authentication with Clean UI #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Changed project name in package.json to "splitwiser" and updated main entry point. - Updated dependencies to newer versions for better performance and security. - Added HomeScreen component for user profile display and logout functionality. - Created LoginScreen component for user authentication with email/password and Google sign-in options. - Modified tsconfig.json for improved TypeScript support and configuration.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/auth-service-workflow #9 +/- ##
==============================================================
Coverage 65.67% 65.67%
==============================================================
Files 12 12
Lines 574 574
==============================================================
Hits 377 377
Misses 197 197 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* feat: implement authentication module with JWT support and Firebase integration * 📝 Add docstrings to `feature/auth-service-workflow` Docstrings generation was requested by @Devasy23. * #3 (comment) The following files were modified: * `backend/app/auth/routes.py` * `backend/app/auth/security.py` * `backend/app/auth/service.py` * `backend/app/database.py` * `backend/app/dependencies.py` * `backend/generate_secret.py` * `backend/main.py` * feat: add Procfile and runtime.txt, configure CORS settings, and improve AuthService docstring * feat: add deployment configurations for Railway, including Dockerfile, .dockerignore, and environment setup * feat: remove Dockerfile and Procfile, update nixpacks.toml and railway.toml for backend directory structure, and add requirements.txt * fix: update pip installation command for consistency and add nixpacks configuration to disable venv creation * fix: update nixpacks and railway configurations to simplify installation and execution commands * feat: enhance Firebase authentication setup with environment variable support and improve CORS configuration for production * feat: enhance CORS middleware with detailed OPTIONS handler and debugging support * feat: add debugging section for CORS issues and update allowed_origins for production * feat(auth): login and signup screen with integrated backend Co-authored-by: Devasy Patel <[email protected]> * feat(google-signin): add google sign in UI component * feat: Add authentication tests for email signup and login This commit introduces a test suite for the email-based authentication endpoints (`/auth/signup/email` and `/auth/login/email`). Key changes include: 1. **Test Implementation (`backend/tests/auth/test_auth_routes.py`):** * Comprehensive tests covering successful registration and login. * Tests for error scenarios: existing email, incorrect password, non-existent user. * Parameterized tests for invalid input validation (missing fields, short passwords, invalid email formats) returning 422 errors. 2. **Mocking (`backend/tests/conftest.py`):** * MongoDB Mocking: Implemented an auto-use pytest fixture (`mock_db`) using `mongomock-motor` to simulate MongoDB interactions. This fixture patches `app.auth.service.get_database` to ensure `AuthService` uses the mock database during tests. * Firebase Mocking: Added a session-scoped fixture (`mock_firebase_admin`) to mock `firebase_admin.initialize_app`, `credentials.Certificate`, and `auth`. This prevents actual Firebase SDK initialization, which is not needed for these tests and might fail in CI environments. 3. **Test Configuration (`backend/pytest.ini`):** * Created `pytest.ini` to define test-specific environment variables (e.g., `SECRET_KEY`, `TESTING=True`). * Configured `asyncio_mode` and test discovery patterns. 4. **Dependencies (`backend/requirements.txt`):** * Added `pytest`, `pytest-asyncio`, `httpx`, `mongomock-motor`, and `pytest-env` to support the testing framework and environment configuration. All 13 tests for the authentication routes are passing. The test setup ensures that tests are isolated and do not depend on external services like a live MongoDB instance or Firebase. * feat: Add GitHub Actions workflow to run backend tests * fix(tests): update test command to run specific auth test file * fix(tests): update test command to run all backend tests * fix: remove duplicate entry for .vscode in .gitignore * fix: update Python setup action to version 5 in GitHub Actions workflow * Integrate Codecov for test coverage reporting This commit introduces Codecov integration into the GitHub Actions workflow. Key changes: - Added `pytest-cov` to project dependencies. - Modified the `run-tests.yml` workflow: - Adjusted `PYTHONPATH` for correct coverage path mapping. - Updated the `pytest` command to generate an XML coverage report (`coverage.xml`). - Added a new step to upload the `coverage.xml` report to Codecov using `codecov/codecov-action@v4`. This will enable tracking of test coverage over time and provide insights into code quality via Codecov. * feat: enhance CORS configuration with allow_all_origins option * feat(auth): firebase google authentication code update * Implement Email/Password Authentication with Clean UI (#9) * feat: Update frontend package and add authentication screens - Changed project name in package.json to "splitwiser" and updated main entry point. - Updated dependencies to newer versions for better performance and security. - Added HomeScreen component for user profile display and logout functionality. - Created LoginScreen component for user authentication with email/password and Google sign-in options. - Modified tsconfig.json for improved TypeScript support and configuration. * feat: update app configuration and remove deprecated Google authentication code * fix: updates the package.json * feat(auth): enhance login/signup error handling and add basic form validation * fix(auth): ensure user_id is converted to ObjectId in get_current_user and update access token creation * refactor: enhance login/signup flow with password validation and confirmation to incorporate review chnages * Revert "refactor: enhance login/signup flow with password validation and confirmation to incorporate review chnages" This reverts commit 7883d98. --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Vraj Patel <[email protected]> Co-authored-by: Devasy Patel <[email protected]> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: patel.devasy.23 <[email protected]>
Email/Password Authentication Implementation
🎯 Overview
This PR implements a complete email/password authentication system for the Splitwiser app, removing Firebase/Google authentication dependencies to focus on core functionality.
✨ Features Implemented
Authentication System
Frontend (React Native/Expo)
Code Quality
🗑️ Removed Dependencies
firebase)expo-auth-session)🔧 Technical Details
API Integration
https://splitwiser-production.up.railway.app/auth/login/email,/auth/signup/email,/auth/refreshSecurity Features
UI/UX Improvements
🧪 Testing
📝 Future Work
Created issue #8 for Google/Firebase authentication implementation as an enhancement feature.
🔗 Related Issues
Ready for Review ✅
All authentication flows are working correctly with the backend API.