A Next.js application that displays prayer times and inspirational quotes. The app fetches prayer times from an external API and stores them in a Supabase database, while also providing a random quote feature.
- 📅 Prayer times display with beautiful UI
- 💬 Daily inspirational quotes
- 🗄️ Supabase database integration
- 📱 Responsive design
- 🔄 Fallback data when database is unavailable
- Website: https://prayer-api-dashboard.vercel.app
- API Endpoints:
- Prayer Times: https://prayer-api-dashboard.vercel.app/api/prayer-times
- Random Quote: https://prayer-api-dashboard.vercel.app/api/random-quote
Create a .env.local file in your project root:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_keyHow to get these values:
- Go to your Supabase project dashboard
- Navigate to Settings > API
- Copy the "Project URL" and "anon public" key
- Create a new Supabase project
- Go to the SQL Editor
- Run the SQL from
db/schema.sqlto create the tables - Run the SQL from
db/sample-data.sqlto add sample quotes
npm install
npm run dev- GET
/api/prayer-times - Query Parameters:
date(optional, format: YYYY-MM-DD) - Response: Prayer times for the specified date
- GET
/api/random-quote - Query Parameters:
category(optional) - Response: Random quote with optional category filtering
-
White page on dashboard
- Check if environment variables are set correctly
- Verify Supabase connection
- Check browser console for errors
-
"No quotes found" error
- Ensure the
quotestable exists in your database - Run the sample data SQL to populate quotes
- The API will fallback to hardcoded quotes if database is unavailable
- Ensure the
-
Prayer times not loading
- Check if the external prayer API is accessible
- Verify your internet connection
- The API will fallback to sample prayer times if external API fails
- Development: Uses local environment variables
- Production: Uses Vercel environment variables
- Fallback: App works without database using external APIs and hardcoded data
src/
├── app/
│ ├── api/
│ │ ├── prayer-times/
│ │ │ └── route.js
│ │ └── random-quote/
│ │ └── route.js
│ ├── dashboard/
│ │ └── page.jsx
│ ├── layout.tsx
│ └── page.tsx
├── lib/
│ └── supabaseClient.js
└── db/
├── schema.sql
└── sample-data.sql
- Next.js 14 - React framework
- Supabase - Database and backend
- Tailwind CSS - Styling
- Aladhan API - Prayer times data
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License