chore: initial checkpoint - Tesla Roadtrip planner
- Proactive Grok integration (xAI API + local CLI fallback) - Real road routing via OSRM (no more bird's-eye lines) - Heavy structured logging for fast iteration - Strong sanitization + geocoding + ErrorBoundary (no black screens) - Playwright E2E tests (API diagnostic + full UI flow) - scripts/dev.sh for one-command startup - Clean .env.example + documentation This is a stable checkpoint before further prompt/UI refinement.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import 'dotenv/config';
|
||||
import express from 'express';
|
||||
import cors from 'cors';
|
||||
import helmet from 'helmet';
|
||||
import cookieParser from 'cookie-parser';
|
||||
import { env } from './config/env.js';
|
||||
import { logger } from './lib/logger.js';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(helmet({ contentSecurityPolicy: false }));
|
||||
app.use(cors({ origin: env.appUrl, credentials: true }));
|
||||
app.use(express.json({ limit: '2mb' }));
|
||||
app.use(cookieParser());
|
||||
|
||||
app.use((req, _res, next) => {
|
||||
if (req.url !== '/health') logger.info({ method: req.method, url: req.url }, 'request');
|
||||
next();
|
||||
});
|
||||
|
||||
app.get('/health', (_req, res) => {
|
||||
res.json({ status: 'ok', service: 'tesla-roadtrip', time: new Date().toISOString() });
|
||||
});
|
||||
|
||||
// TODO: Mount auth middleware + routes here once client is registered
|
||||
// TODO: Mount /api/trips and chat routes
|
||||
|
||||
app.listen(env.port, () => {
|
||||
logger.info(`Tesla Roadtrip server running on port ${env.port}`);
|
||||
});
|
||||
|
||||
// Chat routes (real Grok integration)
|
||||
import chatRoutes from './routes/chat.js';
|
||||
app.use('/api', chatRoutes);
|
||||
Reference in New Issue
Block a user