How sami-sial/subscription-based-file-management works
File Cloud Drive is a subscription-based storage SaaS: users authenticate, choose plans, then manage files and folders subject to plan limits; administrators manage plans and monitor usage. The backend exposes separate authentication, user, admin, and Stripe routes, with controllers enforcing domain rules through Prisma. The README documents Stripe checkout/webhooks and native mobile shells; sampled excerpts do not show all frontend API calls or Stripe controller internals, so those relationships are shown only where documented or explicit.
Main entry points: index.js Express API · user.routes.js User routes · auth.routes.js Auth routes · admin.routes.js Admin routes
Components 24
Identity
- Auth screens
client/src/app/(auth) - Auth routes
backend/routes/auth.routes.js - Auth workflows
backend/controllers/auth.controllers.js - JWT access guard
backend/middlewares/auth.middleware.js - Email delivery
backend/lib/mailer.js
Subscriptions
- Plan screens
client/src/app/(dashboard)/user/subscriptions/page.jsx - Payment screens
client/src/app/(dashboard)/user/payment-success/page.jsx - Stripe routes
backend/routes/stripe.routes.js - Stripe workflows
backend/controllers/stripe.cotrollers.js
File storage
- User dashboard
client/src/app/(dashboard)/user - Drive manager
client/src/app/(dashboard)/user/drive/FileManager.jsx - User routes
backend/routes/user.routes.js - User workflows
backend/controllers/user.controllers.js - Cloudinary storage
backend/config/cloudinary.config.js
Administration
- Admin console
client/src/app/(dashboard)/admin - Admin routes
backend/routes/admin.routes.js - Admin workflows
backend/controllers/admin.controllers.js
Application platform
- Next.js client
client/src/app/layout.js - Native shells
mobile - Express API
backend/index.js - PostgreSQL data
backend/lib/prisma.js
Other components
- Storage user
- Administrator
- Stripe payments
Connections 27
- Storage user → Next.js client: uses
- Administrator → Next.js client: uses
- Native shells → Next.js client: bundles
- Next.js client → Express API: API requests
- Express API → Auth routes: mounts
- Express API → User routes: mounts
- Express API → Admin routes: mounts
- Express API → Stripe routes: mounts
- Auth screens → Auth routes: auth requests
- Auth routes → Auth workflows: dispatches
- Auth workflows → PostgreSQL data: reads/writes
- Auth workflows → Email delivery: sends email
- Auth routes → JWT access guard: guards
- User dashboard → User routes: user requests
- Drive manager → User routes: file actions
- User routes → User workflows: dispatches
- User workflows → PostgreSQL data: reads/writes
- Drive manager → Cloudinary storage: uploads files
- Plan screens → User routes: plan requests
- Payment screens → Stripe routes: payment requests
- Stripe routes → Stripe workflows: dispatches
- Stripe workflows → Stripe payments: checkout/webhooks
- Stripe workflows → PostgreSQL data: updates subscriptions
- Admin console → Admin routes: admin requests
- Admin routes → Admin workflows: dispatches
- Admin workflows → PostgreSQL data: reads/writes
- Admin routes → JWT access guard: guards