This PR revamps the landing page with interactive visuals and streamlined styling, refactors the client dashboard for async API interactions, introduces full MongoDB integration via Mongoose (with Client and Admin models, connection logic, and REST endpoints), and updates project configuration and dependencies for seamless development and deployment.
sequenceDiagram
actor User
participant Browser
participant Server
participant MongoDB
User->>Browser: Fill credentials/upload/config forms
Browser->>Server: POST /client/:id/credentials
Server->>MongoDB: Save credentials
MongoDB-->>Server: Success/Error
Server-->>Browser: JSON response
Browser->>Server: POST /client/:id/upload
Server->>MongoDB: Save file info
MongoDB-->>Server: Success/Error
Server-->>Browser: JSON response
Browser->>Server: POST /client/:id/config
Server->>MongoDB: Save campaign config
MongoDB-->>Server: Success/Error
Server-->>Browser: JSON response
erDiagram
CLIENT {
string clientId PK "Unique client identifier"
string name
string email
string status
string plan
date createdAt
date updatedAt
date lastLogin
}
CLIENT_CREDENTIALS {
string platform
string username
string password
boolean isActive
date lastTested
string connectionStatus
}
CLIENT_CAMPAIGNS {
string name
string automationType
string instructions
string status
date createdAt
date lastRun
}
CLIENT_UPLOADED_FILES {
string fileName
string originalName
number fileSize
string fileType
date uploadDate
number processedRows
number validRows
string status
}
CLIENT_ACTIVITY_LOGS {
string type
string message
string details
date timestamp
}
ADMIN {
string username PK
string email
string password
string role
boolean isActive
date lastLogin
number loginAttempts
date lockUntil
date createdAt
date updatedAt
}
ADMIN_ACTIVITY_LOGS {
string action
string targetType
string targetId
string details
string ipAddress
date timestamp
}
CLIENT ||--o{ CLIENT_CREDENTIALS : has
CLIENT ||--o{ CLIENT_CAMPAIGNS : has
CLIENT ||--o{ CLIENT_UPLOADED_FILES : has
CLIENT ||--o{ CLIENT_ACTIVITY_LOGS : has
ADMIN ||--o{ ADMIN_ACTIVITY_LOGS : has
classDiagram
class Client {
+String clientId
+String name
+String email
+[Credential] credentials
+[Campaign] campaigns
+[UploadedFile] uploadedFiles
+[ActivityLog] activityLogs
+String status
+String plan
+Date createdAt
+Date updatedAt
+Date lastLogin
+addActivityLog(type, message, details)
+static findByClientId(clientId)
}
class Credential {
+String platform
+String username
+String password
+Boolean isActive
+Date lastTested
+String connectionStatus
}
class Campaign {
+String name
+String automationType
+String instructions
+String status
+Date createdAt
+Date lastRun
}
class UploadedFile {
+String fileName
+String originalName
+Number fileSize
+String fileType
+Date uploadDate
+Number processedRows
+Number validRows
+String status
}
class ActivityLog {
+String type
+String message
+String details
+Date timestamp
}
class Admin {
+String username
+String email
+String password
+String role
+[String] permissions
+Boolean isActive
+Date lastLogin
+Number loginAttempts
+Date lockUntil
+[AdminActivityLog] activityLogs
+comparePassword(candidatePassword)
+incLoginAttempts()
+resetLoginAttempts()
+addActivityLog(action, targetType, targetId, details, ipAddress)
+static findByUsername(username)
+static findByEmail(email)
}
class AdminActivityLog {
+String action
+String targetType
+String targetId
+String details
+String ipAddress
+Date timestamp
}
Client "1" o-- "many" Credential
Client "1" o-- "many" Campaign
Client "1" o-- "many" UploadedFile
Client "1" o-- "many" ActivityLog
Admin "1" o-- "many" AdminActivityLog
| Change | Details | Files |
|---|---|---|
| Enhanced landing page with interactive visuals and new sections |
|
public/css/style.cssviews/home.ejspublic/js/landing-page.js |
| Refactored client dashboard scripts and templates for async API calls |
|
public/js/client-dashboard.jsviews/layouts/client-layout.ejsviews/partials/header.ejsviews/client/dashboard.ejspublic/css/client-dashboard.css |
| Integrated MongoDB with Mongoose models and REST API routes |
|
config/database.jsmodels/Client.jsmodels/Admin.jsroutes/client.jsscripts/initDatabase.jsMONGODB_SETUP.md |
| Updated project configuration with new dependencies and startup scripts |
|
package.jsonserver.js |
Tips and commands
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.