An automotive showroom experience for exploring premium vehicles, with API-backed accounts and a protected administrator area.
Status: Not publicly deployed.
- Responsive vehicle showroom pages for home, about, products, and contact.
- Vehicle catalog with brand and vehicle-type filters.
- Email and password accounts managed by the Render API, with scrypt password hashes and database-backed sessions.
- Administrator routes protected by HttpOnly session cookies and roles stored in Neon Postgres.
- Administrator user list backed by the API; vehicle, order, and dashboard views remain sample data.
- Strict server-side input validation, rate limiting, Helmet security headers, and origin allowlisting.
- Versioned PostgreSQL SQL migrations and a health endpoint for deployment checks.
| Area | Technologies |
|---|---|
| Frontend | React 19, TypeScript, Vite 8, React Router |
| Authentication | Express API sessions, Node.js scrypt, HttpOnly cookies |
| API | Node.js 24, Express 5, TypeScript, Zod, Helmet, express-rate-limit |
| Database | Neon Postgres, pg, versioned SQL migrations |
| Hosting | Vercel for the frontend, Render for the API |
| Quality | ESLint, typescript-eslint, Prettier, GitHub Actions, Dependabot |
Browser ── Vercel React app ── same-origin /api proxy ── Render API ── Neon Postgres
The browser sends same-origin API requests through Vercel rewrites. The Render API manages email/password accounts, stores only scrypt password hashes, and issues opaque HttpOnly session cookies whose hashes are stored in Neon. The API checks roles before returning protected data. The browser does not connect directly to Postgres. The product catalog and several admin dashboard sections are currently static demonstration content.
- Node.js 24.x and npm.
- A Neon Postgres database for API-backed accounts and roles.
git clone https://github.com/Abdullah-Mohammed456/Summer-Training-Web-Project.git
cd Summer-Training-Web-Project
npm ci
cp .env.example .envFill in .env using the table below. The Vite development server proxies /api to the local Express API, so the browser does not need database credentials or authentication secrets.
| Variable | Used by | Description |
|---|---|---|
DATABASE_URL |
Render API | Neon pooled Postgres URL; require TLS with sslmode=require. |
DIRECT_DATABASE_URL |
Render build / local migrations | Neon direct, non-pooled URL used by database migrations; require TLS. |
DATABASE_SSL |
Render API | Set to true in production. Use false only for a local database without TLS. |
CORS_ALLOWED_ORIGINS |
Render API | Comma-separated exact frontend origins, including scheme; no wildcard. |
PORT |
Render / local API | Render supplies this in production; local default is 3001. |
Start the API in one terminal:
npm run dev:apiStart the Vite frontend in another terminal:
npm run devThe API health check is available at http://localhost:3001/health. The API expects the database schema to be migrated before it can serve profile data.
npm run lint
npm run typecheck
npm run typecheck:frontend
npm run build:frontend
npm run build
npm run previewThere is no automated test suite configured yet. Add unit and API integration coverage before using the admin tools with production data.
Build the API and apply the committed SQL migrations to the Neon database:
npm run server:build
npm run db:migrateAfter registering the administrator account, grant its role only from a trusted SQL console, using its email address:
UPDATE user_profiles
SET role = 'ADMIN'
WHERE email = LOWER('<ADMIN_EMAIL>');Do not grant roles from frontend code. Existing accounts do not migrate; users must register new accounts in the Neon-backed API.
- Import this repository into Vercel and keep the project root at the repository root.
- Use the Vite framework preset, Node.js 24.x,
npm run build:frontendas the build command, anddistas the output directory. The frontend-specific command type-checks the browser app and builds its static files without compiling the Express API. - No environment variables are required in Vercel. The
/apirewrite invercel.jsonproxies requests tohttps://netclacks.onrender.com. - Deploy and note the exact production origin, for example
https://your-project.vercel.app. Sign-in and registration work after the Render API is deployed and its CORS origin is set.
If the Render service uses a different origin, update the /api rewrite destination in vercel.json.
- Create a new, empty Neon Postgres database for this schema. Copy both its pooled connection string and its direct connection string; keep
sslmode=requireenabled. - Create a Render Blueprint from
render.yaml. It defines the Node API, the/healthcheck, and the database migration command. SetDATABASE_URLto the Neon pooled connection string andDIRECT_DATABASE_URLto the direct connection string before the first build; the build applies the migration. - After the Vercel deployment has a production URL, set
CORS_ALLOWED_ORIGINSin Render to that exact origin.DATABASE_SSLis set totruein the Blueprint. - Register the intended administrator account from the app, then grant its role using the SQL shown above.
The Render Blueprint marks connection strings and project-specific values as sync: false; supply them in Render rather than committing values. The actual Render and Vercel URLs depend on the accounts and project names chosen during setup.
src/ React application and API-backed auth state
src/lib/api.ts Typed API client
server/src/ Express API, authentication, validation, database access
server/migrations/ PostgreSQL schema migrations
legacy/ Older static pages retained for reference
public/ Static images and icons
.github/workflows/ CI checks
.github/dependabot.yml Dependency update schedule
vercel.json Vercel build, routing, and security headers
render.yaml Render API service configuration
- Vehicle, order, and some admin views use sample data.
- The contact form is not connected to an API endpoint.
- No automated test suite is configured yet.
- The app is not publicly deployed.
See CONTRIBUTING.md for the local workflow, quality checks, and security expectations.
This project is licensed under the MIT License. See LICENSE.
For bugs or project questions, open a GitHub issue in this repository.