Agri marketplace microservice implemented in golang This microservice is designed to provide a platform for managing agricultural products and shops in an online marketplace. It includes functionality for users, shops, products, and serviceable products. This README provides an overview of the microservice, its components, and how to set it up.
- User Management: Create, retrieve, update, and delete user profiles.
- Shop Management: Manage shop details, including location and operating hours.
- Product Catalog: Maintain a platform-level product catalog with detailed product attributes.
- Product Inventory: Allow shops to manage their product inventory.
- Serviceable Products: Determine and display serviceable products for users based on specific criteria.
- Geospatial Queries: Implement geospatial queries to find nearby shops and users.
Before running this microservice, ensure you have the following prerequisites installed:
- Go (version >= 1.15)
- MongoDB (running and accessible)
-
Clone this repository to your local machine.
-
Install the required Go dependencies:
go mod tidy
-
Configure your MongoDB connection in the
cmd/server/main.go
file. Update the MongoDB URI and database name as needed:clientOptions := options.Client().ApplyURI("mongodb://localhost:27017") database := client.Database("your_database_name")
-
Build and run the microservice:
go run cmd/server/main.go
The microservice should now be running on port 8080.
Here are the available API endpoints provided by this microservice (Not all are implemented yet; WIP ):
/users
: User-related endpoints (GET, POST, PUT, DELETE)/shops
: Shop-related endpoints (GET, POST, PUT, DELETE)/products
: Product-related endpoints (GET, POST, PUT, DELETE)/serviceable-products
: Serviceable product-related endpoints (GET)
This project is licensed under the MIT License.
Remember to replace placeholders such as `https://github.com/your/repository.git`, `mongodb://localhost:27017`, `your_database_name`, and other relevant details with your actual project information.