
Complete rewrite from Python/FastAPI to Node.js stack: Features implemented: - User authentication with JWT tokens and role-based access (DEVELOPER/BUYER) - Blockchain wallet linking and management with Ethereum integration - Carbon project creation and management for developers - Marketplace for browsing and purchasing carbon offsets - Transaction tracking with blockchain integration - Comprehensive input validation with Joi - Advanced security with Helmet, CORS, and rate limiting - Error handling and logging middleware - Health check endpoint with service monitoring Technical stack: - Node.js with Express.js and TypeScript - Prisma ORM with SQLite database - Web3.js and Ethers.js for blockchain integration - JWT authentication with bcrypt password hashing - Comprehensive validation and security middleware - Production-ready error handling and logging Database schema: - Users with wallet linking capabilities - Carbon projects with verification status - Carbon offsets with blockchain token tracking - Transactions with confirmation details Environment variables required: - JWT_SECRET (required) - DATABASE_URL (optional, defaults to SQLite) - BLOCKCHAIN_RPC_URL (optional, defaults to localhost) - NODE_ENV, PORT, CORS_ORIGIN (optional) Run with: npm install && npm run db:generate && npm run db:migrate && npm run dev
66 lines
1.7 KiB
JSON
66 lines
1.7 KiB
JSON
{
|
|
"name": "carbon-offset-trading-platform",
|
|
"version": "1.0.0",
|
|
"description": "A blockchain-enabled carbon offset trading platform for project developers and buyers",
|
|
"main": "dist/server.js",
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"start": "node dist/server.js",
|
|
"dev": "tsx watch src/server.ts",
|
|
"db:migrate": "npx prisma migrate dev",
|
|
"db:generate": "npx prisma generate",
|
|
"db:studio": "npx prisma studio",
|
|
"lint": "eslint src/**/*.ts",
|
|
"lint:fix": "eslint src/**/*.ts --fix",
|
|
"test": "jest"
|
|
},
|
|
"keywords": [
|
|
"carbon-offset",
|
|
"blockchain",
|
|
"trading",
|
|
"sustainability",
|
|
"ethereum",
|
|
"express",
|
|
"typescript"
|
|
],
|
|
"author": "BackendIM",
|
|
"license": "MIT",
|
|
"dependencies": {
|
|
"express": "^4.18.2",
|
|
"cors": "^2.8.5",
|
|
"helmet": "^7.1.0",
|
|
"bcryptjs": "^2.4.3",
|
|
"jsonwebtoken": "^9.0.2",
|
|
"prisma": "^5.6.0",
|
|
"@prisma/client": "^5.6.0",
|
|
"web3": "^4.2.2",
|
|
"ethers": "^6.8.1",
|
|
"uuid": "^9.0.1",
|
|
"joi": "^17.11.0",
|
|
"express-rate-limit": "^7.1.5",
|
|
"compression": "^1.7.4",
|
|
"morgan": "^1.10.0",
|
|
"dotenv": "^16.3.1"
|
|
},
|
|
"devDependencies": {
|
|
"@types/express": "^4.17.21",
|
|
"@types/cors": "^2.8.17",
|
|
"@types/bcryptjs": "^2.4.6",
|
|
"@types/jsonwebtoken": "^9.0.5",
|
|
"@types/uuid": "^9.0.7",
|
|
"@types/compression": "^1.7.5",
|
|
"@types/morgan": "^1.9.9",
|
|
"@types/node": "^20.9.0",
|
|
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
|
"@typescript-eslint/parser": "^6.12.0",
|
|
"eslint": "^8.54.0",
|
|
"typescript": "^5.3.2",
|
|
"tsx": "^4.6.0",
|
|
"jest": "^29.7.0",
|
|
"@types/jest": "^29.5.8",
|
|
"ts-jest": "^29.1.1"
|
|
},
|
|
"engines": {
|
|
"node": ">=18.0.0"
|
|
}
|
|
} |