Complete technical specifications, API documentation, and integration guide for Neyatech platform
Note: Frontend is 100% complete and functional. You only need to build the backend API and connect it.
id UUID PRIMARY KEY DEFAULT uuid_generate_v4()
clerk_user_id VARCHAR(255) UNIQUE NOT NULL
email VARCHAR(255) UNIQUE NOT NULL
full_name VARCHAR(255) NOT NULL
phone VARCHAR(50)
user_type ENUM('owner', 'volunteer', 'admin') NOT NULL
profile_image VARCHAR(500)
location VARCHAR(255)
bio TEXT
is_verified BOOLEAN DEFAULT FALSE
rating DECIMAL(3,2) DEFAULT 0.00
total_reviews INTEGER DEFAULT 0
created_at TIMESTAMP DEFAULT NOW()
updated_at TIMESTAMP DEFAULT NOW()
id UUID PRIMARY KEY DEFAULT uuid_generate_v4()
owner_id UUID REFERENCES users(id) ON DELETE CASCADE
title VARCHAR(255) NOT NULL
description TEXT NOT NULL
category ENUM('prayer', 'umrah', 'charity', 'holy_sites', 'zamzam', 'quran') NOT NULL
location VARCHAR(255) NOT NULL
status ENUM('pending', 'accepted', 'in_progress', 'completed', 'cancelled') DEFAULT 'pending'
deadline TIMESTAMP
cost DECIMAL(10,2) DEFAULT 0.00
image_url VARCHAR(500)
views_count INTEGER DEFAULT 0
volunteer_id UUID REFERENCES users(id) ON DELETE SET NULL
accepted_at TIMESTAMP
completed_at TIMESTAMP
created_at TIMESTAMP DEFAULT NOW()
updated_at TIMESTAMP DEFAULT NOW()
id UUID PRIMARY KEY DEFAULT uuid_generate_v4()
intention_id UUID REFERENCES intentions(id) ON DELETE CASCADE
volunteer_id UUID REFERENCES users(id) ON DELETE CASCADE
proof_type ENUM('photo', 'video', 'document') NOT NULL
file_url VARCHAR(500) NOT NULL
description TEXT
is_approved BOOLEAN DEFAULT FALSE
submitted_at TIMESTAMP DEFAULT NOW()
id UUID PRIMARY KEY DEFAULT uuid_generate_v4()
intention_id UUID REFERENCES intentions(id) ON DELETE CASCADE
owner_id UUID REFERENCES users(id) ON DELETE CASCADE
volunteer_id UUID REFERENCES users(id) ON DELETE CASCADE
rating INTEGER CHECK (rating >= 1 AND rating <= 5) NOT NULL
comment TEXT
is_public BOOLEAN DEFAULT TRUE
created_at TIMESTAMP DEFAULT NOW()
id UUID PRIMARY KEY DEFAULT uuid_generate_v4()
user_id UUID REFERENCES users(id) ON DELETE CASCADE
type VARCHAR(50) NOT NULL
title VARCHAR(255) NOT NULL
message TEXT NOT NULL
link VARCHAR(500)
is_read BOOLEAN DEFAULT FALSE
created_at TIMESTAMP DEFAULT NOW()
Database Creation Script: Run the SQL migration script to create all tables with proper indexes and foreign keys.
/api/users/:userId
Get user profile information
{
"id": "uuid",
"email": "[email protected]",
"full_name": "Ahmed Mohamed",
"user_type": "volunteer",
"rating": 4.9,
"total_reviews": 38
}
/api/users/:userId
Update user profile
{
"full_name": "Ahmed Mohamed",
"phone": "+966501234567",
"location": "Makkah, Saudi Arabia",
"bio": "Certified volunteer..."
}
/api/intentions
Get all intentions with filters
?category=umrah&status=pending&location=makkah&page=1&limit=10
/api/intentions
Create a new intention
{
"title": "Umrah for My Father",
"description": "Perform complete Umrah...",
"category": "umrah",
"location": "Makkah",
"deadline": "2025-12-31T23:59:59Z",
"cost": 0.00
}
/api/intentions/:id/accept
Volunteer accepts an intention
{
"volunteer_id": "uuid",
"estimated_completion": "2025-12-15T10:00:00Z"
}
/api/intentions/:id/complete
Mark intention as completed
{
"status": "completed",
"completion_notes": "Umrah completed successfully..."
}
/api/proofs
Upload proof of intention fulfillment
{
"intention_id": "uuid",
"proof_type": "photo",
"file": [File],
"description": "Photo taken at Kaaba..."
}
/api/intentions/:id/proofs
Get all proof submissions for an intention
/api/reviews
Submit a review for volunteer
{
"intention_id": "uuid",
"volunteer_id": "uuid",
"rating": 5,
"comment": "Excellent work!",
"is_public": true
}
/api/volunteers/:id/reviews
Get all public reviews for a volunteer
/api/notifications
Get all notifications for logged-in user
?unread_only=true&page=1&limit=20
/api/notifications/:id/read
Mark notification as read
All API endpoints (except public browsing) require authentication via JWT token in the Authorization header:
Clerk.js is already integrated in the frontend. Users can sign up and log in through the registration page.
Publishable Key:
pk_test_ZmFtb3VzLXJhdHRsZXItODguY2xlcmsuYWNjb3VudHMuZGV2JA
const { ClerkExpressWithAuth } = require('@clerk/clerk-sdk-node');
// Middleware for protected routes
app.use('/api/*', ClerkExpressWithAuth({
secretKey: process.env.CLERK_SECRET_KEY
}));
// Access user info in routes
app.get('/api/profile', (req, res) => {
const userId = req.auth.userId; // Clerk user ID
// Query your database...
});
Use Clerk webhooks to sync user data to your database when users sign up:
// Webhook endpoint: /api/webhooks/clerk
app.post('/api/webhooks/clerk', async (req, res) => {
const { type, data } = req.body;
if (type === 'user.created') {
await db.users.create({
clerk_user_id: data.id,
email: data.email_addresses[0].email_address,
full_name: `${data.first_name} ${data.last_name}`,
user_type: data.public_metadata.user_type || 'owner'
});
}
});
Important: Store your Clerk Secret Key in environment variables and never expose it in frontend code.
const AWS = require('aws-sdk');
const multer = require('multer');
const multerS3 = require('multer-s3');
const s3 = new AWS.S3({
accessKeyId: process.env.AWS_ACCESS_KEY,
secretAccessKey: process.env.AWS_SECRET_KEY,
region: 'us-east-1'
});
const upload = multer({
storage: multerS3({
s3: s3,
bucket: 'neyatech-proofs',
acl: 'public-read',
key: function (req, file, cb) {
cb(null, `proofs/${Date.now()}-${file.originalname}`);
}
}),
fileFilter: (req, file, cb) => {
// Accept images and videos only
if (file.mimetype.startsWith('image/') ||
file.mimetype.startsWith('video/')) {
cb(null, true);
} else {
cb(new Error('Invalid file type'), false);
}
},
limits: { fileSize: 50 * 1024 * 1024 } // 50MB max
});
// Upload endpoint
app.post('/api/proofs', upload.single('file'), (req, res) => {
res.json({
file_url: req.file.location,
file_key: req.file.key
});
});
Alternative: You can also use Cloudinary or DigitalOcean Spaces for simpler setup.
✅ Your frontend is already live on Landingsite.ai at: ar.neyatech.net
All you need to do is connect your backend API endpoints to make it fully functional.
DATABASE_URL=postgresql://user:pass@host:5432/neyatech CLERK_SECRET_KEY=sk_test_xxxxxxxxxxxxx CLERK_PUBLISHABLE_KEY=pk_test_xxxxxxxxxxxxx AWS_ACCESS_KEY=xxxxxxxxxxxx AWS_SECRET_KEY=xxxxxxxxxxxx AWS_BUCKET_NAME=neyatech-proofs SENDGRID_API_KEY=xxxxxxxxxxxx JWT_SECRET=your-secret-key PORT=3000 NODE_ENV=production
The frontend is 100% complete and live. Follow this documentation to build and connect your backend API. Need help? Contact the development team!