CARE is a app dedicated to global well-being,education,training promotion mainly for children education and well-being.
This app is so global opinions,advice forums app Global development ideas sharing and talking app.
The CARE platform now features an integrated AI Assistant to help users with project activities, health information, and educational resources. The assistant is built using LangChain and OpenAI, with optional support for Google Search to provide up-to-date information.
To enable the AI Assistant, you need to set up the following environment variables in your .env file or environment:
-
OpenAI API Key (Required):
OPENAI_API_KEY=your_openai_api_keyYou can obtain this from the OpenAI Platform.
-
Google Search Integration (Optional): To allow the assistant to search the web for the latest information:
GOOGLE_API_KEY=your_google_api_key GOOGLE_CSE_ID=your_custom_search_engine_id- GOOGLE_API_KEY: Obtain from the Google Cloud Console. Enable the "Custom Search API".
- GOOGLE_CSE_ID: Create a Custom Search Engine at Google Programmable Search Engine and get the Search Engine ID.
Once configured, logged-in users can access the AI Assistant by navigating to the /chatbot route or clicking on the "AI Assistant" link in the navigation menu.
This project is licensed under the MIT License - see the LICENSE file for details.
This application is ready to be deployed as a containerized application on Tencent Cloud. Here are the steps to deploy it.
- A Tencent Cloud account.
- Docker installed on your local machine.
tcli, the Tencent Cloud CLI, installed and configured on your local machine.
First, build the Docker image for the application:
docker build -t care-app .-
Create a TCR instance: In the Tencent Cloud console, navigate to the Tencent Container Registry (TCR) service and create a new registry instance if you don't have one already.
-
Create a namespace: Within your TCR instance, create a new namespace (e.g.,
care-app-repo). -
Create a repository: In the namespace, create a new repository for the application image (e.g.,
care-app). -
Log in to TCR: Use the
tclior the Docker client to log in to your TCR instance. You will find the login command in the TCR console.docker login <your-tcr-instance-name>.tencentcloudcr.com -u <your-username> -p <your-password>
-
Tag and push the image: Tag your local Docker image with the TCR repository URL and push it:
docker tag care-app:latest <your-tcr-instance-name>.tencentcloudcr.com/<your-namespace>/care-app:latest docker push <your-tcr-instance-name>.tencentcloudcr.com/<your-namespace>/care-app:latest
This application uses a SQLite database by default, which is not suitable for production. You should set up a production-ready database, such as TencentDB for PostgreSQL.
-
Create a database instance: In the Tencent Cloud console, create a new TencentDB for PostgreSQL instance.
-
Configure the database: Create a new database and a user for the application.
-
Get the database URL: The database URL will be in the following format:
postgresql://<user>:<password>@<host>:<port>/<dbname>
You can deploy the application on either Tencent Kubernetes Engine (TKE) or Cloud Run.
-
Create a TKE cluster: If you don't have one, create a new TKE cluster in the Tencent Cloud console.
-
Create a deployment: Create a new deployment in your TKE cluster.
- Image: Use the TCR image URL from the previous step.
- Port: Expose port 5000.
- Environment Variables: Set the following environment variables:
SECRET_KEY: A long, random string for signing session cookies.DATABASE_URL: The URL of your production database.
-
Create a service: Create a service of type
LoadBalancerto expose the deployment to the internet.
- Create a Cloud Run service: In the Tencent Cloud console, navigate to the Cloud Run service and create a new service.
- Configure the service:
- Image: Select the TCR image you pushed earlier.
- Port: Set the container port to 5000.
- Environment Variables: Set the
SECRET_KEYandDATABASE_URLenvironment variables as described above.
- Deploy: Deploy the service. Cloud Run will provide you with a public URL for your application.
After your application is deployed and running, you can use Tencent Cloud EdgeOne to put a CDN in front of your application. This can help to improve performance, security, and reliability.
- Create an EdgeOne zone: In the EdgeOne console, create a new zone for your application's domain.
- Configure the origin: Set the origin to the public URL of your TKE service or Cloud Run service.
- Configure DNS: Update your domain's DNS records to point to the EdgeOne nameservers.