How dionnieteh/dockit works
Project type and purpose
• This is a full-stack, monolithic web application built on Next.js (App Router).
• It implements a user dashboard for managing “docking” jobs (preparing ligands/receptors for computational docking), with authentication, user/admin roles, job submission/history, parameter configuration, and file download.
• It uses Prisma (with migrations) for database access and Supabase for authentication/storage, and embeds two Python scripts for preprocessing (prepare_ligand4.py, prepare_receptor4.py).
File structure
• Top-level config: Dockerfile, docker-compose.yml, Prisma schema/migrations, Supabase client/server code, Tailwind & ESLint configs.
• src/app: UI routes (page.tsx under /login, /signup, /docking, /history, /admin, etc.).
• src/app/api: Next.js API Route handlers (serverless endpoints) under /admin/*, /login, /register, /job, /dock, /download, /forgot-password, etc.
• src/components: React UI components (dashboard shell, nav, forms, table, toasts, theme provider) and a large reusable UI-kit under components/ui.
• src/lib: Business logic modules (job-status, users, receptors, parameters, Supabase clients, Prisma client, utils, toast-messages, user context/role hooks).
• src/scripts: Python scripts for ligand/receptor preparation.
• prisma: DB schema.prisma, migrations, seed.js.
Readme insights
• Standard Next.js deploy on Vercel using App Router.
• Dependencies: Next.js, Prisma, Tailwind CSS, Supabase, Python for scripts.
Main components and their relationships
a. Frontend (Browser)
• React UI (pages in src/app)
• UI components (src/components/*, CSS, assets)
b. API Layer (Next.js Server)
• Next.js App Router & Middleware (middleware.ts)
• API Routes (src/app/api/**)
• Business logic modules (src/lib/**)
c. Database
• PostgreSQL (or similar) via Prisma ORM
• Migrations/seed under prisma/
d. Authentication & Storage
• Supabase (auth, possibly file storage) via supabase-client & supabase-server modules
e. Background Processing
• Python scripts invoked by the backend for task preparation
• Could be executed synchronously or via a job queue (depending on implementation)
f. External Services
• Vercel (hosting), Docker containers (local development), optional object storage if used
Architectural patterns & principles
• Monolithic layered architecture: separation of concerns between UI, API, data access.
• React component hierarchy with a shared UI-kit.
• “API Routes as micro-endpoints”: each resource under src/app/api has its own route.ts.
• Prisma as single source of truth for DB schema, migrations, queries.
• Supabase for user sessions and possibly real-time or storage.
• Python scripts encapsulated separately (could be a worker component).
Elements
• Clear labels (e.g., “Authentication Service (Supabase)”, “Prisma ORM → PostgreSQL”).
• Arrowheads showing request/response directions.