Skip to content

Commit 45b04ed

Browse files
authored
Merge pull request #5 from frckbrice/refactor/postgrest-api
Refactor/postgrest api to consider using supabase postgREST api to communicate with the database instead of using supabse database api because supabase was not offering the dns lookup of the database url. this was causing the project to not communicating with the databse. I ended up refactoring the code to cater with this new change.
2 parents 209eb3e + b4d426a commit 45b04ed

File tree

125 files changed

+33530
-3602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+33530
-3602
lines changed

.coderabbit.ignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# CodeRabbit ignore patterns
2+
# Files and directories that should be excluded from CodeRabbit reviews
3+
4+
# Dependencies and build outputs
5+
node_modules/
6+
.next/
7+
dist/
8+
build/
9+
coverage/
10+
11+
# Lock files
12+
yarn.lock
13+
package-lock.json
14+
pnpm-lock.yaml
15+
16+
# Environment and config files
17+
.env*
18+
!.env.example
19+
20+
# IDE and editor files
21+
.vscode/
22+
.idea/
23+
*.swp
24+
*.swo
25+
*~
26+
27+
# OS files
28+
.DS_Store
29+
Thumbs.db
30+
31+
# Logs
32+
*.log
33+
logs/
34+
35+
# Temporary files
36+
*.tmp
37+
*.temp
38+
39+
# Generated files
40+
*.min.js
41+
*.min.css
42+
43+
# Documentation images (but allow README.md)
44+
public/project-images/
45+
*.png
46+
*.jpg
47+
*.jpeg
48+
*.gif
49+
*.svg
50+
!src/**/*.svg
51+
52+
# Database and migration files
53+
migrations/
54+
*.db
55+
*.sqlite
56+
57+
# Test coverage reports
58+
coverage/
59+
.nyc_output/
60+
61+
# Storybook
62+
storybook-static/
63+
64+
# Miscellaneous
65+
.cache/
66+
.parcel-cache/

.coderabbit.yaml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# CodeRabbit Configuration
2+
# https://docs.coderabbit.ai/guides/review-configuration
3+
4+
# Language and framework-specific settings
5+
language: typescript
6+
frameworks:
7+
- nextjs
8+
- react
9+
- supabase
10+
11+
# Review settings
12+
reviews:
13+
# Enable automatic reviews on pull requests
14+
auto_review: true
15+
16+
# Enable draft PR reviews
17+
draft_reviews: true
18+
19+
# Review scope
20+
scope:
21+
- "src/**"
22+
- "*.ts"
23+
- "*.tsx"
24+
- "*.js"
25+
- "*.jsx"
26+
- "*.json"
27+
- "*.md"
28+
- ".github/**"
29+
30+
# Exclude patterns
31+
exclude:
32+
- "node_modules/**"
33+
- ".next/**"
34+
- "dist/**"
35+
- "build/**"
36+
- "coverage/**"
37+
- "*.min.js"
38+
- "yarn.lock"
39+
- "package-lock.json"
40+
41+
# Code quality checks
42+
quality:
43+
# Security checks
44+
security: true
45+
46+
# Performance analysis
47+
performance: true
48+
49+
# Best practices
50+
best_practices: true
51+
52+
# Code style and formatting
53+
style: true
54+
55+
# Type safety (TypeScript)
56+
type_safety: true
57+
58+
# Test coverage analysis
59+
test_coverage: true
60+
61+
# Specific rules for this project
62+
rules:
63+
# React/Next.js specific
64+
react:
65+
- prefer_function_components
66+
- use_proper_hooks_dependencies
67+
- avoid_inline_styles
68+
- proper_key_props
69+
70+
# TypeScript specific
71+
typescript:
72+
- strict_type_checking
73+
- no_any_types
74+
- proper_interface_naming
75+
- consistent_return_types
76+
77+
# Security specific
78+
security:
79+
- no_hardcoded_secrets
80+
- secure_api_endpoints
81+
- proper_authentication_checks
82+
- validate_user_inputs
83+
84+
# Performance specific
85+
performance:
86+
- optimize_database_queries
87+
- minimize_re_renders
88+
- proper_memoization
89+
- lazy_loading_components
90+
91+
# Integration settings
92+
integrations:
93+
github:
94+
# Enable PR comments
95+
pr_comments: true
96+
97+
# Enable status checks
98+
status_checks: true
99+
100+
# Auto-approve minor changes (optional)
101+
auto_approve_minor: false
102+
103+
# Request reviews for major changes
104+
request_human_review: true
105+
106+
# Notification settings
107+
notifications:
108+
# Notify on high-priority issues
109+
high_priority: true
110+
111+
# Notify on security issues
112+
security_issues: true
113+
114+
# Summary reports
115+
summary_reports: true
116+
117+
# Custom prompts for this project
118+
custom_prompts:
119+
- "Focus on real-time collaboration features and ensure proper handling of concurrent users"
120+
- "Pay attention to Supabase integration and PostgREST query optimization"
121+
- "Review authentication and authorization implementation carefully"
122+
- "Check for proper error handling in async operations"
123+
- "Ensure proper cleanup of real-time subscriptions and connections"
124+
- "Validate proper use of React hooks and state management"
125+
- "Review test coverage and quality of unit tests"

.github/workflows/ci.yml

Lines changed: 16 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,36 @@
1-
name: CI Pipeline
1+
name: CI
22

33
on:
44
push:
5-
branches: main, develop ]
5+
branches: [main, develop, refactor/postgrest-api]
66
pull_request:
7-
branches: [ main, develop ]
8-
9-
env:
10-
NODE_VERSION: 18
7+
branches: [main, develop, refactor/postgrest-api]
118

129
jobs:
13-
lint-and-type-check:
14-
name: Lint and Type Check
10+
build-and-test:
1511
runs-on: ubuntu-latest
16-
12+
env:
13+
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
14+
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
1715
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
16+
- uses: actions/checkout@v4
2017

21-
- name: Setup Node.js
18+
- name: Use Node.js 22
2219
uses: actions/setup-node@v4
2320
with:
24-
node-version: ${{ env.NODE_VERSION }}
25-
cache: 'yarn'
21+
node-version: 22
2622

2723
- name: Install dependencies
2824
run: yarn install --frozen-lockfile
2925

30-
- name: Run ESLint
26+
- name: Lint
3127
run: yarn lint
3228

33-
- name: Run TypeScript type check
34-
run: yarn tsc --noEmit
35-
36-
# test:
37-
# name: Test
38-
# runs-on: ubuntu-latest
39-
40-
# steps:
41-
# - name: Checkout code
42-
# uses: actions/checkout@v4
43-
44-
# - name: Setup Node.js
45-
# uses: actions/setup-node@v4
46-
# with:
47-
# node-version: ${{ env.NODE_VERSION }}
48-
# cache: 'yarn'
49-
50-
# - name: Install dependencies
51-
# run: yarn install --frozen-lockfile
52-
53-
# - name: Run tests
54-
# run: yarn test
55-
# env:
56-
# CI: true
57-
58-
build:
59-
name: Build
60-
runs-on: ubuntu-latest
61-
# needs: [lint-and-type-check, test]
62-
needs: [lint-and-type-check]
63-
64-
steps:
65-
- name: Checkout code
66-
uses: actions/checkout@v4
67-
68-
- name: Setup Node.js
69-
uses: actions/setup-node@v4
70-
with:
71-
node-version: ${{ env.NODE_VERSION }}
72-
cache: 'yarn'
73-
74-
- name: Install dependencies
75-
run: yarn install --frozen-lockfile
29+
- name: Run unit tests (Vitest)
30+
run: yarn test:unit
7631

77-
- name: Build application
32+
- name: Build
7833
run: yarn build
79-
env:
80-
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
81-
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
82-
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
83-
84-
- name: Upload build artifacts
85-
uses: actions/upload-artifact@v4
86-
with:
87-
name: build-files
88-
path: .next/
89-
retention-days: 1
90-
security-scan:
91-
name: Security Scan
92-
runs-on: ubuntu-latest
93-
94-
steps:
95-
- name: Checkout code
96-
uses: actions/checkout@v4
97-
98-
- name: Setup Node.js
99-
uses: actions/setup-node@v4
100-
with:
101-
node-version: ${{ env.NODE_VERSION }}
102-
cache: 'yarn'
103-
104-
- name: Install dependencies
105-
run: yarn install --frozen-lockfile
10634

107-
- name: Run security audit
108-
run: yarn audit --audit-level moderate
35+
# - name: Run E2E tests (Playwright)
36+
# run: yarn test:e2e

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- develop
88

99
env:
10-
NODE_VERSION: 18
10+
NODE_VERSION: 22
1111

1212
jobs:
1313
deploy:
@@ -40,4 +40,4 @@ jobs:
4040
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
4141
vercel-args: ${{ github.ref == 'refs/heads/main' && '--prod' || '' }}
4242
env:
43-
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
43+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ next-env.d.ts
3939
certificates
4040
scripts/
4141

42-
tsconfig.tsbuildinfo
43-
public_schema_dump.sql
42+
tsconfig.tsbuildinfo

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"editor.defaultFormatter": "denoland.vscode-deno"
44
},
55
"deno.enable": true,
6-
"deno.enablePaths": [
7-
"supabase/functions"
8-
],
6+
"deno.enablePaths": ["supabase/functions"],
97
"deno.lint": true,
108
"deno.suggest.imports.hosts": {
119
"https://cdn.nest.land": true,

0 commit comments

Comments
 (0)