# DevStack — Full AI & Cursor Reference Website: https://devstack.thecodebrains.com Developed by Digi Ritual. Use this document as a reference in Cursor (`@Docs`), ChatGPT, Claude, or Perplexity to scaffold clean, production-ready applications following universal folder structures and shadcn/ui best practices. --- ## 1. React (Frontend — Library) ### Universal Folder Structure ```text src/ ├── pages/ # Route pages (Home, Login, Dashboard) ├── components/ │ ├── ui/ # Pure shadcn/ui components (Button, Input, Dialog) │ └── shared/ # Common layout components (Navbar, Footer, Sidebar) ├── features/ # Core feature modules (Each feature gets its own folder) │ ├── auth/ │ │ ├── components/ # LoginForm, SignupCard │ │ ├── hooks/ # useAuth │ │ └── api.ts # Auth-related API calls │ └── products/ ├── hooks/ # Global custom hooks (useDebounce, useLocalStorage) ├── lib/ # Third-party configs (axios.ts, utils.ts) ├── store/ # Global state (Zustand / Redux) ├── types/ # Global TypeScript interfaces ├── App.tsx # Root router and providers └── main.tsx # React entry point ``` ### React Landing Page Structure (with shadcn/ui) ```text src/ ├── components/ │ ├── ui/ # shadcn/ui components (Button, Card, Badge, Accordion, Sheet) │ └── shared/ │ ├── navbar.tsx # Logo, nav links, CTA button & mobile Sheet menu │ └── footer.tsx # Links, social icons & copyright ├── features/ │ └── landing/ │ ├── components/ │ │ ├── hero.tsx # Headline, subtitle, primary/secondary CTA & visual │ │ ├── logo-strip.tsx # Trusted-by brands / social proof │ │ ├── features.tsx # 3-column bento / shadcn Card feature grid │ │ ├── pricing.tsx # Monthly/Yearly Tabs + Pricing Cards │ │ ├── testimonials.tsx # User reviews grid │ │ ├── faq.tsx # shadcn Accordion FAQ section │ │ └── cta-banner.tsx # Final conversion banner │ └── data.ts # All copy, features, pricing & FAQ data └── pages/ └── landing-page.tsx # Assembles all sections in clean order ``` ### Cursor Prompt (React + shadcn/ui Landing Page) > Build a modern, production-ready Landing Page using React (Vite), TypeScript, Tailwind CSS, and shadcn/ui. Follow `src/components/ui/` for official shadcn components, `src/components/shared/` for Navbar & Footer, `src/features/landing/components/` for Hero, LogoStrip, Features, Pricing, Testimonials, FAQ, and CtaBanner, `src/features/landing/data.ts` for typed data, and `src/pages/landing-page.tsx` to compose sections. Default theme: clean white light mode with working dark mode toggle. --- ## 2. Next.js (Fullstack — Framework) ### Universal Folder Structure ```text src/ ├── app/ # Routing and pages only (Next.js App Router) │ ├── (auth)/ # Route groups (login, register) │ ├── dashboard/ │ └── layout.tsx ├── components/ │ ├── ui/ # Pure shadcn/ui components (Button, Input, Dialog) │ └── shared/ # Common layout components (Navbar, Footer, Sidebar) ├── features/ # Core feature modules (Each feature gets its own folder) │ ├── auth/ │ │ ├── components/ # LoginForm, SignupCard │ │ ├── hooks/ # useAuth │ │ └── api.ts # Auth-related API calls │ └── products/ ├── hooks/ # Global custom hooks (useDebounce, useLocalStorage) ├── lib/ # Third-party configs (axios.ts, utils.ts, prisma.ts) ├── store/ # Global state (Zustand / Redux) └── types/ # Global TypeScript interfaces ``` ### Next.js Landing Page Structure (App Router + shadcn/ui) ```text src/ ├── app/ │ ├── (marketing)/ # Public landing route group (keeps root URL '/') │ │ ├── layout.tsx # Navbar + Footer wrapper │ │ ├── page.tsx # Main Landing Page (Server Component, SEO ready) │ │ └── pricing/page.tsx # Dedicated pricing page (optional) │ ├── (auth)/ # Login & Register route group │ ├── layout.tsx # Root HTML, fonts, ThemeProvider & Metadata │ └── globals.css # Tailwind v4 + shadcn theme variables ├── components/ │ ├── ui/ # shadcn/ui (Button, Card, Badge, Accordion, Sheet) │ └── shared/ # Navbar, Footer, ThemeToggle └── features/ └── landing/ ├── components/ # Hero, Features, Pricing, Testimonials, FAQ, CTA └── data.ts # Static content & metadata config ``` ### Cursor Prompt (Next.js App Router + shadcn/ui Landing Page) > Create a high-converting SaaS Landing Page using Next.js (App Router), TypeScript, Tailwind CSS, and shadcn/ui. Use `src/app/(marketing)/layout.tsx` and `page.tsx` as Server Components with Next.js SEO Metadata, `src/components/ui/` for official shadcn/ui components, `src/components/shared/` for Navbar & Footer, and `src/features/landing/` for sections and typed data. Add `"use client"` only on interactive components. Default white light mode with dark mode toggle. --- ## 3. Express.js (Backend — Framework) ### Universal 3-Layer Modular Structure ```text src/ ├── config/ # DB connection, env variables, Redis/Kafka config ├── modules/ # Feature-wise modules (Best for scaling) │ ├── auth/ │ │ ├── auth.routes.js # Defines URL endpoints only │ │ ├── auth.controller.js # Handles req/res only │ │ ├── auth.service.js # Core business logic & DB calls │ │ └── auth.validation.js # Zod / Joi schema validation │ └── orders/ ├── middlewares/ # authMiddleware, errorHandler, rateLimiter ├── utils/ # Helper functions (ApiResponse, ApiError, logger) ├── app.js # Express app setup and middlewares └── server.js # Server startup and DB connection ``` ### Cursor Prompt (Express.js Backend) > Build a production-ready Express.js REST API following a strict 3-layer modular architecture (`routes` -> `Zod validation` -> `controller` -> `service`). Keep `app.js` and `server.js` separate, centralize error handling via `ApiError` & `errorHandler`, and return consistent `{ success, statusCode, message, data }` JSON responses for React/Next.js + shadcn/ui frontends. --- ## 4. FastAPI (Backend — Framework) ### Universal Modular Structure ```text app/ ├── core/ # Config, env variables, security (JWT, hashing) ├── db/ # SQLAlchemy session, Base, migrations (Alembic) ├── modules/ # Feature-wise modules │ ├── auth/ │ │ ├── router.py # API endpoints only │ │ ├── schemas.py # Pydantic request/response models │ │ ├── service.py # Core business logic │ │ └── models.py # Database ORM models │ └── orders/ ├── middlewares/ # CORS, logging, rate limiter ├── utils/ # Helper functions & custom exceptions └── main.py # FastAPI app instance & router registration ``` --- ## 5. Laravel (Backend — Framework) ### Universal Clean Architecture ```text app/ ├── Http/ │ ├── Controllers/ # Handle requests & return responses │ ├── Middleware/ # Auth, role & rate limit middlewares │ ├── Requests/ # FormRequest validation classes │ └── Resources/ # API JSON response transformers ├── Models/ # Eloquent ORM models ├── Services/ # Core business logic ├── Repositories/ # Database query abstraction config/ # App, DB, Mail, Queue configs database/ ├── migrations/ # DB table schemas └── seeders/ # Dummy / initial data seeders routes/ ├── api.php # API endpoints └── web.php # Web routes ``` --- ## 6. Spring Boot (Backend — Framework) ### Universal Layered Structure ```text src/main/ ├── java/com/app/ │ ├── config/ # Security, CORS, Swagger, Bean configs │ ├── controller/ # REST endpoints (@RestController) │ ├── service/ # Core business logic (@Service) │ ├── repository/ # JPA / DB layer (@Repository) │ ├── entity/ # Database entities (@Entity) │ ├── dto/ # Request & Response DTOs │ ├── exception/ # GlobalExceptionHandler & custom errors │ └── Application.java # Spring Boot main entry point └── resources/ └── application.yml # DB, server port & env configs ``` --- ## 7. Flutter (Mobile — UI Toolkit) ### Universal Feature-First Clean Architecture ```text lib/ ├── core/ # Theme, constants, network (Dio), utils ├── routes/ # GoRouter / app navigation setup ├── shared/ │ └── widgets/ # Common widgets (AppButton, AppInput) ├── features/ # Feature modules (Clean Architecture) │ ├── auth/ │ │ ├── data/ # Models, API datasource & repository impl │ │ ├── domain/ # Entities & repository contracts │ │ └── presentation/ # Screens, widgets & Bloc / Riverpod state │ └── products/ └── main.dart # App entry point ```