Skip to content

Commit 837446d

Browse files
authored
feat: add ereputation (#343)
* feat: add erep * fix: add readme * fix: platform path
1 parent c2d9bcd commit 837446d

Some content is hidden

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

93 files changed

+21334
-0
lines changed

platforms/eReputation/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
.DS_Store
4+
server/public
5+
vite.config.ts.*
6+
*.tar.gz

platforms/eReputation/README.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# eReputation - Professional Reputation Management Platform
2+
3+
## Overview
4+
5+
eReputation is a full-stack web application for professional reputation analysis and management. The platform allows users to calculate reputation scores for themselves and others (users, groups, platforms) using AI-powered analysis. It features a modern React frontend with shadcn/ui components and an Express.js backend with PostgreSQL database integration.
6+
7+
## Recent Changes (August 11, 2025)
8+
9+
### Production-Ready Email/Password Authentication System Completed
10+
- Successfully replaced Replit auth with comprehensive email/password authentication
11+
- Implemented bcrypt password hashing for secure credential storage
12+
- Created session-based authentication with PostgreSQL session store
13+
- Built QR code-style authentication interface with eReputation branding
14+
- Updated all API routes and middleware to use new requireAuth system
15+
- Created TypeORM User entity with email, password, firstName, lastName fields
16+
- Cleaned authentication page design with W3DS branding and MetaState messaging
17+
18+
### Database Migration to TypeORM Completed
19+
- Successfully migrated from Drizzle ORM to TypeORM with PostgreSQL
20+
- Created comprehensive TypeORM entities preserving all existing schema relationships
21+
- Implemented automatic database schema creation and initialization
22+
- Maintained backward compatibility through schema re-exports
23+
- Database migration infrastructure ready for seamless data preservation
24+
25+
### AI Functionality Removed - Simple Digital Signatures Added
26+
- Removed all AI/OpenAI functionality from reference creation and reputation calculation
27+
- Implemented simple digital signature system for references using basic cryptographic hashing
28+
- References now include digital signature and timestamp for authenticity verification
29+
- Reputation calculations use simplified random scoring instead of AI analysis
30+
- System ready for future replacement with more sophisticated signature libraries
31+
32+
### Unified Reference View Modal System Completed
33+
- Created shared ReferenceViewModal component for consistent modal behavior across all pages
34+
- Fixed dashboard reference view to display actual reference content from database instead of mock data
35+
- Both dashboard and references pages now use identical modal component for viewing references
36+
- Updated activity handler to access full reference data from activity.data property
37+
- Eliminated duplicate modal code and ensured consistent user experience
38+
- Mobile-first responsive design maintained across all reference viewing interfaces
39+
- Maintained separate modal systems: ReferenceViewModal for references, Activity Details modal for eReputation calculations
40+
41+
### Landing Page Redesign Completed
42+
- Implemented clean gradient background (fig/30 to fig/10, bottom to top)
43+
- Removed blur effects behind logo for cleaner appearance
44+
- Updated modal background to fig-10 for consistency
45+
- Applied branded fig background icons with swiss-cheese gold text throughout
46+
- Updated feature text to "Calculate", "Reference", "Share" with proper spacing
47+
- Optimized icon spacing for desktop viewing (gap-8, justify-center)
48+
49+
## User Preferences
50+
51+
Preferred communication style: Simple, everyday language.
52+
53+
## System Architecture
54+
55+
### Frontend Architecture
56+
- **Framework**: React 18 with TypeScript
57+
- **Build Tool**: Vite for fast development and optimized builds
58+
- **UI Library**: shadcn/ui components built on Radix UI primitives
59+
- **Styling**: Tailwind CSS with custom design tokens and CSS variables
60+
- **State Management**: TanStack Query (React Query) for server state
61+
- **Routing**: Wouter for lightweight client-side routing
62+
- **Form Handling**: React Hook Form with Zod validation
63+
64+
### Backend Architecture
65+
- **Runtime**: Node.js with Express.js framework
66+
- **Language**: TypeScript with ES modules
67+
- **Database**: PostgreSQL with Neon serverless driver
68+
- **ORM**: TypeORM for entity-based database operations
69+
- **Authentication**: Email/password authentication with bcrypt hashing
70+
- **Session Management**: Express sessions with PostgreSQL storage
71+
- **File Uploads**: Multer for handling file attachments
72+
73+
## Key Components
74+
75+
### Authentication System
76+
- **Provider**: Email/password authentication with bcrypt
77+
- **Session Storage**: PostgreSQL-backed sessions with connect-pg-simple
78+
- **Security**: HTTP-only secure cookies with session-based authentication
79+
- **User Management**: Registration and login with secure password hashing
80+
- **Interface**: QR code-style login page with eReputation and W3DS branding
81+
82+
### Reputation Analysis Engine
83+
- **AI Integration**: OpenAI GPT-4o for reputation analysis
84+
- **Analysis Types**: Self-assessment, user evaluation, group/platform analysis
85+
- **Variables**: Configurable analysis parameters (comment history, references, qualifications, etc.)
86+
- **Scoring**: 1-10 reputation score with confidence metrics
87+
88+
### Database Schema
89+
- **Users**: Profile information and authentication data
90+
- **Reputation Calculations**: Analysis results with scores and confidence
91+
- **References**: Professional endorsements and testimonials
92+
- **File Uploads**: Document attachments for evidence
93+
- **Sessions**: Authentication session storage
94+
95+
### File Management
96+
- **Upload Handling**: Multer-based file processing
97+
- **File Types**: Images (JPEG, PNG, GIF) and documents (PDF, DOC, DOCX)
98+
- **Size Limits**: 10MB maximum file size
99+
- **Storage**: Local filesystem storage with configurable paths
100+
101+
## Data Flow
102+
103+
1. **Authentication Flow**:
104+
- User initiates login via Replit Auth
105+
- OIDC provider validates credentials
106+
- Session created and stored in PostgreSQL
107+
- User profile created/updated in database
108+
109+
2. **Reputation Calculation Flow**:
110+
- User selects analysis type and variables
111+
- Backend creates calculation record with "processing" status
112+
- OpenAI API analyzes based on selected parameters
113+
- Results stored with score, confidence, and detailed analysis
114+
- Frontend updates to show completed analysis
115+
116+
3. **Reference Management Flow**:
117+
- Users can create references for others
118+
- File uploads supported for evidence
119+
- References linked to target users/groups/platforms
120+
- Analysis engine can incorporate reference data
121+
122+
## External Dependencies
123+
124+
### Core Infrastructure
125+
- **Database**: Neon PostgreSQL for serverless database hosting
126+
- **Authentication**: Replit Auth service for OIDC authentication
127+
- **AI Processing**: OpenAI API for reputation analysis
128+
129+
### Development Tools
130+
- **Package Manager**: npm with lockfile version 3
131+
- **TypeScript**: Type checking and compilation
132+
- **ESBuild**: Production bundling for server code
133+
- **Drizzle Kit**: Database migrations and schema management
134+
135+
### UI/UX Libraries
136+
- **Radix UI**: Accessible component primitives
137+
- **Tailwind CSS**: Utility-first styling framework
138+
- **Lucide React**: Icon library
139+
- **React Hook Form**: Form state management
140+
- **Zod**: Runtime type validation
141+
142+
## Deployment Strategy
143+
144+
### Development Environment
145+
- **Dev Server**: Vite dev server with HMR for frontend
146+
- **Backend**: tsx for TypeScript execution with hot reload
147+
- **Database**: Drizzle push for schema synchronization
148+
- **Environment**: NODE_ENV=development with debug logging
149+
150+
### Production Build
151+
- **Frontend**: Vite build to dist/public directory
152+
- **Backend**: ESBuild bundle to dist/index.js
153+
- **Static Serving**: Express serves built frontend assets
154+
- **Process**: Single Node.js process serving both frontend and API
155+
156+
### Environment Configuration
157+
- **Database**: DATABASE_URL for PostgreSQL connection
158+
- **Auth**: REPL_ID, SESSION_SECRET, ISSUER_URL for authentication
159+
- **AI**: OPENAI_API_KEY for reputation analysis
160+
- **Domains**: REPLIT_DOMAINS for CORS and auth configuration
161+
162+
### File Structure
163+
```
164+
├── client/ # React frontend application
165+
├── server/ # Express.js backend API
166+
├── shared/ # Shared TypeScript types and schemas
167+
├── dist/ # Production build output
168+
├── uploads/ # File upload storage
169+
└── migrations/ # Database migration files
170+
```
171+
172+
The application follows a monorepo structure with clear separation between frontend, backend, and shared code, making it easy to maintain and scale both components independently while sharing common types and utilities.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1" />
6+
</head>
7+
<body>
8+
<div id="root"></div>
9+
<script type="module" src="/src/main.tsx"></script>
10+
<!-- This is a replit script which adds a banner on the top of the page when opened in development mode outside the replit environment -->
11+
<script type="text/javascript" src="https://replit.com/public/js/replit-dev-banner.js"></script>
12+
</body>
13+
</html>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Switch, Route } from "wouter";
2+
import { queryClient } from "./lib/queryClient";
3+
import { QueryClientProvider } from "@tanstack/react-query";
4+
import { Toaster } from "@/components/ui/toaster";
5+
import { TooltipProvider } from "@/components/ui/tooltip";
6+
import { useAuth } from "@/hooks/useAuth";
7+
import AuthPage from "@/pages/auth-page";
8+
import Dashboard from "@/pages/dashboard";
9+
import References from "@/pages/references";
10+
import NotFound from "@/pages/not-found";
11+
12+
function Router() {
13+
const { isAuthenticated, isLoading } = useAuth();
14+
15+
// Show auth page if loading or not authenticated
16+
if (isLoading || !isAuthenticated) {
17+
return <AuthPage />;
18+
}
19+
20+
return (
21+
<Switch>
22+
<Route path="/" component={Dashboard} />
23+
<Route path="/references" component={References} />
24+
<Route component={NotFound} />
25+
</Switch>
26+
);
27+
}
28+
29+
function App() {
30+
return (
31+
<QueryClientProvider client={queryClient}>
32+
<TooltipProvider>
33+
<Toaster />
34+
<Router />
35+
</TooltipProvider>
36+
</QueryClientProvider>
37+
);
38+
}
39+
40+
export default App;

0 commit comments

Comments
 (0)