https://project-udyam.vercel.app/
The project includes a scraper script (scrapeTarget.js) used to extract the latest form field schema from the official Udyam registration website. This ensures your frontend and backend always use up-to-date field names and options.
- Scrapes the Udyam registration page for all input/select fields and their attributes.
- Outputs a JSON schema (
udyam_form_fields.json) used by the backend and frontend for dynamic form rendering.
- Make sure you have Node.js installed.
- In the project root, run:
node scrapeTarget.js
- The script will fetch the target page, parse the form, and overwrite
udyam_form_fields.jsonwith the latest schema. - Restart your backend server to use the updated schema.
- The scraper is intended for development/maintenance. You do not need to run it unless the Udyam form changes.
- Review the generated JSON before deploying to production.
Project Udyam is a full-stack web application for Udyam registration, featuring a dynamic, schema-driven multi-step form (Aadhaar, OTP, PAN & Details) with backend validation and database persistence. The project is split into two main folders:
udyam_frontend/— React + Vite frontendudyam_backend/— Node.js + Express + Prisma backend
- Dynamic multi-step registration form (Aadhaar, OTP, PAN, Details)
- Schema-driven fields (fetched from backend)
- User-friendly field labels
- Real-time validation (Aadhaar, PAN, required fields)
- PIN autofill for city/state
- PAN Declaration checkbox (highlighted)
- Success popup and form reset on submit
- Data saved to database after backend validation
- Modular, production-ready codebase
Project_Udyam/
udyam_backend/ # Backend API and DB
udyam_frontend/ # Frontend React app
udyam_form_fields.json # Form schema (used by backend)
- Node.js, Express
- Prisma ORM (PostgreSQL)
- Validation logic in
src/validation.js
- Returns the form schema as JSON (from
udyam_form_fields.json). - Used by frontend to render dynamic fields.
- Accepts form data (JSON) from frontend.
- Validates Aadhaar, PAN, required fields.
- On success: saves to database and returns
{ status: 'success', data: ... }. - On error: returns
{ status: 'error', message: ... }.
cd udyam_backend
npm install
# Set up your .env (see .env.example)
npx prisma generate
npx prisma migrate dev # or migrate deploy for production
npm start
# Server runs on http://localhost:5000DATABASE_URL— PostgreSQL connection stringPORT— (optional) server port
cd udyam_backend
npm test
# Runs tests in src/tests/submit.test.js- React (Vite)
- Tailwind CSS
- On load, fetches form schema from backend (
/api/formfields). - Renders multi-step form (Aadhaar, OTP, PAN, Details) using schema.
- Validates input in real-time.
- On submit, sends data to backend (
/api/submit). - Shows success popup and resets form on success.
cd udyam_frontend
npm install
npm run dev
# App runs on http://localhost:5173 (default Vite port)VITE_API_URL— (optional) backend API base URL (default: http://localhost:5000)
cd udyam_frontend
npm run build
# Output in dist/Project Udyam can be run entirely using Docker Compose. All dependencies and setups are included in the Dockerfiles.
# Build the Docker images for backend and frontend
docker-compose build
# Start both backend and frontend containers
docker-compose up
# Stop and remove the containers
docker-compose down- Start Backend:
- Configure
.envinudyam_backend/with your database URL. - Run migrations and start the server.
- Configure
- Start Frontend:
- Optionally set
VITE_API_URLinudyam_frontend/.envif backend is not on localhost:5000. - Start the dev server.
- Optionally set
- Open the app:
- Go to the frontend URL in your browser.
- Fill out the form step by step (Aadhaar, OTP, PAN, Details).
- On submit, data is validated and saved to the database.
- Success popup appears and form resets.
- Run
npm testinudyam_backend/to execute backend tests (seesrc/tests/submit.test.js).
- You can add tests using your preferred React testing library (not included by default).
- Set all environment variables in your deployment platform (do not commit secrets).
- Use production database for backend.
- Set CORS in backend to allow only your frontend domain in production.
- Set
VITE_API_URLin frontend deployment to point to your backend API.
- Developed by Aditya Mishra
- Assignment for Openbiz
This project is for educational/demo purposes. See LICENSE if present.