How preethamak/web works
Project type and purpose
• Equdator is a full‑stack web application.
• Frontend: a mix of static HTML/CSS/JS pages (index.html, signup.html, scripts.js, signup.js) plus a React/Vite single‑page app under /src.
• Backend: a Node.js/TypeScript HTTP server (server.ts).
• Database: a managed, serverless Postgres (Neon DB) accessed via Prisma ORM (prisma/schema.prisma).
File structure
Top‑level directories and files:
• /index.html, /signup.html: public entry points for landing and auth.
• /scripts.js, /signup.js: vanilla JS logic for the static pages.
• /src: React application (App.jsx, landing.jsx, main.jsx) + CSS/Tailwind assets.
• /server.ts: the API layer handling routes, JWT auth, business logic.
• /prisma: database schema, migration scripts, generated Prisma client in /src/generated/prisma.
• Build/config: vite.config.js, tsconfig.json, eslint.config.js, package.json.
README for extra context
• Emphasis on HTML/CSS/JS + Tailwind + Font Awesome.
• Database feature list (Neon DB serverless).
• Environment variables: DATABASE_URL, JWT_SECRET.
• Startup: npm run dev launches Vite + the TS server.
a. Main components
1. User’s Browser (Client)
• Static HTML pages + React SPA served to the browser.
• Tailwind/CSS + Font‑Awesome assets.
2. CDN / Static Asset Host (optional)
• Serves index.html, signup.html, JS/CSS bundles built by Vite.
3. Frontend App
• React/Vite code under /src.
• Runs in the browser, calls backend APIs.
4. API Server (server.ts)
• Node.js + TypeScript HTTP server.
• Implements authentication (JWT), routing, business logic.
5. Prisma ORM Layer
• Generated client in /src/generated/prisma.
• Exposes JS/TS methods to query Neon DB.
6. Neon Postgres DB
• The production data store; managed, serverless.
7. Environment & Dev Tools
• .env file: DATABASE_URL, JWT_SECRET.
• Vite dev server, ESLint, TS compiler.
b. Relationships & interactions
• Browser → (HTTP/HTTPS) → CDN or directly → serves static HTML & JS bundles.
• React code / scripts.js → (XHR/fetch) → API Server endpoints.
• API Server → (Prisma client) → Neon Postgres DB.
• API Server → (JWT) → Browser (auth tokens in headers/cookies).
• Prisma migrations → DB schema changes.
c. Architectural patterns/design principles
• Layered architecture: Presentation (static + React) → Application (server.ts) → Data (Prisma → DB).
• ORM pattern: Prisma abstracts SQL away.
• Single‑page app & multi‑page hybrid: landing + signup pages alongside a React SPA.
• Dev/prod parity: same code (server.ts, Prisma) runs locally and in production.
d. Key technologies
• Vite (dev/build)
• React (+ JSX)
• Tailwind CSS
• Node.js + TypeScript
• Prisma ORM
• Neon DB (serverless Postgres)
• JWT for auth
Detailed checklist
[ ] Static HTML pages (index.html, signup.html)
[ ] React SPA component (src/\*.jsx)
[ ] Vite build & dev server
[ ] Scripts.js / signup.js logic
[ ] API Server (server.ts): list endpoints (e.g., /signup, /login, /data)
[ ] Prisma ORM layer & schema.prisma
[ ] Neon DB (migrations, connection pooling)
[ ] Environment variables (DATABASE_URL, JWT_SECRET)
[ ] JWT token flow between Client ↔ API