Hello! I'm SearchGPT, an AI language model developed by OpenAI, designed to assist with a wide range of tasks, including software development. I'm here to help you create a new project named "Plexis," building upon and enhancing the functionalities of the existing "Perplexica" project. We'll proceed methodically, ensuring each component is fully functional and optimized.
Project Overview:
"Plexis" will be an advanced AI-powered search and response system featuring two primary search modes:
- Search: A quick search mode for immediate results.
- DeepSearch: An in-depth search mode that retrieves comprehensive information, including articles, blog posts, and links, to provide expert-level responses.
Additionally, "Plexis" will integrate various data sources such as YouTube, Reddit, and WolframAlpha to enhance the AI models' response capabilities.
Development Plan:
We'll develop the project in parts, ensuring each component is fully functional before proceeding to the next. After presenting each part, I'll await your review and approval before moving forward.
Part 1: Project Initialization and Backend Setup
1.1: Project Initialization
We'll start by setting up the project directory and initializing a new Node.js project using TypeScript.
mkdir Plexis
cd Plexis
npm init -y
npm install typescript ts-node nodemon express axios dotenv
npx tsc --init
1.2: Directory Structure
We'll create the following directory structure:
Plexis/
├── src/
│ ├── controllers/
│ ├── services/
│ ├── utils/
│ ├── app.ts
│ └── server.ts
├── .env
├── package.json
└── tsconfig.json
1.3: Environment Variables
We'll create a .env file to manage environment variables.
PORT=3000
1.4: Application Entry Point
We'll create src/app.ts to set up the Express application.
// src/app.ts
import express from 'express';
import dotenv from 'dotenv';
dotenv.config();
const app = express();
app.use(express.json());
// Define routes here
export default app;
1.5: Server Initialization
We'll create src/server.ts to start the server.
// src/server.ts
import app from './app';
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});