PartLens is an documentation platform mainly aimed at documenting 3d machine diagrams by uploading manuals. 3D glb file of machine is uploaded into the system, then you can upload manuals/pdfs for a specific part in that machine.
Our system allows you to click on a machine part and inside the 3D render icon and it would automatically select it.
Nextjs, with an express backend. Postgresql for storing data with drizzle. And redis to store certain values for fast access with expiry + caching and ratelimiting.
Api docs are available here
- Node.js 20+ and npm
- PostgreSQL database (
POSTGRES_URL) - Redis instance (
REDIS_URL) - ImageKit account (
IMAGEKIT_PUBLIC_KEY,IMAGEKIT_PRIVATE_KEY,IMAGEKIT_URL_ENDPOINT) - Google OAuth client (
GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET)
Services run locally on:
- Backend:
http://localhost:5050 - Frontend:
http://localhost:3000
cd backend
npm install
cp .env.example .envFill in .env (see backend/.env.example and backend/api_docs.md for details):
POSTGRES_URL=
REDIS_URL=
REDIS_PREFIX=
ADMIN_KEY=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
FRONTEND_URL=http://localhost:3000
BACKEND_URL=http://localhost:5050
IMAGEKIT_PUBLIC_KEY=
IMAGEKIT_PRIVATE_KEY=
IMAGEKIT_URL_ENDPOINT=
PORT=5050
NODE_ENV=development
In the Google Cloud Console, add this OAuth redirect URI:
http://localhost:5050/api/v1/auth/google/callback
Then apply migrations and start the dev server (auto-applies migrations on boot, port 5050):
npm run db:migrate
npm run devVerify: GET http://localhost:5050/status
Other backend commands:
npm run build # compile TypeScript to dist/
npm start # run compiled server (production)
npm run db:generate # generate a migration from schema changes
npm run db:push # push schema directly (dev only)The frontend uses hardcoded URLs in frontend/src/vars/vars.tsx:
BACKEND_URL: 'http://localhost:5050'
FRONTEND_URL: 'http://localhost:3000'For local development the defaults work as-is. For production, update both values to your deployed URLs before building.
cd frontend
npm install
npm run devOpen http://localhost:3000.
- Start PostgreSQL and Redis.
- Start backend (
cd backend && npm run dev). - Start frontend (
cd frontend && npm run dev).
- Provision managed PostgreSQL and Redis, plus ImageKit and Google OAuth credentials.
- Set backend environment variables with production values:
NODE_ENV=production, publicFRONTEND_URL/BACKEND_URL, realPOSTGRES_URL,REDIS_URL, ImageKit and Google keys, strongADMIN_KEY. The backend setstrust proxyautomatically whenNODE_ENV=production. - Add the production OAuth redirect URI in Google Cloud Console:
https://<your-backend>/api/v1/auth/google/callback - Deploy backend:
cd backend npm install npm run build npm run db:migrate npm start - Deploy frontend: update
frontend/src/vars/vars.tsxto your publicBACKEND_URL/FRONTEND_URL, then:Or host the frontend on Vercel/another Node host servingcd frontend npm install npm run build npm startnext starton port3000. - Verify production:
GET https://<your-backend>/statusand load the frontend URL, then test Google login and a GLB/PDF upload.
Got any contributions? Please open a pull request.