A comprehensive Facebook Page Management Platform built with SvelteKit 5 and PostgreSQL that provides automated comment monitoring, intelligent AI-powered response generation, and advanced inbox management.
npm install
Copy the example environment file and configure your settings:
cp .env.example .env
Edit .env with your configuration:
DATABASE_URL - PostgreSQL connection stringJWT_SECRET - Secret key for JWT tokensENCRYPTION_KEY - 32+ character key for encrypting sensitive dataFACEBOOK_APP_ID - Your Facebook App IDFACEBOOK_APP_SECRET - Your Facebook App SecretOPENAI_API_KEY - Your OpenAI API keydocker-compose up -d
This starts:
npm run db:push
Or generate and run migrations:
npm run db:generate
npm run db:migrate
npm run dev
| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run check |
Type-check the codebase |
npm run test |
Run tests |
npm run test:watch |
Run tests in watch mode |
npm run db:generate |
Generate database migrations |
npm run db:migrate |
Run database migrations |
npm run db:push |
Push schema changes directly |
npm run db:studio |
Open Drizzle Studio |
├── src/
│ ├── lib/
│ │ └── server/
│ │ ├── db/
│ │ │ ├── index.ts # Database connection
│ │ │ └── schema.ts # Drizzle schema definitions
│ │ └── config.ts # Configuration management
│ └── routes/ # SvelteKit routes
├── tests/
│ ├── unit/ # Unit tests
│ ├── property/ # Property-based tests
│ └── integration/ # Integration tests
├── drizzle/ # Database migrations
├── docker-compose.yml # Docker services
└── drizzle.config.ts # Drizzle configuration
The platform uses the following main tables:
users - User accounts and authenticationpage_tokens - Facebook page access tokens (encrypted)keyword_patterns - Keyword monitoring patternsresponse_templates - Automated response templatesresponse_logs - Response activity logsconversations - Message conversationsmessages - Individual messagespost_configurations - Per-post monitoring settingspage_settings - Page-level configurationaudit_logs - Security audit trailPrivate - All rights reserved