This file defines the routes for user-related operations in the API.
Endpoint Description: Create a new user with a unique public address.
Endpoint URL:
POST http://localhost:3000/api/signup/:publicAddress
Endpoint Example:
// Request
POST http://localhost:3000/api/signup/0x123456789abcdef
// Response (Status Code: 201 Created)
{
"publicAddress": "0x123456789abcdef",
// Other user properties
}
Endpoint Description: Retrieve user information by their public address.
Endpoint URL:
GET http://localhost:3000/api/get/:publicAddress
Endpoint Example:
// Request
GET http://localhost:3000/api/get/0x123456789abcdef
// Response (Status Code: 200 OK)
{
"user": {
// User details
},
"token": "JWT_TOKEN"
}
Endpoint Description: Update a user's referral information.
Endpoint URL:
PATCH http://localhost:3000/api/referral/:publicAddress
Endpoint Example:
// Request
PATCH http://localhost:3000/api/referral/0x123456789abcdef
// Request Body
{
"referral": "new_referral_code"
}
// Response (Status Code: 201 Created)
{
"publicAddress": "0x123456789abcdef",
// Updated user properties
}
Endpoint Description: Retrieve a list of all users.
Endpoint URL:
GET http://localhost:3000/api/users/getall
Endpoint Example:
// Request
GET http://localhost:3000/api/users/getall
// Response (Status Code: 200 OK)
[
{
// User 1 details
},
{
// User 2 details
},
// ...
]
Endpoint Description: Delete a user by their public address.
Endpoint URL:
DELETE http://localhost:3000/api/delete/:publicAddress
Endpoint Example:
// Request
DELETE http://localhost:3000/api/delete/0x123456789abcdef
// Response (Status Code: 200 OK)
{
"message": "User deleted successfully"
}
Endpoint Description: Delete all users in the database.
Endpoint URL:
DELETE http://localhost:3000/api/delete/all
Endpoint Example:
// Request
DELETE http://localhost:3000/api/delete/all
// Response (Status Code: 200 OK)
{
"message": "All users deleted successfully"
}
Endpoint Description: Update address1 and address2 for a user by their public address.
Endpoint URL:
PATCH http://localhost:3000/api/update-address/:publicAddress
Endpoint Example:
// Request
PATCH http://localhost:3000/api/update-address/0x123456789abcdef
// Request Body
{
"address1": "New Address 1",
"address2": "New Address 2"
}
// Response (Status Code: 200 OK)
{
"message": "Address updated successfully"
}
This file defines the routes for managing user data associated with user public addresses.
Endpoint Description: Create or update user data for a specific public address and dataDate.
Endpoint URL:
POST http://localhost:3000/api/user-data/:publicAddress
Endpoint Example:
// Request
POST http://localhost:3000/api/user-data/0x123456789abcdef
// Request Body
{
"dataDate": "2023-10-04",
"urlData": {
"urlLink": "https://example.com",
"timestamps": ["timestamp1", "timestamp2"]
}
}
// Response (Status Code: 200 OK)
{
"publicAddress": "0x123456789abcdef",
// Updated user data properties
}
Endpoint Description: Retrieve user data associated with a specific public address.
Endpoint URL:
GET http://localhost:3000/api/user-data/:publicAddress
Endpoint Example:
// Request
GET http://localhost:3000/api/user-data/0x123456789abcdef
// Response (Status Code: 200 OK)
[
{
"dataDate": "2023-10-04",
"urlData": [
{
"urlLink": "https://example.com",
"timestamps": ["timestamp1", "timestamp2"]
}
// Other URL data entries for the date
]
}
// Other user data entries for different dates
]
Endpoint Description: Delete all user data associated with a specific public address.
Endpoint URL:
DELETE http://localhost:3000/api/user-data/:publicAddress
Endpoint Example:
// Request
DELETE http://localhost:3000/api/user-data/0x123456789abcdef
// Response (Status Code: 200 OK)
{
"publicAddress": "0x123456789abcdef",
// Cleared user data properties
}
Endpoint Description: Retrieve user data for a specific dataDate associated with a public address.
Endpoint URL:
GET http://localhost:3000/api/user-data/specific/:publicAddress
Endpoint Example:
// Request
GET http://localhost:3000/api/user-data/specific/0x123456789abcdef
// Request Body
{
"date": "2023-10-04"
}
// Response (Status Code: 200 OK)
{
"dataDate": "2023-10-04",
"urlData": [
{
"urlLink": "https://example.com",
"timestamps": ["timestamp1", "timestamp2"]
}
// Other URL data entries for the date
]
}
Endpoint Description: Delete user data for a specific dataDate associated with a public address.
Endpoint URL:
DELETE http://localhost:3000/api/user-data/specific/:publicAddress
Endpoint Example:
// Request
DELETE http://localhost:3000/api/user-data/specific/0x123456789abcdef
// Request Body
{
"date": "2023-10-04"
}
// Response (Status Code: 200 OK)
{
"publicAddress": "0x123456789abcdef",
// Updated user data properties after data deletion
}
This file defines a single API endpoint to retrieve information about "Learn More" content.
Endpoint Description: Retrieve all "Learn More" content entries.
Endpoint URL:
GET http://localhost:3000/api/learnmore/getall
Endpoint Example:
// Request
GET http://localhost:3000/api/learnmore/getall
// Response (Status Code: 200 OK)
[
{
// Learn More content entry 1
},
{
// Learn More content entry 2
}
// Other Learn More content entries
]
This file defines API endpoints for managing KYC1 (Know Your Customer) data associated with user public addresses.
Endpoint Description: Update KYC1 details for a user by their public address.
Endpoint URL:
PATCH http://localhost:3000/api/kyc1/:publicAddress
Endpoint Example:
// Request
PATCH http://localhost:3000/api/kyc1/0x123456789abcdef
// Request Body
{
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "john@example.com",
"userName": "johndoe"
}
// Response (Status Code: 200 OK)
{
"publicAddress": "0x123456789abcdef",
// Updated user and KYC1 properties
}
Endpoint Description: Retrieve user details, including KYC1 data, for a specific public address.
Endpoint URL:
GET http://localhost:3000/api/kyc1/:publicAddress
Endpoint Example:
// Request
GET http://localhost:3000/api/kyc1/0x123456789abcdef
// Response (Status Code: 200 OK)
{
"publicAddress": "0x123456789abcdef",
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "john@example.com",
"kyc1": {
"status": true,
"verified": false,
"details": {
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "john@example.com",
"userName": "johndoe"
}
}
}
Endpoint Description: Retrieve users with KYC1 data submitted but not verified.
Endpoint URL:
GET http://localhost:3000/api/kyc1/getsubmitted
Endpoint Example:
// Request
GET http://localhost:3000/api/kyc1/getsubmitted
// Response (Status Code: 200 OK)
[
{
"publicAddress": "0x123456789abcdef",
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "john@example.com",
"kyc1": {
"status": true,
"verified": false,
"details": {
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "john@example.com",
"userName": "johndoe"
}
}
}
// Other users with submitted KYC1 data
]
Endpoint Description: Retrieve verified users with KYC1 data.
Endpoint URL:
GET http://localhost:3000/api/kyc1/getverified
Endpoint Example:
// Request
GET http://localhost:3000/api/kyc1/getverified
// Response (Status Code: 200 OK)
[
{
"publicAddress": "0x123456789abcdef",
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "john@example.com",
"kyc1": {
"status": true,
"verified": true,
"details": {
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "john@example.com",
"userName": "johndoe"
}
}
}
// Other verified users with KYC1 data
]
This file defines API endpoints for managing KYC2 (Know Your Customer - Part 2) data associated with user public addresses.
Endpoint Description: Update KYC2 details for a user by their public address.
Endpoint URL:
PATCH http://localhost:3000/api/kyc2/:publicAddress
Endpoint Example:
// Request
PATCH http://localhost:3000/api/kyc2/0x123456789abcdef
// Request Body
{
"gender": "Male",
"country": "United States",
"state": "California",
"city": "San Francisco",
"street": "123 Main St",
"doorno": "Apt 101",
"pincode": "94105",
"dob": "1990-01-01",
"annualIncome": 60000,
"permanentAddress": "456 Elm St, Apt 202, 94110"
}
// Response (Status Code: 200 OK)
{
"publicAddress": "0x123456789abcdef",
// Updated user and KYC2 properties
}
Endpoint Description: Retrieve user details, including KYC2 data, for a specific public address.
Endpoint URL:
GET http://localhost:3000/api/kyc2/:publicAddress
Endpoint Example:
// Request
GET http://localhost:3000/api/kyc2/0x123456789abcdef
// Response (Status Code: 200 OK)
{
"publicAddress": "0x123456789abcdef",
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "john@example.com",
"kyc2": {
"status": true,
"verified": false,
"details": {
"gender": "Male",
"country": "United States",
"state": "California",
"city": "San Francisco",
"street": "123 Main St",
"doorno": "Apt 101",
"pincode": "94105",
"dob": "1990-01-01",
"annualIncome": 60000,
"permanentAddress": "456 Elm St, Apt 202, 94110"
}
}
}
Endpoint Description: Retrieve users with KYC2 data submitted but not verified.
Endpoint URL:
GET http://localhost:3000/api/kyc2/getsubmitted
Endpoint Example:
// Request
GET http://localhost:3000/api/kyc2/getsubmitted
// Response (Status Code: 200 OK)
[
{
"publicAddress": "0x123456789abcdef",
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "john@example.com",
"kyc2": {
"status": true,
"verified": false,
"details": {
"gender": "Male",
"country": "United States",
"state": "California",
"city": "San Francisco",
"street": "123 Main St",
"doorno": "Apt 101",
"pincode": "94105",
"dob": "1990-01-01",
"annualIncome": 60000,
"permanentAddress": "456 Elm St, Apt 202, 94110"
}
}
}
// Other users with submitted KYC2 data
]
Endpoint Description: Retrieve verified users with KYC2 data.
Endpoint URL:
GET http://localhost:3000/api/kyc2/getverified
Endpoint Example:
// Request
GET http://localhost:3000/api/kyc2/getverified
// Response (Status Code: 200 OK)
[
{
"publicAddress": "0x123456789abcdef",
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "john@example.com",
"kyc2": {
"status": true,
"verified": true,
"details": {
"gender": "Male",
"country": "United States",
"state": "California",
"city": "San Francisco",
"street": "123 Main St",
"doorno": "Apt 101",
"pincode": "94105",
"dob": "1990-01-01",
"annualIncome": 60000,
"permanentAddress": "456 Elm St, Apt 202, 94110"
}
}
}
// Other verified users with KYC2 data
]
This file defines API endpoints for uploading, retrieving, and updating profile images associated with user public addresses. It utilizes the Multer middleware for handling file uploads and interactions with the server's file system.
Endpoint Description: Upload a profile image for a user by their public address.
Endpoint URL:
POST http://localhost:3000/api/profile-image/:publicAddress
Endpoint Example:
// Request
POST http://localhost:3000/api/profile-image/0x123456789abcdef
// Request Body (Form Data)
{
"image": (file) // Upload an image file (jpg, jpeg, or png)
}
// Response (Status Code: 200 OK)
{
"message": "Profile picture uploaded successfully",
"data": {
"imageUrl": "http://localhost:3000/uploads/profile/0x123456789abcdef.jpg"
}
}
Endpoint Description: Retrieve the user's profile image by their public address.
Endpoint URL:
GET http://localhost:3000/api/profile-image/:publicAddress
Endpoint Example:
// Request
GET http://localhost:3000/api/profile-image/0x123456789abcdef
// Response (Status Code: 200 OK)
// Image binary data
Endpoint Description: Update the user's profile image by their public address.
Endpoint URL:
PATCH http://localhost:3000/api/profile-image/:publicAddress
Endpoint Example:
// Request
PATCH http://localhost:3000/api/profile-image/0x123456789abcdef
// Request Body (Form Data)
{
"image": (file) // Upload a new image file (jpg, jpeg, or png)
}
// Response (Status Code: 200 OK)
{
"message": "Profile picture updated successfully",
"data": {
"imageUrl": "http://localhost:3000/uploads/profile/0x123456789abcdef.jpg"
}
}
This file defines an API endpoint to retrieve a list of help-related information. It allows clients to fetch all available help resources.
Endpoint Description: Retrieve all available help resources.
Endpoint URL:
GET http://localhost:3000/api/help/getall
Endpoint Example:
// Request
GET http://localhost:3000/api/help/getall
// Response (Status Code: 200 OK)
[
{
// Help resource 1 details
},
{
// Help resource 2 details
},
// ...more help resources
]
This file defines an API endpoint to retrieve a list of frequently asked questions (FAQs). It allows clients to fetch all available FAQs.
Endpoint Description: Retrieve all available frequently asked questions (FAQs).
Endpoint URL:
GET http://localhost:3000/api/faq/getall
Endpoint Example:
// Request
GET http://localhost:3000/api/faq/getall
// Response (Status Code: 200 OK)
[
{
// FAQ 1 details
},
{
// FAQ 2 details
},
// ...more FAQs
]
This file defines an API endpoint to handle the uploading of address proof images. It allows clients to submit multiple images as address proof for a specific user.
Endpoint Description: Upload address proof images for a user.
Endpoint URL:
POST http://localhost:3000/api/address-proof/:publicAddress
Endpoint Example:
// Request
POST http://localhost:3000/api/address-proof/user123
// Request Body (Form Data)
{
images: [File1, File2] // Multiple image files
}
// Response (Status Code: 200 OK)
{
message: 'Images uploaded successfully',
data: [
'http://localhost:3000/uploads/address/user123-0.jpg',
'http://localhost:3000/uploads/address/user123-1.jpg'
]
}
Notes:
- This endpoint expects a
multipart/form-data
request with the field nameimages
containing one or more image files (e.g., JPG, JPEG, PNG). - It saves the uploaded images and generates unique URLs for each uploaded image.
- The images are associated with a specific user identified by
publicAddress
.