Add backend API for personal finance management application
- Introduced a comprehensive backend API using TypeScript, Fastify, and PostgreSQL. - Added essential files including architecture documentation, environment configuration, and Docker setup. - Implemented RESTful routes for managing assets, liabilities, clients, invoices, and cashflow. - Established a robust database schema with Prisma for data management. - Integrated middleware for authentication and error handling. - Created service and repository layers to adhere to SOLID principles and clean architecture. - Included example environment variables for development, staging, and production setups.
This commit is contained in:
17
backend-api/src/controllers/DashboardController.ts
Normal file
17
backend-api/src/controllers/DashboardController.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import {FastifyRequest, FastifyReply} from 'fastify';
|
||||
import {DashboardService} from '../services/DashboardService';
|
||||
import {getUserId} from '../middleware/auth';
|
||||
|
||||
/**
|
||||
* Controller for Dashboard endpoints
|
||||
*/
|
||||
export class DashboardController {
|
||||
constructor(private dashboardService: DashboardService) {}
|
||||
|
||||
async getSummary(request: FastifyRequest, reply: FastifyReply) {
|
||||
const userId = getUserId(request);
|
||||
const summary = await this.dashboardService.getSummary(userId);
|
||||
|
||||
return reply.send(summary);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user