Ruya.ai is an intelligent dream interpretation tool that analyzes dreams according to Islamic traditions. Drawing from the works of Ibn Sirin, a renowned Islamic dream interpreter, the application leverages Google's Gemini AI to provide meaningful interpretations based on traditional Islamic dream analysis principles.
- Islamic Dream Analysis: Receive interpretations grounded in traditional Islamic sources
- Real-time Streaming: Watch interpretations appear as they're being generated
- Modern UI: Clean, responsive interface with a sleek glassmorphism design
- API Access: RESTful API endpoints for integration with other applications
- Markdown Support: Interpretations support markdown formatting for better readability
- Python: Core programming language
- Flask: Web framework for the REST API
- Google Gemini AI: Large language model for dream interpretation
- CORS: Cross-origin resource sharing support
- React: UI library for building the user interface
- TypeScript: Type-safe JavaScript
- Styled Components: CSS-in-JS styling solution
- Axios: HTTP client for API requests
- React Markdown: For rendering markdown content
- Python 3.10 or higher
- Node.js 18 or higher
- Google Gemini API key (obtain from Google AI Studio)
-
Create a
.envfile in the root directory:GEMINI_API_KEY=your_api_key_here -
Alternatively, set the environment variable directly:
# Windows set GEMINI_API_KEY=your_api_key_here # Linux/macOS export GEMINI_API_KEY=your_api_key_here
-
Clone the repository:
git clone https://github.com/yourusername/ruya.ai.git cd ruya.ai -
Set up the Python backend:
python -m venv venv venv\Scripts\activate pip install -r requirements.txt
-
Install and build the React frontend:
cd ruya-react npm install npm run build
-
Start the Flask backend:
cd c:\Users\cantc\Desktop\Coding\Python\ruya.ai python app.py
-
In a separate terminal, start the React development server:
cd c:\Users\cantc\Desktop\Coding\Python\ruya.ai\ruya-react npm start
-
Access the application: Open your browser and navigate to
http://localhost:3000
POST /interpret
Request Body:
{
"dream_text": "I dreamt of flying over mountains and oceans..."
}Response:
{
"interpretation": "Your dream interpretation text..."
}POST /interpret-stream
Request Body:
{
"dream_text": "I dreamt of flying over mountains and oceans..."
}Response: Text stream of the interpretation as it's being generated
ruya.ai/
βββ app.py # Flask backend server
βββ agent.py # Gemini AI integration
βββ assets/ # Reference files for dream interpretation
β βββ file.txt # Ibn Sirin's dream dictionary
βββ requirements.txt # Python dependencies
βββ ruya-react/ # React frontend
βββ public/ # Static files
βββ src/ # React source code
β βββ api/ # API client code
β βββ components/ # React components
β βββ styles/ # Styling
βββ package.json # Node.js dependencies
βββ tsconfig.json # TypeScript configuration
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please read our Code of Conduct before contributing.
This project is licensed under the MIT License - see the LICENSE file for details.
This application is for educational and entertainment purposes only. Dream interpretations are generated by AI based on traditional sources but should not be taken as religious guidance or professional advice. Always consult with qualified religious scholars for authoritative interpretations.
