implement backend skeleton with MongoDB and Claude AI integration
- Add controllers (Auth, Chat, Event) with placeholder implementations - Add services (Auth, Chat, Event) with business logic interfaces - Add repositories with MongoDB/Mongoose models (User, Event, Chat) - Add middleware for JWT authentication - Add Claude AI adapter implementing AIProvider interface - Add utility modules for JWT and password handling - Add shared types and DTOs for User, CalendarEvent, ChatMessage - Configure routes with proper endpoint structure - Update app.ts with dependency injection setup - Add required dependencies: mongoose, bcrypt, jsonwebtoken, @anthropic-ai/sdk
This commit is contained in:
2
apps/server/src/utils/index.ts
Normal file
2
apps/server/src/utils/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './jwt';
|
||||
export * from './password';
|
||||
26
apps/server/src/utils/jwt.ts
Normal file
26
apps/server/src/utils/jwt.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import jwt from 'jsonwebtoken';
|
||||
|
||||
export interface TokenPayload {
|
||||
userId: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export interface JWTConfig {
|
||||
secret: string;
|
||||
expiresIn: string;
|
||||
}
|
||||
|
||||
const JWT_SECRET = process.env.JWT_SECRET || 'your-secret-key';
|
||||
const JWT_EXPIRES_IN = process.env.JWT_EXPIRES_IN || '1h';
|
||||
|
||||
export function signToken(payload: TokenPayload): string {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
|
||||
export function verifyToken(token: string): TokenPayload {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
|
||||
export function decodeToken(token: string): TokenPayload | null {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
11
apps/server/src/utils/password.ts
Normal file
11
apps/server/src/utils/password.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import bcrypt from 'bcrypt';
|
||||
|
||||
const SALT_ROUNDS = 10;
|
||||
|
||||
export async function hash(password: string): Promise<string> {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
|
||||
export async function compare(password: string, hash: string): Promise<boolean> {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
Reference in New Issue
Block a user