Emerging Trends in AI, Security & Image Analysis — Sharda University
A full-stack attendance web app where students submit their details via a form and data is stored in Google Sheets. Teachers access a password-protected admin dashboard to filter and export records.
| Layer | Technology |
|---|---|
| Frontend | React 18 + Vite 5 + Tailwind CSS |
| Backend | Node.js + Express |
| Database | Google Sheets (via Sheets API v4) |
| Auth | Google Service Account |
Attendance Taker/
├── client/ # React + Vite frontend
│ ├── src/
│ │ ├── components/
│ │ │ ├── AttendanceForm.jsx
│ │ │ └── AdminDashboard.jsx
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ └── index.css
│ ├── index.html
│ ├── vite.config.js
│ ├── tailwind.config.js
│ ├── postcss.config.js
│ ├── .env # VITE_ADMIN_PASSWORD
│ └── package.json
├── server/ # Express backend
│ ├── routes/
│ │ └── attendance.js
│ ├── services/
│ │ └── googleSheets.js
│ ├── index.js
│ ├── .env # Google credentials
│ └── package.json
└── README.md
- Go to Google Cloud Console and create a new project.
- Enable Google Sheets API from APIs & Services → Library.
- Create a Service Account: APIs & Services → Credentials → Create Credentials → Service Account.
- Give it any name, then click Done.
- Open the service account → Keys tab → Add Key → Create new key → JSON.
- Download the JSON file. Open it — you will copy values from it into
server/.env. - Create a new Google Sheet and name the first tab
Attendance. - Share the sheet with the service account email (
client_emailin the JSON) with Editor access. - Copy the Spreadsheet ID from the URL:
https://docs.google.com/spreadsheets/d/<<SPREADSHEET_ID>>/edit
Edit server/.env:
PORT=5000
CLIENT_URL=http://localhost:5173
SPREADSHEET_ID=paste_your_spreadsheet_id
SHEET_NAME=Attendance
GOOGLE_PROJECT_ID= # from JSON: project_id
GOOGLE_PRIVATE_KEY_ID= # from JSON: private_key_id
GOOGLE_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----\n"
GOOGLE_CLIENT_EMAIL= # from JSON: client_email
GOOGLE_CLIENT_ID= # from JSON: client_idTip: Copy the
private_keyvalue exactly as it appears in the JSON file (with literal\ncharacters). Wrap it in double quotes.
Edit client/.env:
VITE_ADMIN_PASSWORD=your_secure_password# Backend
cd server
npm install
# Frontend
cd ../client
npm installOpen two terminals:
# Terminal 1 – Backend
cd server
npm run dev # starts on http://localhost:5000
# Terminal 2 – Frontend
cd client
npm run dev # starts on http://localhost:5173Visit http://localhost:5173 in your browser.
The sheet is auto-initialized on first submission:
| A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|
| Timestamp | Name | System ID | Course | Section | Group | Sharda Email | Event Name |
| Path | Description |
|---|---|
/ |
Student attendance form |
/admin |
Password-protected admin dashboard |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/attendance |
Submit attendance (duplicate check) |
| GET | /api/attendance |
Fetch records (supports ?course=§ion=&group=) |
| GET | /health |
Health check |
- Push
server/to a GitHub repo (or a sub-folder with a rootpackage.json). - Create a new Web Service on render.com.
- Set Root Directory to
server. - Build command:
npm install| Start command:node index.js - Add all
server/.envvalues as Environment Variables in the Render dashboard. - Note your Render URL (e.g.
https://attendance-api.onrender.com).
- Push
client/to GitHub. - Import the repo on vercel.com.
- Set Root Directory to
client. - Add environment variable
VITE_ADMIN_PASSWORD. - In
client/vite.config.js, update the proxy target to your Render URL for production builds, or update the Axios base URL in components usingimport.meta.env.VITE_API_URL.
Quick production API URL fix: In both components, instead of
/api/attendance, use:const API = import.meta.env.VITE_API_URL || ''; axios.post(`${API}/api/attendance`, data)Then set
VITE_API_URL=https://your-render-url.onrender.comin Vercel.
- Admin password is stored in a client-side env variable — sufficient for internal/event use. For production, move authentication to the backend with JWT.
- Never commit
server/.envcontaining real credentials to version control. Add it to.gitignore. - The Google private key must only live on the server.
Add this at the repository root:
server/.env
client/.env
node_modules/
dist/