ynrng/chatbot
===========
online at https://chat.yanrong.wang/
===========
Features
- Next.js App Router
- Advanced routing for seamless navigation and performance
- React Server Components (RSCs) and Server Actions for server-side rendering and increased performance
- AI SDK
- Unified API for generating text, structured objects, and tool calls with LLMs
- Hooks for building dynamic chat and generative user interfaces
- Supports Google (default), OpenAI, Anthropic, Cohere, and other model providers
- shadcn/ui
- Styling with Tailwind CSS
- Component primitives from Radix UI for accessibility and flexibility
- Data Persistence
- Vercel Postgres powered by Neon for saving chat history and user data
- Vercel Blob for efficient object storage
- NextAuth.js
- Simple and secure authentication
Model Providers
This template ships with Google Gemini gemini-1.5-pro models as the default. However, with the AI SDK, you can switch LLM providers to OpenAI, Anthropic, Cohere, and many more with just a few lines of code.
Deploy Your Own
You can deploy your own version of the Next.js AI Chatbot to Vercel with one click:
Running locally
You will need to use the environment variables defined in .env.example to run Next.js AI Chatbot. It's recommended you use Vercel Environment Variables for this, but a .env file is all that is necessary.
Note: You should not commit your
.envfile or it will expose secrets that will allow others to control access to your various Google Cloud and authentication provider accounts.
- Install Vercel CLI:
npm i -g vercel - Link local instance with Vercel and GitHub accounts (creates
.verceldirectory):vercel link - Download your environment variables:
vercel env pull
pnpm install
pnpm devYour app template should now be running on localhost:3000.
Disclaimer:
Airport icons created by riajulislam - Flaticon
APIs and Docs
Flight
- AeroAPI Doc
- AeroApi usage : 5 dollars per month free quota
Realtime train
https://api.rtt.io/api/v1
https://www.realtimetrains.co.uk/about/developer/pull/docs/locationlist/
- Normal queries (live departures)
/json/search/<station> - Normal queries filtered to a location
/json/search/<station>/to/<toStation> - Queries for all services on a specific date
/json/search/<station>/<year>/<month>/<day> - Queries for services on a specific date and time
/json/search/<station>/<year>/<month>/<day>/<time>
https://www.realtimetrains.co.uk/about/developer/pull/docs/serviceinfo/
/json/service/<serviceUid>/<year>/<month>/<day>
Map related
Library usage
- supabase database connection with python
- https://wiki.openstreetmap.org/wiki/Railways_in_the_United_Kingdom
Todos Tracking
- [SOLVED][flight] check if /api/flight works
- [train] legs (might) need to be fixed:
TAM-BHM;CHC-GLQ;GLQ-HST;HST-GLQ;GLQ-CHC - [train] might want to actually read from route.
- Move all writing data to python script