A weather application built with Mastra framework that provides weather information and activity suggestions based on current conditions.
- Weather information retrieval using Open-Meteo API
- AI-powered activity suggestions based on weather conditions
- RESTful API endpoints for agents and workflows
- Interactive playground UI
- Node.js (v14 or higher)
- npm or yarn
- Google Generative AI API key (for Gemini integration)
-
Clone the repository:
git clone [email protected]:delightech/my-mastra-app.git cd my-mastra-app
-
Install dependencies:
npm install
-
Configure environment variables:
cp .env.example .env
Then edit
.envand add your Google AI API key:GOOGLE_GENERATIVE_AI_API_KEY=your_actual_api_key_hereYou can get your API key from: https://makersuite.google.com/app/apikey
Start the development server:
npm run devThe server will start at http://localhost:4111
GET /api/agents- List all available agentsGET /api/agents/:agentId- Get details of a specific agentPOST /api/agents/:agentId/text- Chat with an agent
GET /api/workflows- List all available workflowsGET /api/workflows/:workflowId- Get details of a specific workflowPOST /api/workflows/:workflowId/execute- Execute a workflow
Run the included test script:
node test-mastra-api.mjsThis will test all API endpoints and display the results.
├── src/
│ └── mastra/
│ ├── index.ts # Main Mastra configuration
│ ├── agents/ # AI agents
│ │ └── weather-agent.ts
│ ├── tools/ # Custom tools
│ │ └── weather-tool.ts
│ └── workflows/ # Workflow definitions
│ └── weather-workflow.ts
├── .env.example # Example environment variables
├── package.json
├── tsconfig.json
└── test-mastra-api.mjs # API test script
- Never commit your
.envfile to version control - The
.envfile is already included in.gitignore - Always use environment variables for sensitive data like API keys
This project is open source and available under the MIT License.