odyssey-organization-service 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +46 -0
- package/.env.docker +46 -0
- package/.env.example +25 -0
- package/.gitmodules +0 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/.husky/pre-push +11 -0
- package/.npm-cache/_update-notifier-last-checked +0 -0
- package/.prettierignore +9 -0
- package/.prettierrc +11 -0
- package/.vscode/README.md +95 -0
- package/.vscode/extensions.json +38 -0
- package/.vscode/keybindings.json +50 -0
- package/.vscode/launch.json +56 -0
- package/.vscode/settings.json +43 -0
- package/.vscode/snippets/project-snippets.code-snippets +150 -0
- package/.vscode/tasks.json +101 -0
- package/Dockerfile +47 -0
- package/PROJECT_FEATURE_DESCRIPTION.txt +34 -0
- package/README.md +272 -0
- package/TESTING_GUIDE.md +233 -0
- package/commitlint.config.js +37 -0
- package/docker-compose.yml +56 -0
- package/eslint.config.js +72 -0
- package/graphQL-redis-apollo-guide.md +384 -0
- package/init.sh +3 -0
- package/jest.config.js +27 -0
- package/jest.setup.ts +5 -0
- package/organization.txt +607 -0
- package/organizationinvite.txt +387 -0
- package/package.json +123 -0
- package/prisma/migrations/20260110094432_init/migration.sql +28 -0
- package/prisma/migrations/20260409182441_schema_update/migration.sql +938 -0
- package/prisma/migrations/20260411050354_added_ueid_in_space_and_changed_table_names/migration.sql +2 -0
- package/prisma/migrations/20260411065930_updated_schema/migration.sql +14 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +813 -0
- package/prisma.config.ts +9 -0
- package/projects.txt +277 -0
- package/rabbitmq.txt +206 -0
- package/space.txt +614 -0
- package/spaceinvite.txt +333 -0
- package/src/GlobalMessageHandler/AppError.ts +55 -0
- package/src/GlobalMessageHandler/README.md +878 -0
- package/src/GlobalMessageHandler/errorHandler.ts +106 -0
- package/src/GlobalMessageHandler/examples.ts +203 -0
- package/src/GlobalMessageHandler/index.ts +135 -0
- package/src/GlobalMessageHandler/types.ts +24 -0
- package/src/app.ts +76 -0
- package/src/config/RabbitMQ/connection.ts +100 -0
- package/src/config/RabbitMQ/index.ts +7 -0
- package/src/config/RabbitMQ/topology.ts +31 -0
- package/src/config/constants.config.ts +5 -0
- package/src/config/db.config.ts +10 -0
- package/src/config/index.ts +54 -0
- package/src/config/log.config.ts +51 -0
- package/src/config/permission.key.config.ts +12 -0
- package/src/config/redis.config.ts +172 -0
- package/src/config/role.config.ts +7 -0
- package/src/config/swagger.config.ts +63 -0
- package/src/emailService/index.ts +88 -0
- package/src/firebase/config.ts +15 -0
- package/src/firebase/roomCreate.ts +42 -0
- package/src/firebase/spaceTemplateCreate.ts +67 -0
- package/src/firebase/unrealProjectCreate.ts +27 -0
- package/src/firebase/unrealProjectVersionCreate.ts +126 -0
- package/src/graphql/apolloServer.ts +59 -0
- package/src/graphql/resolvers.ts +255 -0
- package/src/graphql/responseFormatter.ts +112 -0
- package/src/graphql/schema.ts +82 -0
- package/src/graphql/types.ts +14 -0
- package/src/helpers/hashingHelper.ts +10 -0
- package/src/helpers/jwtHelper.ts +20 -0
- package/src/helpers/tokenEncryptDecrypt.ts +23 -0
- package/src/messaging/consumerHelpers.ts +25 -0
- package/src/messaging/consumers/assetConsumer.ts +209 -0
- package/src/messaging/consumers/configuratorConsumer.ts +295 -0
- package/src/messaging/index.ts +19 -0
- package/src/messaging/publisher/classicPaymentPublisher.ts +84 -0
- package/src/messaging/realtime/space-item.envelope.ts +78 -0
- package/src/messaging/realtime/space-item.publisher.ts +52 -0
- package/src/middleware/verifyAccessToken.ts +30 -0
- package/src/middleware/verifyBody.ts +22 -0
- package/src/middleware/verifyJwt.ts +42 -0
- package/src/middleware/verifyParams.ts +10 -0
- package/src/middleware/verifyPermission.ts +65 -0
- package/src/modules/activity/activity.controller.ts +37 -0
- package/src/modules/activity/activity.index.ts +5 -0
- package/src/modules/activity/activity.router.ts +16 -0
- package/src/modules/activity/activity.service.ts +102 -0
- package/src/modules/activity/activity.validation.ts +12 -0
- package/src/modules/deployment/deployment.controller.ts +40 -0
- package/src/modules/deployment/deployment.index.ts +3 -0
- package/src/modules/deployment/deployment.router.ts +27 -0
- package/src/modules/deployment/deployment.service.ts +93 -0
- package/src/modules/deployment/deployment.validation.ts +38 -0
- package/src/modules/health/health.controller.ts +48 -0
- package/src/modules/health/health.routes.ts +40 -0
- package/src/modules/health/health.service.ts +114 -0
- package/src/modules/organizationUser/organizationUser.service.ts +199 -0
- package/src/modules/organizationUser/organizationUser.validation.ts +11 -0
- package/src/modules/organizations/organizations.controller.ts +291 -0
- package/src/modules/organizations/organizations.index.ts +5 -0
- package/src/modules/organizations/organizations.router.ts +100 -0
- package/src/modules/organizations/organizations.service.ts +398 -0
- package/src/modules/organizations/organizations.validation.ts +31 -0
- package/src/modules/organizationsInvites/organizationInvites.controller.ts +326 -0
- package/src/modules/organizationsInvites/organizationInvites.index.ts +5 -0
- package/src/modules/organizationsInvites/organizationInvites.router.ts +72 -0
- package/src/modules/organizationsInvites/organizationsInvites.service.ts +326 -0
- package/src/modules/organizationsInvites/organizationsInvites.validation.ts +44 -0
- package/src/modules/participant/participant.controller.ts +62 -0
- package/src/modules/participant/participant.index.ts +5 -0
- package/src/modules/participant/participant.router.ts +34 -0
- package/src/modules/participant/participant.servcie.ts +119 -0
- package/src/modules/participant/participant.validation.ts +33 -0
- package/src/modules/participantUsage/participantUsage.controller.ts +23 -0
- package/src/modules/participantUsage/participantUsage.index.ts +5 -0
- package/src/modules/participantUsage/participantUsage.router.ts +15 -0
- package/src/modules/participantUsage/participantUsage.service.ts +60 -0
- package/src/modules/participantUsage/participantUsage.validation.ts +26 -0
- package/src/modules/projects/projects.controller.ts +115 -0
- package/src/modules/projects/projects.index.ts +5 -0
- package/src/modules/projects/projects.router.ts +40 -0
- package/src/modules/projects/projects.service.ts +252 -0
- package/src/modules/projects/projects.validation.ts +35 -0
- package/src/modules/recentSpace/recentSpace.controller.ts +46 -0
- package/src/modules/recentSpace/recentSpace.index.ts +5 -0
- package/src/modules/recentSpace/recentSpace.router.ts +18 -0
- package/src/modules/recentSpace/recentSpace.service.ts +87 -0
- package/src/modules/recentSpace/recentSpace.validation.ts +13 -0
- package/src/modules/space/space.controller.ts +274 -0
- package/src/modules/space/space.index.ts +5 -0
- package/src/modules/space/space.router.ts +150 -0
- package/src/modules/space/space.service.ts +998 -0
- package/src/modules/space/space.type.ts +218 -0
- package/src/modules/space/space.utils.ts +633 -0
- package/src/modules/space/space.validation.ts +90 -0
- package/src/modules/spaceInvite/spaceInvite.controller.ts +276 -0
- package/src/modules/spaceInvite/spaceInvite.index.ts +5 -0
- package/src/modules/spaceInvite/spaceInvite.interface.ts +6 -0
- package/src/modules/spaceInvite/spaceInvite.router.ts +66 -0
- package/src/modules/spaceInvite/spaceInvite.service.ts +295 -0
- package/src/modules/spaceInvite/spaceInvite.validation.ts +43 -0
- package/src/modules/spaceItem/spaceItem.service.ts +49 -0
- package/src/modules/spaceTemplate/spaceTemplate.controller.ts +40 -0
- package/src/modules/spaceTemplate/spaceTemplate.index.ts +5 -0
- package/src/modules/spaceTemplate/spaceTemplate.router.ts +22 -0
- package/src/modules/spaceTemplate/spaceTemplate.service.ts +71 -0
- package/src/modules/spaceTemplate/spaceTemplate.validation.ts +5 -0
- package/src/modules/spaceUser/spaceUser.service.ts +139 -0
- package/src/modules/upload/upload.controller.ts +23 -0
- package/src/modules/upload/upload.index.ts +5 -0
- package/src/modules/upload/upload.router.ts +15 -0
- package/src/modules/upload/upload.service.ts +70 -0
- package/src/modules/upload/upload.validation.ts +10 -0
- package/src/modules/user/user.controller.ts +151 -0
- package/src/modules/user/user.routes.ts +13 -0
- package/src/modules/user/user.service.ts +233 -0
- package/src/routes/index.ts +11 -0
- package/src/routes/routes.ts +32 -0
- package/src/server.ts +131 -0
- package/src/shared/cache.service.ts +83 -0
- package/src/shared/catchAsync.ts +24 -0
- package/src/shared/mail.service.ts +85 -0
- package/src/shared/pick.ts +20 -0
- package/src/shared/rbac-role-validation.helper.ts +16 -0
- package/src/shared/rbac-roles.helper.ts +52 -0
- package/src/shared/sendResponse.ts +23 -0
- package/src/shared/uniqueId.ts +8 -0
- package/src/sidecar/configurator-sidecar.server.ts +183 -0
- package/src/swagger/examples.yml +0 -0
- package/src/swagger/organizations.api.doc.yml +361 -0
- package/src/swagger/organizationsInvite.api.doc.yml +245 -0
- package/src/swagger/projects.api.doc.yml +273 -0
- package/src/swagger/recentSpace.api.doc.yml +167 -0
- package/src/swagger/responses.yml +10 -0
- package/src/swagger/schemas.yml +35 -0
- package/src/swagger/space.api.doc.yml +641 -0
- package/src/swagger/spaceInvite.api.doc.yml +242 -0
- package/src/swagger/spaceTemplate.api.doc.yml +125 -0
- package/src/swagger/system.api.doc.yml +205 -0
- package/src/tests/integration/organizations-invite.feature.spec.ts +85 -0
- package/src/tests/integration/organizations.feature.spec.ts +112 -0
- package/src/tests/integration/space-invite.feature.spec.ts +89 -0
- package/src/tests/integration/space-template.feature.spec.ts +31 -0
- package/src/tests/integration/space.feature.spec.ts +150 -0
- package/src/tests/test-utils/appTestHarness.ts +508 -0
- package/src/tests/unit/cache.service.spec.ts +57 -0
- package/src/tests/unit/organization-invites.controller.spec.ts +154 -0
- package/src/tests/unit/organization-invites.service.spec.ts +316 -0
- package/src/tests/unit/organization-user.service.spec.ts +234 -0
- package/src/tests/unit/organizations.service.spec.ts +168 -0
- package/src/tests/unit/projects.service.spec.ts +255 -0
- package/src/tests/unit/recentSpace.service.spec.ts +195 -0
- package/src/tests/unit/space-invite.controller.spec.ts +150 -0
- package/src/tests/unit/space-invite.service.spec.ts +297 -0
- package/src/tests/unit/space-item.service.spec.ts +45 -0
- package/src/tests/unit/space-user.service.spec.ts +148 -0
- package/src/tests/unit/space.service.spec.ts +444 -0
- package/src/tests/unit/user.controller.auth.spec.ts +154 -0
- package/src/tests/unit/user.service.spec.ts +79 -0
- package/src/tests/unit/verifyAccessToken.spec.ts +59 -0
- package/src/types/express.d.ts +7 -0
- package/src/types/mq.types.ts +85 -0
- package/start-services.sh +61 -0
- package/test-setup.sh +95 -0
- package/tsconfig.eslint.json +5 -0
- package/tsconfig.json +45 -0
- package/tsconfig.prisma.json +8 -0
package/.dockerignore
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Docker
|
|
2
|
+
.dockerignore
|
|
3
|
+
Dockerfile
|
|
4
|
+
docker-compose.yml
|
|
5
|
+
docker-compose.*.yml
|
|
6
|
+
|
|
7
|
+
# Node
|
|
8
|
+
node_modules/
|
|
9
|
+
npm-debug.log
|
|
10
|
+
yarn-error.log
|
|
11
|
+
.pnpm-debug.log
|
|
12
|
+
|
|
13
|
+
# Build outputs
|
|
14
|
+
dist/
|
|
15
|
+
build/
|
|
16
|
+
*.js.map
|
|
17
|
+
|
|
18
|
+
# Environment
|
|
19
|
+
.env
|
|
20
|
+
.env.local
|
|
21
|
+
.env.*.local
|
|
22
|
+
|
|
23
|
+
# IDE
|
|
24
|
+
.vscode/
|
|
25
|
+
.idea/
|
|
26
|
+
*.swp
|
|
27
|
+
*.swo
|
|
28
|
+
*~
|
|
29
|
+
|
|
30
|
+
# OS
|
|
31
|
+
.DS_Store
|
|
32
|
+
Thumbs.db
|
|
33
|
+
|
|
34
|
+
# Logs
|
|
35
|
+
logs/
|
|
36
|
+
*.log
|
|
37
|
+
|
|
38
|
+
# Testing
|
|
39
|
+
coverage/
|
|
40
|
+
.nyc_output/
|
|
41
|
+
|
|
42
|
+
# Misc
|
|
43
|
+
.git/
|
|
44
|
+
.gitignore
|
|
45
|
+
README.md
|
|
46
|
+
*.md
|
package/.env.docker
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
PORT=5500
|
|
2
|
+
NODE_ENV=development
|
|
3
|
+
|
|
4
|
+
# Database
|
|
5
|
+
# DATABASE_URL="postgresql://postgres:1234@localhost:5433/odyssey-organizations"
|
|
6
|
+
DATABASE_URL=postgres://devuser:devpassword@host.docker.internal:5432/odyssey
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
CLIENT_HOST=localhost:5010
|
|
11
|
+
# Redis Configuration
|
|
12
|
+
REDIS_URL=redis://host.docker.internal:6379
|
|
13
|
+
|
|
14
|
+
RBAC_BASE_URL=http://odyssey-rbac-service/api/v1
|
|
15
|
+
|
|
16
|
+
REGION=ORD1
|
|
17
|
+
|
|
18
|
+
# JWT
|
|
19
|
+
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
|
|
20
|
+
JWT_EXPIRES_IN=7d
|
|
21
|
+
JWT_REFRESH_SECRET=your-jwt-refresh-secret-key-here
|
|
22
|
+
JWT_REFRESH_EXPIRES_IN=30d
|
|
23
|
+
|
|
24
|
+
# Encryption Keys (for token encryption/decryption)
|
|
25
|
+
# Generate using: openssl rand -hex 32
|
|
26
|
+
ENCRYPTION_KEY=your-32-byte-encryption-key-here-64-chars-hex
|
|
27
|
+
# Generate using: openssl rand -hex 16
|
|
28
|
+
ENCRYPTION_IV=your-16-byte-iv-here-32-chars-hex
|
|
29
|
+
|
|
30
|
+
# CORS
|
|
31
|
+
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001
|
|
32
|
+
POSTMARK_SERVER_API_TOKEN=test
|
|
33
|
+
SMTP_HOST=localhost
|
|
34
|
+
SMTP_PORT=1025
|
|
35
|
+
SMTP_USER=info
|
|
36
|
+
SMTP_PASSWORD=jjjjjjj
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
JWKS_URI=https://api-gateway.tenant-newgame.ord1.ingress.coreweave.cloud/sso/api/v1/.well-known/jwks.json
|
|
40
|
+
|
|
41
|
+
FIREBASE_DATABASE_URL=https://ngp-odyssey-default-rtdb.firebaseio.com
|
|
42
|
+
FIREBASE_SA_PATH=E:\Odessey\odyssey-organization-service\secret\service.account.json
|
|
43
|
+
|
|
44
|
+
GOOGLE_SA_PATH=E:\Odessey\odyssey-organization-service\secret\gcp.secret.json
|
|
45
|
+
|
|
46
|
+
BUCKET_NAME=odyssey-organization-alpha
|
package/.env.example
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
PORT=5500
|
|
2
|
+
NODE_ENV=development
|
|
3
|
+
|
|
4
|
+
DATABASE_URL=postgresql://postgres:jFIq078M72Of5eHf9C@postgres:5432/odyssey
|
|
5
|
+
|
|
6
|
+
REGION=ORD1
|
|
7
|
+
|
|
8
|
+
CLIENT_HOST=localhost:5010
|
|
9
|
+
|
|
10
|
+
# Redis Configuration
|
|
11
|
+
REDIS_URL=redis://:ktV1hSvL7R3B66Xp2q@redis-master:6379
|
|
12
|
+
|
|
13
|
+
POSTMARK_SERVER_API_TOKEN=567648a6-e2f8-4602-bf0e-c4182aa8ca9e
|
|
14
|
+
|
|
15
|
+
RBAC_BASE_URL=http://odyssey-rbac-service/api/v1
|
|
16
|
+
|
|
17
|
+
FIREBASE_DATABASE_URL=https://ngp-odyssey-default-rtdb.firebaseio.com
|
|
18
|
+
FIREBASE_SA_PATH=E:\Odessey\odyssey-organization-service\secret\service.account.json
|
|
19
|
+
|
|
20
|
+
JWKS_URI=https://api-gateway.tenant-newgame.ord1.ingress.coreweave.cloud/sso/api/v1/.well-known/jwks.json
|
|
21
|
+
|
|
22
|
+
GOOGLE_SA_PATH=E:\Odessey\odyssey-organization-service\secret\gcp.secret.json
|
|
23
|
+
|
|
24
|
+
BUCKET_NAME=odyssey-organization-alpha
|
|
25
|
+
|
package/.gitmodules
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx --no -- commitlint --edit $1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx lint-staged
|
package/.husky/pre-push
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
. "$(dirname -- "$0")/_/husky.sh"
|
|
3
|
+
|
|
4
|
+
# Cross-platform pre-push hook - only format check
|
|
5
|
+
echo "Running pre-push format checks..."
|
|
6
|
+
|
|
7
|
+
# Only check if code is properly formatted with Prettier
|
|
8
|
+
echo "Checking Prettier formatting..."
|
|
9
|
+
npm run format:check
|
|
10
|
+
|
|
11
|
+
echo "Pre-push format checks completed successfully!"
|
|
File without changes
|
package/.prettierignore
ADDED
package/.prettierrc
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# VS Code Configuration
|
|
2
|
+
|
|
3
|
+
This project includes a standardized VS Code configuration to ensure consistent development experience across all team members.
|
|
4
|
+
|
|
5
|
+
## What's Included
|
|
6
|
+
|
|
7
|
+
### `.vscode/settings.json`
|
|
8
|
+
|
|
9
|
+
- **Formatting**: Consistent code formatting with Prettier
|
|
10
|
+
- **Linting**: ESLint integration for JavaScript/TypeScript/Vue
|
|
11
|
+
- **Editor**: Tab size, rulers, word wrap settings
|
|
12
|
+
- **File associations**: Proper syntax highlighting for all file types
|
|
13
|
+
- **Auto-formatting**: Format on save and paste
|
|
14
|
+
|
|
15
|
+
### `.vscode/extensions.json`
|
|
16
|
+
|
|
17
|
+
- **Recommended extensions** that VS Code will prompt you to install
|
|
18
|
+
- Essential extensions for Vue.js, TypeScript, Docker, and Firebase development
|
|
19
|
+
|
|
20
|
+
### `.vscode/launch.json`
|
|
21
|
+
|
|
22
|
+
- **Debug configurations** for frontend and backend
|
|
23
|
+
- Chrome debugging for Vue.js frontend
|
|
24
|
+
- Node.js debugging for Firebase Functions
|
|
25
|
+
- Compound configurations to debug both simultaneously
|
|
26
|
+
|
|
27
|
+
### `.vscode/tasks.json`
|
|
28
|
+
|
|
29
|
+
- **Pre-configured tasks** for common development operations
|
|
30
|
+
- TypeScript type checking
|
|
31
|
+
- ESLint linting and fixing
|
|
32
|
+
- Docker operations
|
|
33
|
+
- Build tasks
|
|
34
|
+
|
|
35
|
+
### `.vscode/snippets/`
|
|
36
|
+
|
|
37
|
+
- **Custom code snippets** for Firebase Functions, Vue components, and common patterns
|
|
38
|
+
- Use snippet prefixes like `fbfunc`, `vuecomp`, `tryc` in your code
|
|
39
|
+
|
|
40
|
+
### `.vscode/keybindings.json`
|
|
41
|
+
|
|
42
|
+
- **Custom keyboard shortcuts** for development tasks
|
|
43
|
+
- `Ctrl+Shift+T`: Run TypeScript check
|
|
44
|
+
- `Ctrl+Shift+L`: Run ESLint
|
|
45
|
+
- `Ctrl+Shift+D`: Start Docker development
|
|
46
|
+
- `F5`: Start debugging
|
|
47
|
+
|
|
48
|
+
## Getting Started
|
|
49
|
+
|
|
50
|
+
1. **Install Recommended Extensions**
|
|
51
|
+
- VS Code will prompt you to install recommended extensions
|
|
52
|
+
- Or press `Ctrl+Shift+P` → "Extensions: Show Recommended Extensions"
|
|
53
|
+
|
|
54
|
+
2. **Open as Workspace**
|
|
55
|
+
- Open `odyssey-project.code-workspace` for the full workspace experience
|
|
56
|
+
- Or just open the folder normally
|
|
57
|
+
|
|
58
|
+
3. **Available Commands**
|
|
59
|
+
- Press `Ctrl+Shift+P` to open Command Palette
|
|
60
|
+
- Type "Tasks: Run Task" to see all available development tasks
|
|
61
|
+
- Use the Debug panel (F5) to start debugging sessions
|
|
62
|
+
|
|
63
|
+
## Custom Shortcuts
|
|
64
|
+
|
|
65
|
+
| Shortcut | Action |
|
|
66
|
+
| -------------- | ------------------------- |
|
|
67
|
+
| `Ctrl+Shift+T` | TypeScript: Check Types |
|
|
68
|
+
| `Ctrl+Shift+W` | TypeScript: Watch Types |
|
|
69
|
+
| `Ctrl+Shift+L` | ESLint: Check Code |
|
|
70
|
+
| `Ctrl+Shift+F` | ESLint: Fix Code |
|
|
71
|
+
| `Ctrl+Shift+D` | Docker: Start Development |
|
|
72
|
+
| `Ctrl+Shift+B` | Build All |
|
|
73
|
+
| `F5` | Start Debugging |
|
|
74
|
+
| `Shift+F5` | Stop Debugging |
|
|
75
|
+
|
|
76
|
+
## Code Snippets
|
|
77
|
+
|
|
78
|
+
Type these prefixes and press `Tab` to expand:
|
|
79
|
+
|
|
80
|
+
- `fbfunc` → Firebase Cloud Function template
|
|
81
|
+
- `fbtrigger` → Firestore trigger function
|
|
82
|
+
- `fbcreate` → Create Firestore document
|
|
83
|
+
- `fbupdate` → Update Firestore document
|
|
84
|
+
- `vuecomp` → Vue component template
|
|
85
|
+
- `vuexaction` → Vuex store action
|
|
86
|
+
- `tryc` → Try-catch block
|
|
87
|
+
- `cld` → Console.log debug
|
|
88
|
+
- `cle` → Console.error
|
|
89
|
+
|
|
90
|
+
## Notes
|
|
91
|
+
|
|
92
|
+
- All configurations are committed to git for team consistency
|
|
93
|
+
- Settings prioritize code quality and consistent formatting
|
|
94
|
+
- Debug configurations work with the Docker development environment
|
|
95
|
+
- Workspace settings override user settings for this project
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
// Essential for Node.js TypeScript development
|
|
4
|
+
"ms-vscode.vscode-typescript-next",
|
|
5
|
+
// Code formatting and linting
|
|
6
|
+
"esbenp.prettier-vscode",
|
|
7
|
+
"dbaeumer.vscode-eslint",
|
|
8
|
+
// Node.js development
|
|
9
|
+
"ms-vscode.vscode-node-azure-pack",
|
|
10
|
+
"christian-kohler.npm-intellisense",
|
|
11
|
+
"eg2.vscode-npm-script",
|
|
12
|
+
// Git integration
|
|
13
|
+
"eamodio.gitlens",
|
|
14
|
+
// Utility extensions
|
|
15
|
+
"ms-vscode.vscode-json",
|
|
16
|
+
"redhat.vscode-yaml",
|
|
17
|
+
// Code intelligence
|
|
18
|
+
"visualstudioexptteam.vscodeintellicode",
|
|
19
|
+
// File management
|
|
20
|
+
"alefragnani.project-manager",
|
|
21
|
+
// Markdown support
|
|
22
|
+
"yzhang.markdown-all-in-one",
|
|
23
|
+
// Environment files
|
|
24
|
+
"mikestead.dotenv",
|
|
25
|
+
// Better comments
|
|
26
|
+
"aaron-bond.better-comments",
|
|
27
|
+
// Path intellisense
|
|
28
|
+
"christian-kohler.path-intellisense",
|
|
29
|
+
// REST Client for API testing
|
|
30
|
+
"humao.rest-client",
|
|
31
|
+
// Database tools
|
|
32
|
+
"ms-mssql.mssql",
|
|
33
|
+
// Docker support (if needed)
|
|
34
|
+
"ms-azuretools.vscode-docker",
|
|
35
|
+
// Prisma ORM (since you have @prisma/client)
|
|
36
|
+
"prisma.prisma"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"key": "ctrl+shift+t",
|
|
4
|
+
"command": "workbench.action.tasks.runTask",
|
|
5
|
+
"args": "TypeScript: Check Types"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"key": "ctrl+shift+w",
|
|
9
|
+
"command": "workbench.action.tasks.runTask",
|
|
10
|
+
"args": "TypeScript: Watch Types"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"key": "ctrl+shift+l",
|
|
14
|
+
"command": "workbench.action.tasks.runTask",
|
|
15
|
+
"args": "ESLint: Check Code"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"key": "ctrl+shift+f",
|
|
19
|
+
"command": "workbench.action.tasks.runTask",
|
|
20
|
+
"args": "ESLint: Fix Code"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"key": "ctrl+shift+d",
|
|
24
|
+
"command": "workbench.action.tasks.runTask",
|
|
25
|
+
"args": "Docker: Start Development"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"key": "ctrl+shift+b",
|
|
29
|
+
"command": "workbench.action.tasks.runTask",
|
|
30
|
+
"args": "Build All"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"key": "f5",
|
|
34
|
+
"command": "workbench.action.debug.start",
|
|
35
|
+
"when": "!inDebugMode"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"key": "shift+f5",
|
|
39
|
+
"command": "workbench.action.debug.stop",
|
|
40
|
+
"when": "inDebugMode"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"key": "ctrl+`",
|
|
44
|
+
"command": "workbench.action.terminal.toggleTerminal"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"key": "ctrl+shift+`",
|
|
48
|
+
"command": "workbench.action.terminal.new"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"name": "Debug TypeScript Server",
|
|
6
|
+
"type": "node",
|
|
7
|
+
"request": "launch",
|
|
8
|
+
"program": "${workspaceFolder}/src/server.ts",
|
|
9
|
+
"runtimeArgs": ["-r", "ts-node/register"],
|
|
10
|
+
"env": {
|
|
11
|
+
"NODE_ENV": "development"
|
|
12
|
+
},
|
|
13
|
+
"skipFiles": ["<node_internals>/**"],
|
|
14
|
+
"console": "integratedTerminal",
|
|
15
|
+
"restart": true,
|
|
16
|
+
"sourceMaps": true,
|
|
17
|
+
"resolveSourceMapLocations": [
|
|
18
|
+
"${workspaceFolder}/**",
|
|
19
|
+
"!**/node_modules/**"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "Debug Built JavaScript",
|
|
24
|
+
"type": "node",
|
|
25
|
+
"request": "launch",
|
|
26
|
+
"program": "${workspaceFolder}/dist/server.js",
|
|
27
|
+
"env": {
|
|
28
|
+
"NODE_ENV": "development"
|
|
29
|
+
},
|
|
30
|
+
"skipFiles": ["<node_internals>/**"],
|
|
31
|
+
"console": "integratedTerminal",
|
|
32
|
+
"sourceMaps": true,
|
|
33
|
+
"preLaunchTask": "build"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "Attach to Process",
|
|
37
|
+
"type": "node",
|
|
38
|
+
"request": "attach",
|
|
39
|
+
"port": 9229,
|
|
40
|
+
"restart": true,
|
|
41
|
+
"skipFiles": ["<node_internals>/**"]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "Debug Tests",
|
|
45
|
+
"type": "node",
|
|
46
|
+
"request": "launch",
|
|
47
|
+
"program": "${workspaceFolder}/node_modules/.bin/jest",
|
|
48
|
+
"args": ["--runInBand", "--detectOpenHandles", "--forceExit"],
|
|
49
|
+
"console": "integratedTerminal",
|
|
50
|
+
"skipFiles": ["<node_internals>/**"],
|
|
51
|
+
"env": {
|
|
52
|
+
"NODE_ENV": "test"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cmake.ignoreCMakeListsMissing": true,
|
|
3
|
+
// TypeScript and JavaScript settings
|
|
4
|
+
"typescript.preferences.quoteStyle": "single",
|
|
5
|
+
"javascript.preferences.quoteStyle": "single",
|
|
6
|
+
"typescript.suggest.autoImports": true,
|
|
7
|
+
"javascript.suggest.autoImports": true,
|
|
8
|
+
// Editor settings
|
|
9
|
+
"editor.tabSize": 2,
|
|
10
|
+
"editor.insertSpaces": true,
|
|
11
|
+
"editor.formatOnSave": true,
|
|
12
|
+
"editor.formatOnPaste": true,
|
|
13
|
+
"editor.codeActionsOnSave": {
|
|
14
|
+
"source.fixAll.eslint": "explicit",
|
|
15
|
+
"source.organizeImports": "explicit"
|
|
16
|
+
},
|
|
17
|
+
// ESLint settings
|
|
18
|
+
"eslint.validate": ["javascript", "typescript"],
|
|
19
|
+
"eslint.format.enable": true,
|
|
20
|
+
"eslint.codeAction.showDocumentation": {
|
|
21
|
+
"enable": true
|
|
22
|
+
},
|
|
23
|
+
// File associations
|
|
24
|
+
"files.associations": {
|
|
25
|
+
"*.env*": "dotenv"
|
|
26
|
+
},
|
|
27
|
+
// Exclude from file watcher
|
|
28
|
+
"files.exclude": {
|
|
29
|
+
"**/node_modules": true,
|
|
30
|
+
"**/dist": true,
|
|
31
|
+
"**/.git": true
|
|
32
|
+
},
|
|
33
|
+
// Search settings
|
|
34
|
+
"search.exclude": {
|
|
35
|
+
"**/node_modules": true,
|
|
36
|
+
"**/dist": true,
|
|
37
|
+
"**/*.lock": true
|
|
38
|
+
},
|
|
39
|
+
// Terminal settings
|
|
40
|
+
"terminal.integrated.defaultProfile.osx": "zsh",
|
|
41
|
+
// Node.js debugging
|
|
42
|
+
"debug.node.autoAttach": "on"
|
|
43
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Firebase Function": {
|
|
3
|
+
"prefix": "fbfunc",
|
|
4
|
+
"body": [
|
|
5
|
+
"const ${1:functionName} = functions",
|
|
6
|
+
" .runWith(customRunWith)",
|
|
7
|
+
" .https.onCall(async (data: ${2:RequestType}, context) => {",
|
|
8
|
+
" try {",
|
|
9
|
+
" const userId = context.auth?.uid;",
|
|
10
|
+
" if (userId == undefined) {",
|
|
11
|
+
" throw new functions.https.HttpsError(",
|
|
12
|
+
" \"unauthenticated\",",
|
|
13
|
+
" \"User not authenticated\"",
|
|
14
|
+
" );",
|
|
15
|
+
" }",
|
|
16
|
+
"",
|
|
17
|
+
" $3",
|
|
18
|
+
"",
|
|
19
|
+
" return { success: true };",
|
|
20
|
+
" } catch (e: any) {",
|
|
21
|
+
" if (e instanceof functions.auth.HttpsError) {",
|
|
22
|
+
" throw e;",
|
|
23
|
+
" } else {",
|
|
24
|
+
" console.error(\"Unknown error encountered\");",
|
|
25
|
+
" console.error(e);",
|
|
26
|
+
" throw new functions.https.HttpsError(\"internal\", \"Unknown error\");",
|
|
27
|
+
" }",
|
|
28
|
+
" }",
|
|
29
|
+
" });",
|
|
30
|
+
],
|
|
31
|
+
"description": "Firebase Cloud Function with error handling",
|
|
32
|
+
},
|
|
33
|
+
"Firestore Trigger": {
|
|
34
|
+
"prefix": "fbtrigger",
|
|
35
|
+
"body": [
|
|
36
|
+
"const ${1:triggerName} = functions",
|
|
37
|
+
" .runWith(customRunWith)",
|
|
38
|
+
" .firestore.document(\"${2:collection}/{docId}\")",
|
|
39
|
+
" .${3|onCreate,onUpdate,onDelete|}(async (${4:snapshot}, context) => {",
|
|
40
|
+
" console.debug(\"Document context:\");",
|
|
41
|
+
" console.debug(JSON.stringify(context));",
|
|
42
|
+
" console.debug(\"Document data:\");",
|
|
43
|
+
" console.debug(JSON.stringify($4.data()));",
|
|
44
|
+
"",
|
|
45
|
+
" const ${5:docId}: string = context.params.${5:docId};",
|
|
46
|
+
"",
|
|
47
|
+
" $6",
|
|
48
|
+
" });",
|
|
49
|
+
],
|
|
50
|
+
"description": "Firestore trigger function",
|
|
51
|
+
},
|
|
52
|
+
"Firestore Document Create": {
|
|
53
|
+
"prefix": "fbcreate",
|
|
54
|
+
"body": [
|
|
55
|
+
"const ${1:docData}: ${2:DocType} = {",
|
|
56
|
+
" created: FieldValue.serverTimestamp() as any,",
|
|
57
|
+
" updated: FieldValue.serverTimestamp() as any,",
|
|
58
|
+
" $3",
|
|
59
|
+
"};",
|
|
60
|
+
"",
|
|
61
|
+
"await ${4:getDocRef}($5).set($1);",
|
|
62
|
+
],
|
|
63
|
+
"description": "Create Firestore document with timestamps",
|
|
64
|
+
},
|
|
65
|
+
"Firestore Document Update": {
|
|
66
|
+
"prefix": "fbupdate",
|
|
67
|
+
"body": [
|
|
68
|
+
"await ${1:docRef}.update({",
|
|
69
|
+
" updated: FieldValue.serverTimestamp() as any,",
|
|
70
|
+
" $2",
|
|
71
|
+
"});",
|
|
72
|
+
],
|
|
73
|
+
"description": "Update Firestore document with timestamp",
|
|
74
|
+
},
|
|
75
|
+
"Vue Component Template": {
|
|
76
|
+
"prefix": "vuecomp",
|
|
77
|
+
"body": [
|
|
78
|
+
"<template>",
|
|
79
|
+
" <div class=\"${1:component-name}\">",
|
|
80
|
+
" $2",
|
|
81
|
+
" </div>",
|
|
82
|
+
"</template>",
|
|
83
|
+
"",
|
|
84
|
+
"<script lang=\"ts\">",
|
|
85
|
+
"import { defineComponent } from 'vue';",
|
|
86
|
+
"",
|
|
87
|
+
"export default defineComponent({",
|
|
88
|
+
" name: '${3:ComponentName}',",
|
|
89
|
+
" props: {",
|
|
90
|
+
" $4",
|
|
91
|
+
" },",
|
|
92
|
+
" data() {",
|
|
93
|
+
" return {",
|
|
94
|
+
" $5",
|
|
95
|
+
" };",
|
|
96
|
+
" },",
|
|
97
|
+
" methods: {",
|
|
98
|
+
" $6",
|
|
99
|
+
" },",
|
|
100
|
+
"});",
|
|
101
|
+
"</script>",
|
|
102
|
+
"",
|
|
103
|
+
"<style lang=\"sass\" scoped>",
|
|
104
|
+
"@import @/styles/main",
|
|
105
|
+
"",
|
|
106
|
+
".${1:component-name}",
|
|
107
|
+
" $7",
|
|
108
|
+
"</style>",
|
|
109
|
+
],
|
|
110
|
+
"description": "Vue component template with TypeScript and Sass",
|
|
111
|
+
},
|
|
112
|
+
"Vuex Store Action": {
|
|
113
|
+
"prefix": "vuexaction",
|
|
114
|
+
"body": [
|
|
115
|
+
"async ${1:actionName}(context: any, ${2:payload}: ${3:PayloadType}) {",
|
|
116
|
+
" try {",
|
|
117
|
+
" $4",
|
|
118
|
+
" return { success: true };",
|
|
119
|
+
" } catch (error) {",
|
|
120
|
+
" console.error('${1:actionName} error:', error);",
|
|
121
|
+
" context.commit('SET_ERROR_NOTFICATIONS', 'An error occurred. Please try again.');",
|
|
122
|
+
" return { success: false };",
|
|
123
|
+
" }",
|
|
124
|
+
"},",
|
|
125
|
+
],
|
|
126
|
+
"description": "Vuex store action with error handling",
|
|
127
|
+
},
|
|
128
|
+
"Console Log Debug": {
|
|
129
|
+
"prefix": "cld",
|
|
130
|
+
"body": ["console.log('${1:label}:', $2);"],
|
|
131
|
+
"description": "Console log for debugging",
|
|
132
|
+
},
|
|
133
|
+
"Console Error": {
|
|
134
|
+
"prefix": "cle",
|
|
135
|
+
"body": ["console.error('${1:error message}:', $2);"],
|
|
136
|
+
"description": "Console error log",
|
|
137
|
+
},
|
|
138
|
+
"Try Catch Block": {
|
|
139
|
+
"prefix": "tryc",
|
|
140
|
+
"body": [
|
|
141
|
+
"try {",
|
|
142
|
+
" $1",
|
|
143
|
+
"} catch (error) {",
|
|
144
|
+
" console.error('${2:operation} error:', error);",
|
|
145
|
+
" $3",
|
|
146
|
+
"}",
|
|
147
|
+
],
|
|
148
|
+
"description": "Try-catch block with error logging",
|
|
149
|
+
},
|
|
150
|
+
}
|