Skip to content

Commit f6b1c00

Browse files
authored
Merge branch 'main' into feature/rbac-implementation
2 parents 92d534c + 8b742b8 commit f6b1c00

16,392 files changed

Lines changed: 1926781 additions & 23911 deletions

File tree

Some content is hidden

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

‎.env.example‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
# Server Configuration
2-
PORT=3000
31

4-
# Stellar Configuration (Optional - will run in simulation mode if not provided)
5-
STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
6-
STELLAR_AUDIT_ACCOUNT_PUBLIC_KEY=your_public_key
7-
STELLAR_AUDIT_ACCOUNT_SECRET_KEY=your_secret_key
8-
9-
# Database Configuration (SQLite - file will be created automatically)
10-
DB_PATH=./data/audit.db
11-
12-
# RBAC Configuration
13-
JWT_SECRET=your-super-secret-jwt-key-change-in-production
14-
JWT_EXPIRES_IN=24h

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Vesting API Tests
1+
name: Vesting Vault Tests
22

33
on:
44
push:
@@ -9,136 +9,4 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
13-
services:
14-
sqlite:
15-
image: keinos/sqlite3:latest
16-
options: >-
17-
--health-cmd "sqlite3 --version"
18-
--health-interval 10s
19-
--health-timeout 5s
20-
--health-retries 5
2112

22-
steps:
23-
- uses: actions/checkout@v4
24-
25-
- name: Setup Node.js
26-
uses: actions/setup-node@v4
27-
with:
28-
node-version: '18'
29-
cache: 'npm'
30-
31-
- name: Install dependencies
32-
run: npm ci
33-
34-
- name: Create environment file
35-
run: cp .env.example .env
36-
37-
- name: Create data directory
38-
run: mkdir -p data
39-
40-
- name: Run unit tests
41-
run: npm test
42-
43-
- name: Run RBAC tests specifically
44-
run: npm test -- --testPathPattern=rbac
45-
46-
- name: Generate coverage report
47-
run: npm run test:coverage
48-
49-
- name: Upload coverage to Codecov
50-
uses: codecov/codecov-action@v3
51-
with:
52-
file: ./coverage/lcov.info
53-
flags: unittests
54-
name: codecov-umbrella
55-
fail_ci_if_error: false
56-
57-
rbac-security-test:
58-
runs-on: ubuntu-latest
59-
steps:
60-
- uses: actions/checkout@v4
61-
62-
- name: Setup Node.js
63-
uses: actions/setup-node@v4
64-
with:
65-
node-version: '18'
66-
cache: 'npm'
67-
68-
- name: Install dependencies
69-
run: npm ci
70-
71-
- name: Create environment file
72-
run: cp .env.example .env
73-
74-
- name: Create data directory
75-
run: mkdir -p data
76-
77-
- name: Start application in background
78-
run: |
79-
npm start &
80-
sleep 10
81-
82-
- name: Test RBAC endpoints
83-
run: |
84-
# Test token generation for all roles
85-
curl -X POST http://localhost:3000/api/auth/token/generate \
86-
-H "Content-Type: application/json" \
87-
-d '{"id":"test-super","email":"super@test.com","role":"super_admin"}' \
88-
|| exit 1
89-
90-
curl -X POST http://localhost:3000/api/auth/token/generate \
91-
-H "Content-Type: application/json" \
92-
-d '{"id":"test-finance","email":"finance@test.com","role":"finance_manager"}' \
93-
|| exit 1
94-
95-
curl -X POST http://localhost:3000/api/auth/token/generate \
96-
-H "Content-Type: application/json" \
97-
-d '{"id":"test-hr","email":"hr@test.com","role":"hr_manager"}' \
98-
|| exit 1
99-
100-
curl -X POST http://localhost:3000/api/auth/token/generate \
101-
-H "Content-Type: application/json" \
102-
-d '{"id":"test-auditor","email":"auditor@test.com","role":"read_only_auditor"}' \
103-
|| exit 1
104-
105-
- name: Cleanup
106-
run: pkill -f "node index.js" || true
107-
108-
security-audit:
109-
runs-on: ubuntu-latest
110-
steps:
111-
- uses: actions/checkout@v4
112-
113-
- name: Setup Node.js
114-
uses: actions/setup-node@v4
115-
with:
116-
node-version: '18'
117-
cache: 'npm'
118-
119-
- name: Install dependencies
120-
run: npm ci
121-
122-
- name: Run security audit
123-
run: npm audit --audit-level=moderate
124-
continue-on-error: true
125-
126-
lint:
127-
runs-on: ubuntu-latest
128-
steps:
129-
- uses: actions/checkout@v4
130-
131-
- name: Setup Node.js
132-
uses: actions/setup-node@v4
133-
with:
134-
node-version: '18'
135-
cache: 'npm'
136-
137-
- name: Install dependencies
138-
run: npm ci
139-
140-
- name: Run ESLint
141-
run: |
142-
npm install -g eslint
143-
eslint . --ext .js || true
144-
continue-on-error: true

‎.gitignore‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Dependencies
2+
node_modules/
3+
backend/node_modules/
4+
5+
# Environment variables
6+
.env
7+
.env.local
8+
.env.development.local
9+
.env.test.local
10+
.env.production.local
11+
12+
# Logs
13+
logs
14+
*.log
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
lerna-debug.log*
19+
20+
# Runtime data
21+
pids
22+
*.pid
23+
*.seed
24+
*.pid.lock
25+
26+
#
27+
node_modules
28+
Coverage directory used by tools like istanbul
29+
coverage/
30+
*.lcov
31+
32+
# nyc test coverage
33+
.nyc_output
34+
35+
# Dependency directories
36+
jspm_packages/
37+
38+
# Optional npm cache directory
39+
.npm
40+
41+
# Optional eslint cache
42+
.eslintcache
43+
44+
# Microbundle cache
45+
.rpt2_cache/
46+
.rts2_cache_cjs/
47+
.rts2_cache_es/
48+
.rts2_cache_umd/
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# Yarn Integrity file
57+
.yarn-integrity
58+
59+
# dotenv environment variables file
60+
.env.test
61+
node_modules

‎.vscode/settings.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"kiroAgent.configureMCP": "Disabled"
3+
}

‎ARCHITECTURE.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Backend Architecture
2+
3+
## Data Flow Overview
4+
5+
```mermaid
6+
flowchart TD
7+
A[Stellar Horizon API] --> B[RPC Indexer]
8+
B --> C[PostgreSQL Database]
9+
C --> D[Express API]
10+
D --> E[Dashboard UI]
11+
```
12+
13+
## Explanation
14+
15+
1. The RPC Indexer fetches vesting-related data from the Stellar Horizon API.
16+
2. The RPC Indexer processes and stores the data in the PostgreSQL database.
17+
3. The Express API reads data from the PostgreSQL database.
18+
4. The Dashboard UI consumes data from the Express API.

0 commit comments

Comments
 (0)