feat: v1.1 - random re-roll, shopping summary, offline PWA, auth prep, profile page

This commit is contained in:
clawd
2026-02-18 10:32:12 +00:00
parent de567f93db
commit c222c880a3
13 changed files with 290 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ import { tagRoutes } from './routes/tags.js';
import { imageRoutes } from './routes/images.js';
import { botRoutes } from './routes/bot.js';
import { ogScrapeRoutes } from './routes/og-scrape.js';
import { authRoutes } from './routes/auth.js';
export async function buildApp() {
const app = Fastify({ logger: true });
@@ -43,5 +44,8 @@ export async function buildApp() {
await app.register(ogScrapeRoutes);
await app.after();
await app.register(authRoutes);
await app.after();
return app;
}

View File

@@ -0,0 +1,7 @@
import type { FastifyRequest, FastifyReply } from 'fastify';
// v2: Auth middleware — currently passes through everything
export async function authMiddleware(request: FastifyRequest, _reply: FastifyReply) {
// TODO v2: Verify JWT token, set request.user
(request as any).user = { id: 'default', name: 'Luna' };
}

View File

@@ -0,0 +1,15 @@
import type { FastifyInstance } from 'fastify';
export async function authRoutes(app: FastifyInstance) {
app.post('/api/auth/login', async (_request, reply) => {
reply.status(501).send({ error: 'not implemented' });
});
app.post('/api/auth/register', async (_request, reply) => {
reply.status(501).send({ error: 'not implemented' });
});
app.get('/api/auth/me', async (_request, reply) => {
reply.status(501).send({ error: 'not implemented' });
});
}