This Full Stack application uses React, Node.js, Express, and the OpenAI API to translate natural language into SQL queries. It allows users to interact with the Chinook sample SQLite database through easy-to-understand queries, making database interactions more intuitive and accessible.
- client: React
- server: Node.js, Express
- Database: SQLite (Chinook Sample DB)
- APIs: OpenAI, LangChain
- Natural language to SQL translation
- Query execution on Chinook DB
- User-friendly query results display
- Node.js (v14+)
- npm or yarn
- OpenAI API key
-
Clone the Repo
git clone https://github.com/empowerment-ai/full-stack-react-express-langchain-openai.git cd full-stack-react-express-langchain-openai
-
Install Dependencies
- client:
cd client && npm install
- server:
cd server && npm install
- client:
-
Set Up Environment
- Create a
.env
inserver
withOPENAI_API_KEY=your_key_here
.
- Create a
-
Run the server
cd server && npm start
-
Run the client
cd client && npm start
Visit http://localhost:3000.
Type a natural language query in the input field, e.g., "Show me all albums by AC/DC". The app translates it into SQL, executes it, and displays results.
Contributions are welcome. Feel free to submit pull requests or open issues for suggestions.
MIT License - see LICENSE file for details.