Skip to main content

System Architecture

The system architecture of QuickEase 2.0 follows a logical three-tier model consisting of the presentation, application, and data layers. While the codebase is organized in a client-server structure, this layout maps directly to the three-tier architecture in terms of functionality and separation of concerns.

Client-Server Code Structure

The project is organized as follows:

root-directory/
client/ → Presentation Layer (Web & Mobile Frontends)
server/ → Application & Data Layers (Backend & Database Access)

This client-server structure supports the three-tier model by maintaining clear logical separation between layers.

Three-tier Model Layers

Presentation Layer

The presentation layer provides user interfaces for registration, PDF uploads, AI-powered content generation, and quizzes. It includes:

  • Web App: Built with React (Vite), deployed via Vercel or Netlify.
  • Mobile App: Developed using Expo React Native, distributed via EAS Build or Gradle.

Application Layer

The application layer is built with Node.js and Fastify. It manages server-side routing, logic, and integrations:

  • AI Services: Integrates with Google’s Gemini LLM API to generate summaries, quizzes, and flashcards.
  • File Handling: Manages uploads and stores files using Google Cloud Storage.
  • Authentication: Implemented internally using JSON Web Tokens (JWT).

Data Layer

The data layer is responsible for persistent storage and file management:

Database: Uses PostgreSQL for structured data such as user profiles, quiz results, and AI-generated outputs.

  • ORM: Prisma is used for type-safe and efficient database interaction.
  • File Storage: Google Cloud Storage is used for storing uploaded documents and AI outputs.

Technology Stack

QuickEase 2.0 uses a unified TypeScript/Node.js stack across web, mobile, and backend, enabling code reusability and performance consistency. The backend is hosted on DigitalOcean, and core services are integrated within the Google Cloud ecosystem for scalability and reliability.

Frontend Dependencies (Web)

For Production

PackageDescription
reactThe core library used for building the app’s user interfaces with a component-based architecture.
react-domThe package that renders React components to the Document Object Model (DOM) browser environment.
react-routerThe routing library used for React apps.
@tanstack/react-queryData fetching and caching library for React, ideal for managing server-state.
axiosA promise-based HTTP client for making API requests in the browser or Node.js.
clsxUtility for conditionally joining class names, useful for dynamic styling of components.
dayjsA lightweight JavaScript library for parsing, validating, manipulating, and formatting dates.
daisyuiA plugin for Tailwind that provides pre-built accessible components.
lucide-reactBeautiful, consistent icon set for React based on Feather icons.
next-themesPlugin for managing dark/light theme toggling in Next.js and other React frameworks.
zustandA small, fast, scalable state-management solution for React apps.
immerHelps in writing immutable state logic in a more intuitive (mutable-like) way.
sonnerLightweight toast notification library for React.
@tiptap/reactReact bindings for the Tiptap rich text editor.
@tiptap/pmTiptap’s underlying ProseMirror toolkit – manages document state.
@tiptap/starter-kitPre-configured set of extensions for common rich text editing features in Tiptap.
tailwindcssA utility-first CSS framework for rapid UI development.
@tailwindcss/viteVite plugin to integrate TailwindCSS smoothly with the Vite build process.
tailwind-mergeMerges Tailwind classes intelligently to avoid conflicts.
zodUsed for runtime schema validation, ensuring that data meets expected types and shapes.

For Development

PackageDescription
viteA fast modern frontend build tool that serves the code via native ESM and bundles it with Rollup.
@vitejs/plugin-reactVite plugin for React that includes Fast Refresh and other optimizations.
eslintA widely-used linter for identifying and fixing problems in JavaScript/TypeScript code.
@eslint/jsProvides ESLint’s core rules as an independent package (used with modern ESLint setups).
eslint-plugin-react-hooksESLint rules specific to React hooks usage.
eslint-plugin-react-refreshESLint plugin that prevents incorrect usage of React Fast Refresh.
typescriptAdds static typing to JavaScript, enabling type checking and development tooling.
@types/nodeTypeScript type definitions for Node.js global objects and modules.
@types/react, @types/react-domType definitions for React and ReactDOM, used in TypeScript.
typescript-eslintIntegrates TypeScript with ESLint for better linting support on TypeScript codes.
globalsProvides a list of global variables as used in different JS environments (Node, browser, etc.).

Backend Dependencies

For Production

PackageDescription
fastifyHigh-performance web framework for Node.js.
@fastify/cookie, @fastify/cors, @fastify/env, @fastify/jwt, @fastify/multipart, @fastify/postgresFastify plugins for handling cookies, CORS, environment variables, JWT auth, file uploads, and PostgreSQL integration.
@google/genaiGoogle Generative AI SDK for accessing models like Gemini.
@modelcontextprotocol/sdkUsed for interacting with Model Context Protocol APIs.
@prisma/clientRuntime client for interacting with Prisma-managed database.
bcryptLibrary for hashing passwords.
pgPostgreSQL client for Node.js (used by Prisma or @fastify/postgres).
dayjsLightweight date/time library.
zodRuntime validation and parsing library.
zod-to-json-schemaConverts Zod schemas to JSON Schema (used for API validation or OpenAPI specs).

For Development

PackageDescription
typescriptAdds static typing to JavaScript, enabling type checking and development tooling.
ts-node-devA command-line tool optimized for TypeScript that automatically restarts Node.js when file changes occur.
jestA JavaScript testing framework.
ts-jestJest transformer for TypeScript support.
@types/node, @types/bcrypt, @types/jestType definitions for Node.js, bcrypt, and Jest (for TypeScript).