How ghanamaahmed/linktree_backend works
Project type and purpose
• This is the linktree-backend service, a monolithic REST API built with Node.js, TypeScript, Express, and Prisma.
• Its purpose is to power a Linktree-style application: it handles user authentication, link and QR-code management, templates, themes, and analytics, persisting data to a relational database via Prisma.
File structure
• Top-level: configuration and deployment files (Dockerfile, docker-compose.yml, .env.production).
• prisma/: schema.prisma and seed.ts define your database model and initial data.
• src/:
• app.ts – boots the Express server and wires up middleware and routes.
• config/config.ts – environment and runtime configuration.
• controllers/ – business-logic handlers for each resource (users, links, analytics, etc.).
• routes/ – Express routers mapping HTTP endpoints to controllers.
• middlewares/ – global error handler and JWT/NextAuth guard.
• lib/ – utility modules: Prisma client instantiation, mailing, auth helpers, generic utils.
• types/ – custom Express type extensions.
• tests/: Jest unit and integration tests for each controller.
README for additional insights
• This service is one half of a full-stack application (the other half is a Next.js frontend “lynku”).
• It’s packaged for local development, Docker deployment (Heroku, AWS, Railway), and includes Prisma migrations and seed capabilities.