The Vedic Shastra API is a comprehensive and scalable API designed to provide access to a vast collection of Hindu scriptures, including the Vedas, Upanishads, Puranas, Bhagavad Gita, Ramayana, and more. It offers easy retrieval of verses, translations, and commentaries in various languages, enabling developers, scholars, and enthusiasts to interact with the rich philosophical and spiritual content of Hindu scriptures.
- Scriptures Database: Access a growing collection of Hindu scriptures, including Vedas, Upanishads, Puranas, Bhagavad Gita, and Ramayana.
- Translations & Commentary: Retrieve verses along with translations and insightful commentaries.
- Search Functionality: Search for verses or scriptures by keywords, categories, or verses.
- Multi-language Support: Available in Sanskrit, English, and other languages.
- Modular Design: Add more scriptures and translations dynamically through the API.
The project is built using TypeScript and Node.js, and uses MongoDB as the database.
vedic-shastra-api/
│
├── src/
│ ├── controllers/ # API controllers
│ ├── models/ # Mongoose models for scriptures, categories, translations
│ ├── routes/ # API routes
│ ├── seed/ # Data seeding scripts
│ ├── validations/ # Input validation with Joi
│ └── app.ts # Main application entry point
│
├── tests/ # Unit tests
├── .env # Environment variables
├── package.json # Project dependencies
└── README.md # Project documentation
Make sure you have the following installed:
- Node.js:
v14.x
or later - MongoDB: Make sure you have a MongoDB instance running, either locally or via a service like MongoDB Atlas.
- TypeScript: Installed globally (
npm install -g typescript
)
Clone the repository and install the dependencies:
git clone https://github.com/your-username/vedic-shastra-api.git
cd vedic-shastra-api
npm install
Create a .env
file at the root of the project and configure the following environment variables:
PORT=5000
MONGODB_URI=mongodb://localhost/vedicshastra # Or your MongoDB connection string
Before running the API, you can seed the database with some initial data like categories and scriptures:
ts-node seed/categories.ts
ts-node seed/scriptures.ts
Start the server in development mode:
npm run dev
The API will be running at http://localhost:5000
.
-
GET /api/scriptures
Get all scriptures or filter by category, verse, or search term. -
GET /api/scriptures/:id
Get a specific scripture by ID. -
POST /api/scriptures
Add a new scripture (admin only). -
DELETE /api/scriptures/:id
Delete a specific scripture (admin only).
-
GET /api/categories
Retrieve all scripture categories (e.g., Vedas, Upanishads). -
POST /api/categories
Add a new category (admin only).
- GET /api/translations/:scriptureId
Retrieve all translations for a specific scripture.
curl http://localhost:5000/api/scriptures
curl http://localhost:5000/api/scriptures?search=Agni
curl http://localhost:5000/api/scriptures?category=Vedas
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, feel free to contact the project maintainer at [email protected].