diff --git a/.env.sample b/.env.sample index d6fef76..4ac5e93 100644 --- a/.env.sample +++ b/.env.sample @@ -7,10 +7,10 @@ TWILIO_ACCOUNT_SID= TWILIO_AUTH_TOKEN= TWILIO_NUMBER= TEST_RECEPIENT_NUMBER= -STRAPI_TOURISM_TOKEN= GOOGLE_MAPS_API_KEY=your_api_key_here SERVER_URL=http://13.201.62.138:3001 DEVELOPER_MODE_ON=0 +STRAPI_TOURISM_TOKEN= STRAPI_RETAIL_TOKEN= STRAPI_ENERGY_TOKEN= STRAPI_HOTEL_TOKEN= diff --git a/README.md b/README.md index d64f247..4689c7c 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,44 @@ -# beckn-action-bot -This is an open source project that creates an action bot which can take plain text inputs and take beckn based actions based on them. +## Description +`beckn-action-bot` is an open-source project built on Node.js, integrating OpenAI and the Beckn protocol to enable economic transactions across the Beckn open network using simple text inputs from users. +The primary objective of this AI assistant is to facilitate daily tasks such as ordering food, booking taxis, finding and navigating routes, scheduling appointments, and purchasing groceries, among others. -## Instructions +Key Features: +1. Functions as a traditional chatbot by answering questions using GPT-3.5. +2. Executes transactions on the Beckn open network. +3. Retrieves routes from Google Maps and searches for items en route. +4. Provides integration with WhatsApp and custom GPT models. +5. Compatible with various chat interfaces. -1. The script runs both in local environment as well as docker containers. Its recommended to use docker containers for local development as well as testing -2. Test Driven Approach should be used for development. Write the test case first then write the code. +## How it works? -## Steps to setup +[Simple booking using whatsapp](https://github-production-user-asset-6210df.s3.amazonaws.com/4734717/323161316-15011025-e7e0-4395-af4a-4525c2626cbd.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240417%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240417T142821Z&X-Amz-Expires=300&X-Amz-Signature=310e9271d842dee075fb7ae5b81db869bfe1f302d58251be82ed4ac23edf3b22&X-Amz-SignedHeaders=host&actor_id=4734717&key_id=0&repo_id=776644490) + +[Searching along a route](https://github-production-user-asset-6210df.s3.amazonaws.com/4734717/323161620-2e5a4da7-fc10-4308-9678-9d6bfa7e3ee7.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240417%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240417T144741Z&X-Amz-Expires=300&X-Amz-Signature=713eead793bafb69dc798aca76a8edc8240f6c04517c973aabbaca449a983d7b&X-Amz-SignedHeaders=host&actor_id=4734717&key_id=0&repo_id=776644490) + + +## Installation + +``` +git clone https://github.com/beckn/beckn-action-bot +cd beckn-action-bot +npm i +``` + + +## Pre-requisites +1. **OpenAI access token** : Obtain an open AI access token to use open AI LLMs. [Here](https://platform.openai.com/docs/quickstart/account-setup) is a quick guide on how to do this. + +2. **Twilio access token** : The project uses twilio to send and receive messages from Whatsapp. You can skip this step if you plan to use the project in API only mode. You can read more about Twilio access token [here](https://www.twilio.com/docs/iam/access-tokens). + +3. **Google maps API key** :The project uses Google maps for fetching route polylines. You will need the Google maps API key if you plan to use it + + + +## Usage + +1. Copy `.env.sample` to `.env` and set your environment variables. This is the step where you will need to set your access tokens as mentioned in the step above. -1. Copy `.env.sample` to `.env` and set your environment variables 2. To run the node server, run: ``` @@ -17,7 +46,7 @@ npm run dev # for debugging npm run docker:dev # for docker ``` -## Steps to run tests +### Steps to run tests To run test cases, run: @@ -29,7 +58,7 @@ npm run test:unit # to run unit tests npm run docker:test ``` -## Steps to run lint tests +### Steps to run lint tests We use eslint to check for linting errors. The rules for eslint are configured under `.eslint.json` file. Use the following command to run the eslint tests: @@ -38,7 +67,7 @@ npm run lint ``` -## Steps to prettify +### Steps to prettify We use prettier to prettify the code. Run the following command to prettify: @@ -48,21 +77,26 @@ npm run prettify If you want to change the prettier rules, edit the `.prettierrc.json` file -## Steps to deploy +## Contributing +This is an open source project and everyone is welcome to chime in. Here is how you can contribute: -``` -# build -docker-compose build +1. Checkout the list of open issues [here](https://github.com/beckn/beckn-action-bot/issues), and select the one that you are intersted in +2. If you have any idea, suggestion or you discover an issue, create a discussion for it [here](https://github.com/beckn/beckn-action-bot/discussions) +3. To raise a PR: Fork the project + 1. Create your feature branch (git checkout -b feature/amazing-feature) + 2. Commit your changes (git commit -am 'Add some amazing feature') + 3. Push to the branch (git push origin feature/amazing-feature) + 4. Open a Pull Request +4. Best practices: + 1. Follow the code structure + 2. Use test driven development + 3. Describe your PRs or issues in detail for the developers to understand. There are PR templates and issue templates configured in the project which can be used for understanding the structure. -# Biuld on mac m1 -DOCKER_DEFAULT_PLATFORM=linux/amd64 docker-compose build +## License -docker-compose push -``` +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details + +## Support +For support, join our [Discord channel](https://bit.ly/bocWebInvite) or open an issue. -On the server -``` -docker-compose pull -docker-compose up -d -```