A modern, efficient solution for managing product catalogs in the Open Network for Digital Commerce (ONDC) ecosystem.
The Global Catalog Registry (GCR) is designed to solve the NxN integration problem in ONDC by providing a centralized catalog system. This reduces complexity from NxN to N+N, making the system more efficient and scalable.
- 🔍 Fast and efficient product search
- 🔄 Real-time catalog updates
- 💾 Redis caching for improved performance
- 🔌 Seamless integration with Buyer Apps
- 📊 Consistent product data schema
- 🖼️ Media storage with BunnyCDN
- Frontend: Next.js 14 with TypeScript
- Styling: Tailwind CSS
- Backend: Next.js API Routes
- Database: MongoDB with Prisma ORM
- Caching: Redis
- Storage: BunnyCDN Storage & CDN
- AI Integration: Groq for search optimization and recommendations
- Node.js 18.x or later
- Redis server
- MongoDB database (local or Atlas)
- BunnyCDN account with Storage Zone and Pull Zone
- Groq API key
Create a .env file in the root directory with the following variables:
DATABASE_URL="mongodb+srv://username:password@cluster.mongodb.net/ondc_gcr?retryWrites=true&w=majority"
REDIS_URL="redis://localhost:6379"
BUNNYCDN_STORAGE_ZONE_NAME="your-storage-zone-name"
BUNNYCDN_STORAGE_PASSWORD="your-storage-password"
BUNNYCDN_PULL_ZONE_URL="https://your-pull-zone.b-cdn.net"
GROQ_API_KEY="your_groq_api_key"-
Clone the repository:
git clone https://github.com/yourusername/ondc-gcr-project.git cd ondc-gcr-project -
Install dependencies:
npm install
-
Set up the database:
npx prisma generate npx prisma db push
-
Start the development server:
npm run dev
The application will be available at http://localhost:3000.
📂 ondc-gcr-project
├── 📂 src
│ ├── 📂 app
│ │ ├── 📂 api
│ │ │ ├── search
│ │ │ │ └── route.ts
│ │ │ └── upload
│ │ │ └── route.ts
│ │ └── page.tsx
│ ├── 📂 components
│ │ ├── SearchBar.tsx
│ │ ├── ProductList.tsx
│ │ └── AdapterLayer.tsx
│ └── 📂 lib
│ ├── redis.ts
│ ├── prisma.ts
│ └── bunnycdn.ts
├── prisma
│ └── schema.prisma
└── package.json
- Endpoint:
/api/search - Method: GET
- Query Parameters:
q: Search query string
- Response: Array of products matching the search criteria
- Endpoint:
/api/upload - Method: POST
- Content-Type: multipart/form-data
- Body:
file: The file to upload
- Response: Object containing the uploaded file URL
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- ONDC Network
- Next.js team
- Redis team
- BunnyCDN team
- Groq team