quran-foundation-app

Quran Foundation App

React Vite Express Node License

A full-stack Quran reading experience built with React + Vite on the frontend and an Express proxy backend for secure OAuth2 access to Quran Foundation content APIs.


## Highlights

- Surah, Juz, and Hizb reading modes
- Translation and tafsir support
- Word-by-word endpoint integration
- Ayah audio playback with reciter selection
- Global mini player with:
   - Repeat Ayah
   - Surah Loop
   - Transport, seek, speed, and volume
- Responsive UI with persistent user preferences

## Stack

- Frontend: React 18 + Vite 5
- Backend: Express + CORS + dotenv
- Auth/API: OAuth2 Client Credentials with Quran Foundation APIs

## Architecture

```text
Browser (Vite app) -> Local Express backend -> Quran Foundation API

The backend handles token creation/caching and keeps secrets out of the client.

Quick Start

1. Install dependencies

cd DEENCORE
npm install

2. Configure backend environment

Create DEENCORE/server/.env (copy from DEENCORE/server/.env.example) and set:

QF_CLIENT_ID=your_client_id
QF_CLIENT_SECRET=your_client_secret
QF_AUTH_URL=https://oauth2.quran.foundation/
QF_API_BASE=https://apis.quran.foundation/
PORT=3001

3. Run backend

cd DEENCORE
npm run server

Backend URL: http://localhost:3001

4. Run frontend

In a second terminal:

cd DEENCORE
npm run dev

Frontend URL: http://localhost:5173

Scripts

From DEENCORE:

Key API Routes (Backend)

Project Layout

quran-foundation-app/
|- READme.md
|- DEENCORE/
|  |- package.json
|  |- index.html
|  |- vite.config.js
|  |- server/
|  |  |- index.js
|  |  |- .env.example
|  |- src/
|     |- App.jsx
|     |- App.css
|     |- main.jsx

Troubleshooting

Security Notes