Skip to content
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

feat: user authentication flow #9

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
26 changes: 22 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# API Configuration (for future backend integration)
VITE_API_BASE_URL=
# API Configuration
VITE_API_BASE_URL=http://localhost:3000 # Required: Base URL for API requests

# WebSocket Configuration
VITE_WS_URL=wss://ws.derivws.com/websockets/v3 # Required: WebSocket server URL
VITE_WS_APP_ID=67410 # Required: WebSocket app ID
VITE_WS_BRAND=deriv # Optional: WebSocket brand (default: deriv)
VITE_WS_LANG=en # Optional: WebSocket language (default: en)

# WebSocket Settings
VITE_MAX_RECONNECT_ATTEMPTS=5 # Optional: Maximum reconnection attempts (default: 5)
VITE_RECONNECT_TIMEOUT=1000 # Optional: Reconnection timeout in ms (default: 1000)
VITE_CONNECTION_TIMEOUT=10000 # Optional: Connection timeout in ms (default: 10000)
VITE_HEARTBEAT_INTERVAL=30000 # Optional: Heartbeat interval in ms (default: 30000)

# Build Configuration
# Possible values: development | production | staging
VITE_BUILD_MODE=development
VITE_BUILD_MODE=development # Optional: development, production, staging

# Security Configuration
VITE_ENCRYPTION_KEY=your-secure-encryption-key # Required: Key for encrypting sensitive data

# Deriv OAuth Configuration
VITE_DERIV_OAUTH_URL=https://oauth.deriv.com/oauth2/authorize # Required: Deriv OAuth authorization URL
VITE_DERIV_SIGNUP_URL=https://deriv.com/signup # Required: Deriv signup page URL
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# these users will be requested for review when someone
# opens a pull request.
* @aliakbar @ashkan-deriv @review-deriv

# Automatically assign review-deriv to review all PRs
/.github/workflows/ @review-deriv
/src/ @review-deriv
/public/ @review-deriv
7 changes: 3 additions & 4 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Vercel Preview Deployment

permissions:
contents: read # For repository checkout
pull-requests: write # For preview URL comments

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
Expand All @@ -21,6 +17,9 @@ concurrency:
jobs:
Deploy-Preview:
runs-on: ubuntu-latest
permissions:
contents: read # For repository checkout
pull-requests: write # For preview URL comments
steps:
- name: Verify Pull Request Author Access
uses: 'deriv-com/shared-actions/.github/actions/verify_user_in_organization@v3'
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

A mini version of [Champion Trade](https://champion.trade/) platform designed specifically for Telegram users. This app provides a seamless trading experience within the Telegram ecosystem by integrating Champion Trade's powerful trading capabilities with Telegram's native features.

## Quick Links

- 🤖 **Telegram Bot**: [Champion Trade Bot](https://t.me/champion_trade_bot)
- 📱 **Mini App**: [Champion Trader](https://t.me/champion_trade_bot/championtrader)
- 📦 **Bot Repository**: [champion-telegram-bot](https://github.com/aliakbar-deriv/champion-telegram-bot)

Key benefits:
- **Native Telegram Experience**: Seamless authentication and payments using Telegram's built-in systems
- **Simplified Trading**: Streamlined interface optimized for Telegram's mini-app format
Expand Down Expand Up @@ -79,6 +85,25 @@ src/

## Development

### Environment Configuration

The following environment variables are required to run the application:

```bash
# API Configuration
VITE_API_BASE_URL= # Base URL for API requests
VITE_WS_URL= # WebSocket server URL

# Security Configuration
VITE_ENCRYPTION_KEY= # Key used for encrypting sensitive data

# Deriv OAuth Configuration
VITE_DERIV_OAUTH_URL= # Deriv OAuth authorization URL
VITE_DERIV_SIGNUP_URL= # Deriv signup page URL
```

Create a `.env` file in the root directory with these required variables. Additional optional configurations can be found in `.env.example`.

### Build Configuration

The application uses Vite with the following configuration:
Expand Down
119 changes: 70 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
"dependencies": {
"@twa-dev/sdk": "^8.0.1",
"@twa-dev/types": "^8.0.2",
"clsx": "^2.1.0",
"crypto-js": "^4.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.28.2",
"zustand": "^4.4.7"
"react-router-dom": "^6.28.2"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
Expand All @@ -40,6 +39,7 @@
"prettier": "^3.1.1",
"rimraf": "^6.0.1",
"sass": "^1.69.6",
"terser": "^5.37.0",
"vite": "^5.0.10",
"vitest": "^1.1.1"
}
Expand Down
Loading
Loading