An interactive career quiz built with HTML, TailwindCSS, and JavaScript on the frontend, powered by Google Gemini API for career suggestions, and deployed seamlessly on Netlify using serverless functions.
- π Simple career quiz form (built with TailwindCSS)
- β‘ Real-time responses from Gemini 1.5 Flash
- π Serverless backend with Netlify Functions
- π Secure environment variables (no API key exposed in frontend)
- π Continuous deployment with GitHub β Netlify integration
- Frontend: HTML, TailwindCSS, JavaScript (Vanilla)
- Backend: Netlify Functions (Node.js)
- AI API: Google Gemini (
gemini-1.5-flash) - Deployment: Netlify (linked with GitHub)
career-quiz/ β βββ netlify/ β βββ functions/ β βββ quiz.js # Serverless function calling Gemini API β βββ public/ β βββ index.html # Main quiz page β βββ quiz.js # Handles quiz form + fetch request β βββ .gitignore # Prevents .env and node_modules from being pushed βββ netlify.toml # Netlify build + functions config βββ README.md # Documentation
git clone [https://github.com/your-username/career-quiz.git](https://github.com/ayodaniel6/careerQuiz.git)
cd career-quiz
### 2. Install dependences
npm install
### 3. Create a .env file in the project root
GEMINI_API_KEY=your_real_api_key_here
### 4. Run locally with Netlify Dev
netlify dev
Visit π http://localhost:8888
### 5. Deploy
Push to your GitHub repo β Netlify will auto-deploy β¨
##π§ͺ Testing API locally
To check if your Gemini API works:
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts":[{"text": "Hello Gemini!"}]
}]
}' \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=YOUR_API_KEY"
## πΈ Demo Screenshot
<img width="703" height="911" alt="Screenshot 2025-09-12 124448" src="https://github.com/user-attachments/assets/2bb7c78e-efc5-4079-a228-9bd54d30accb" />
## π Security Notes
Never commit your .env file or API keys.
Always store API keys as environment variables in Netlify.
π§βπ» Author
Built with β€οΈ by Ayodeji