-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/razorpay integration #17
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
Changes from 13 commits
0895df2
aefe23e
afe326d
4b1120b
cc95485
585fd01
2d6be1d
3a0a2d7
c4f90c8
962eb23
7b29a10
517a1f8
d9bbd3c
eee24c6
720bd6a
b781540
8d79585
578dd10
9276a54
4725f1a
a0d5b8f
f0e8f59
165382b
6dbb29f
e61b9a5
1a4fffc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,15 @@ | ||
| # Node Environment | ||
| NODE_ENV=development | ||
|
|
||
| # Server Configuration | ||
| PORT=3000 | ||
| HOST=localhost | ||
|
|
||
| # Database (PostgreSQL) | ||
| DATABASE_URL=postgresql://devradar:devradar@localhost:5432/devradar?schema=public | ||
|
|
||
| # Redis | ||
| REDIS_URL=redis://localhost:6379 | ||
|
|
||
| # GitHub OAuth | ||
| GITHUB_CLIENT_ID=your_github_client_id | ||
| GITHUB_CLIENT_SECRET=your_github_client_secret | ||
| GITHUB_CALLBACK_URL=http://localhost:3000/auth/callback | ||
| # GitHub Webhooks (for Boss Battles - achievements from GitHub events) | ||
| # Generate with: openssl rand -hex 32 | ||
| GITHUB_WEBHOOK_SECRET=your_webhook_secret_for_github | ||
|
|
||
| # JWT | ||
| JWT_SECRET=your_super_secret_jwt_key_change_in_production | ||
| JWT_EXPIRES_IN=7d | ||
|
|
||
| # WebSocket | ||
| WS_PORT=3001 | ||
|
|
||
| # Logging | ||
| LOG_LEVEL=debug | ||
|
|
||
| # Slack Integration (Phase 3 - Optional) | ||
| # Create a Slack App at https://api.slack.com/apps | ||
| SLACK_CLIENT_ID= | ||
| SLACK_CLIENT_SECRET= | ||
| SLACK_SIGNING_SECRET= | ||
| # ============================================ | ||
| # DevRadar Environment Configuration | ||
| # ============================================ | ||
|
|
||
| # Environment variables are now organized per application: | ||
| # | ||
| # - Server variables: apps/server/.env.example | ||
| # - Web variables: apps/web/.env.example | ||
| # | ||
| # Copy the appropriate .env.example to .env in each app directory | ||
| # and fill in your values before running locally. | ||
| # | ||
| # For production deployment: | ||
| # - Vercel: Add NEXT_PUBLIC_RAZORPAY_KEY_ID in Vercel dashboard | ||
| # - Koyeb: Add all vars from apps/server/.env.example in Koyeb dashboard |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,4 +47,6 @@ coverage/ | |
| docker-compose.override.yml | ||
| apps/server/src/generated/ | ||
|
|
||
| rules/ | ||
| rules/ | ||
| docs/ | ||
| opencode.jsonc | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # ============================================ | ||
| # DevRadar VS Code Extension Environment Configuration | ||
| # ============================================ | ||
| # Copy this file to .env and fill in your values | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # DEPLOYMENT: Add these in VS Code Extension settings or .env file | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
| # Development Server URLs (for local development) | ||
| DEV_SERVER_URL=http://localhost:3000 | ||
| DEV_WS_URL=ws://localhost:3000/ws | ||
|
|
||
| # Production Server URLs (for Koyeb deployment) | ||
| # Replace with your Koyeb app URL after deployment | ||
| PROD_SERVER_URL=https://your-koyeb-app.koyeb.app | ||
| PROD_WS_URL=wss://your-koyeb-app.koyeb.app/ws | ||
|
|
||
| # Web Application URL (for links from extension to web app) | ||
| # Update this to your Vercel deployment URL in production | ||
| NEXT_PUBLIC_WEB_APP_URL=http://localhost:3000 | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # PRODUCTION VALUES (update these when deploying) | ||
| # ----------------------------------------------------------------------------- | ||
| # NEXT_PUBLIC_WEB_APP_URL=https://devradar.io | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
|
|
||
| import { ActivityTracker } from './services/activityTracker'; | ||
| import { AuthService } from './services/authService'; | ||
| import { FeatureGatingService } from './services/featureGatingService'; | ||
| import { FriendRequestService } from './services/friendRequestService'; | ||
| import { WebSocketClient } from './services/wsClient'; | ||
| import { ConfigManager } from './utils/configManager'; | ||
|
|
@@ -48,6 +49,8 @@ | |
| private readonly statsProvider: StatsProvider; | ||
| private readonly leaderboardProvider: LeaderboardProvider; | ||
| private statsRefreshInterval: NodeJS.Timeout | null = null; | ||
| // Phase 5: Feature Gating | ||
| private readonly featureGatingService: FeatureGatingService; | ||
|
|
||
| constructor(context: vscode.ExtensionContext) { | ||
| this.logger = new Logger('DevRadar'); | ||
|
|
@@ -77,6 +80,8 @@ | |
| // Phase 2: Gamification views | ||
| this.statsProvider = new StatsProvider(this.logger); | ||
| this.leaderboardProvider = new LeaderboardProvider(this.logger); | ||
| // Phase 5: Feature Gating | ||
| this.featureGatingService = new FeatureGatingService(this.authService, this.logger); | ||
| /* Track disposables */ | ||
| this.disposables.push( | ||
| this.authService, | ||
|
|
@@ -89,7 +94,8 @@ | |
| this.statusBar, | ||
| this.configManager, | ||
| this.statsProvider, | ||
| this.leaderboardProvider | ||
| this.leaderboardProvider, | ||
| this.featureGatingService | ||
| ); | ||
| } | ||
|
|
||
|
|
@@ -194,6 +200,14 @@ | |
| void vscode.commands.executeCommand('devradar.friendRequests.focus'); | ||
| }, | ||
| }, | ||
| { | ||
| id: 'devradar.enableGhostMode', | ||
| handler: () => this.handleEnableGhostMode(), | ||
| }, | ||
| { | ||
| id: 'devradar.openBilling', | ||
| handler: () => this.handleOpenBilling(), | ||
| }, | ||
| ]; | ||
|
|
||
| for (const command of commands) { | ||
|
|
@@ -761,6 +775,38 @@ | |
| } | ||
| } | ||
|
|
||
| private async handleEnableGhostMode(): Promise<void> { | ||
| // Check if user has access to ghost mode feature | ||
| const hasAccess = await this.featureGatingService.promptUpgrade('ghostMode'); | ||
| if (!hasAccess) { | ||
| return; | ||
| } | ||
|
|
||
| // Toggle ghost mode | ||
| const currentMode = this.configManager.get('privacyMode'); | ||
| await this.configManager.update('privacyMode', !currentMode); | ||
|
|
||
| const message = !currentMode | ||
| ? 'DevRadar: Ghost mode enabled - you are now invisible to others' | ||
| : 'DevRadar: Ghost mode disabled - your activity is now visible'; | ||
|
|
||
| void vscode.window.showInformationMessage(message); | ||
| this.activityTracker.sendStatusUpdate(); | ||
| } | ||
|
Comment on lines
+782
to
+799
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -n "privacyMode|ghostMode" --type=ts -C2 apps/extension/Repository: senutpal/devRadar Length of output: 5655 Use a separate config key for The
Either create a separate 🤖 Prompt for AI Agents |
||
|
|
||
| private async handleOpenBilling(): Promise<void> { | ||
| const webAppUrl = this.getWebAppUrl(); | ||
| const tier = this.featureGatingService.getCurrentTier(); | ||
| const billingUrl = `${webAppUrl}/dashboard/billing?current=${tier}`; | ||
|
|
||
| await vscode.env.openExternal(vscode.Uri.parse(billingUrl)); | ||
| this.logger.info('Opened billing page', { currentTier: tier }); | ||
| } | ||
|
|
||
| private getWebAppUrl(): string { | ||
| return process.env.NEXT_PUBLIC_WEB_APP_URL || 'http://localhost:3000'; | ||
| } | ||
|
|
||
| dispose(): void { | ||
| this.logger.info('Disposing DevRadar extension...'); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider renaming
NEXT_PUBLIC_WEB_APP_URLfor clarity.The
NEXT_PUBLIC_prefix is a Next.js convention for exposing environment variables to the browser. In a VS Code extension context, this naming is misleading. Consider using a more generic name likeWEB_APP_URLorDEVRADAR_WEB_URL.♻️ Suggested rename
📝 Committable suggestion
🤖 Prompt for AI Agents