Spaces:
Build error
Build error
Upload 11 files
Browse files- CONTRIBUTING.md +40 -0
- LICENSE +21 -0
- README.md +175 -11
- app.dockerfile +15 -0
- backend.dockerfile +17 -0
- config.toml +14 -0
- docker-compose.yaml +54 -0
- drizzle.config.ts +10 -0
- package.json +53 -0
- tsconfig.json +18 -0
- yarn.lock +0 -0
CONTRIBUTING.md
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# How to Contribute to Perplexica
|
2 |
+
|
3 |
+
Hey there, thanks for deciding to contribute to Perplexica. Anything you help with will support the development of Perplexica and will make it better. Let's walk you through the key aspects to ensure your contributions are effective and in harmony with the project's setup.
|
4 |
+
|
5 |
+
## Project Structure
|
6 |
+
|
7 |
+
Perplexica's design consists of two main domains:
|
8 |
+
|
9 |
+
- **Frontend (`ui` directory)**: This is a Next.js application holding all user interface components. It's a self-contained environment that manages everything the user interacts with.
|
10 |
+
- **Backend (root and `src` directory)**: The backend logic is situated in the `src` folder, but the root directory holds the main `package.json` for backend dependency management.
|
11 |
+
|
12 |
+
## Setting Up Your Environment
|
13 |
+
|
14 |
+
Before diving into coding, setting up your local environment is key. Here's what you need to do:
|
15 |
+
|
16 |
+
### Backend
|
17 |
+
|
18 |
+
1. In the root directory, locate the `sample.config.toml` file.
|
19 |
+
2. Rename it to `config.toml` and fill in the necessary configuration fields specific to the backend.
|
20 |
+
3. Run `npm install` to install dependencies.
|
21 |
+
4. Run `npm run db:push` to set up the local sqlite.
|
22 |
+
5. Use `npm run dev` to start the backend in development mode.
|
23 |
+
|
24 |
+
### Frontend
|
25 |
+
|
26 |
+
1. Navigate to the `ui` folder and repeat the process of renaming `.env.example` to `.env`, making sure to provide the frontend-specific variables.
|
27 |
+
2. Execute `npm install` within the `ui` directory to get the frontend dependencies ready.
|
28 |
+
3. Launch the frontend development server with `npm run dev`.
|
29 |
+
|
30 |
+
**Please note**: Docker configurations are present for setting up production environments, whereas `npm run dev` is used for development purposes.
|
31 |
+
|
32 |
+
## Coding and Contribution Practices
|
33 |
+
|
34 |
+
Before committing changes:
|
35 |
+
|
36 |
+
1. Ensure that your code functions correctly by thorough testing.
|
37 |
+
2. Always run `npm run format:write` to format your code according to the project's coding standards. This helps maintain consistency and code quality.
|
38 |
+
3. We currently do not have a code of conduct, but it is in the works. In the meantime, please be mindful of how you engage with the project and its community.
|
39 |
+
|
40 |
+
Following these steps will help maintain the integrity of Perplexica's codebase and facilitate a smoother integration of your valuable contributions. Thank you for your support and commitment to improving Perplexica.
|
LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2024 ItzCrazyKns
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
README.md
CHANGED
@@ -1,11 +1,175 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 🚀 Perplexica - An AI-powered search engine 🔎 <!-- omit in toc -->
|
2 |
+
|
3 |
+
![preview](.assets/perplexica-screenshot.png?)
|
4 |
+
|
5 |
+
## Table of Contents <!-- omit in toc -->
|
6 |
+
|
7 |
+
- [Overview](#overview)
|
8 |
+
- [Preview](#preview)
|
9 |
+
- [Features](#features)
|
10 |
+
- [Installation](#installation)
|
11 |
+
- [Getting Started with Docker (Recommended)](#getting-started-with-docker-recommended)
|
12 |
+
- [Non-Docker Installation](#non-docker-installation)
|
13 |
+
- [Ollama Connection Errors](#ollama-connection-errors)
|
14 |
+
- [Using as a Search Engine](#using-as-a-search-engine)
|
15 |
+
- [Using Perplexica's API](#using-perplexicas-api)
|
16 |
+
- [Expose Perplexica to a network](#expose-perplexica-to-network)
|
17 |
+
- [One-Click Deployment](#one-click-deployment)
|
18 |
+
- [Upcoming Features](#upcoming-features)
|
19 |
+
- [Support Us](#support-us)
|
20 |
+
- [Donations](#donations)
|
21 |
+
- [Contribution](#contribution)
|
22 |
+
- [Help and Support](#help-and-support)
|
23 |
+
|
24 |
+
## Overview
|
25 |
+
|
26 |
+
Perplexica is an open-source AI-powered searching tool or an AI-powered search engine that goes deep into the internet to find answers. Inspired by Perplexity AI, it's an open-source option that not just searches the web but understands your questions. It uses advanced machine learning algorithms like similarity searching and embeddings to refine results and provides clear answers with sources cited.
|
27 |
+
|
28 |
+
Using SearxNG to stay current and fully open source, Perplexica ensures you always get the most up-to-date information without compromising your privacy.
|
29 |
+
|
30 |
+
Want to know more about its architecture and how it works? You can read it [here](https://github.com/ItzCrazyKns/Perplexica/tree/master/docs/architecture/README.md).
|
31 |
+
|
32 |
+
## Preview
|
33 |
+
|
34 |
+
![video-preview](.assets/perplexica-preview.gif)
|
35 |
+
|
36 |
+
## Features
|
37 |
+
|
38 |
+
- **Local LLMs**: You can make use local LLMs such as Llama3 and Mixtral using Ollama.
|
39 |
+
- **Two Main Modes:**
|
40 |
+
- **Copilot Mode:** (In development) Boosts search by generating different queries to find more relevant internet sources. Like normal search instead of just using the context by SearxNG, it visits the top matches and tries to find relevant sources to the user's query directly from the page.
|
41 |
+
- **Normal Mode:** Processes your query and performs a web search.
|
42 |
+
- **Focus Modes:** Special modes to better answer specific types of questions. Perplexica currently has 6 focus modes:
|
43 |
+
- **All Mode:** Searches the entire web to find the best results.
|
44 |
+
- **Writing Assistant Mode:** Helpful for writing tasks that does not require searching the web.
|
45 |
+
- **Academic Search Mode:** Finds articles and papers, ideal for academic research.
|
46 |
+
- **YouTube Search Mode:** Finds YouTube videos based on the search query.
|
47 |
+
- **Wolfram Alpha Search Mode:** Answers queries that need calculations or data analysis using Wolfram Alpha.
|
48 |
+
- **Reddit Search Mode:** Searches Reddit for discussions and opinions related to the query.
|
49 |
+
- **Current Information:** Some search tools might give you outdated info because they use data from crawling bots and convert them into embeddings and store them in a index. Unlike them, Perplexica uses SearxNG, a metasearch engine to get the results and rerank and get the most relevant source out of it, ensuring you always get the latest information without the overhead of daily data updates.
|
50 |
+
- **API**: Integrate Perplexica into your existing applications and make use of its capibilities.
|
51 |
+
|
52 |
+
It has many more features like image and video search. Some of the planned features are mentioned in [upcoming features](#upcoming-features).
|
53 |
+
|
54 |
+
## Installation
|
55 |
+
|
56 |
+
There are mainly 2 ways of installing Perplexica - With Docker, Without Docker. Using Docker is highly recommended.
|
57 |
+
|
58 |
+
### Getting Started with Docker (Recommended)
|
59 |
+
|
60 |
+
1. Ensure Docker is installed and running on your system.
|
61 |
+
2. Clone the Perplexica repository:
|
62 |
+
|
63 |
+
```bash
|
64 |
+
git clone https://github.com/ItzCrazyKns/Perplexica.git
|
65 |
+
```
|
66 |
+
|
67 |
+
3. After cloning, navigate to the directory containing the project files.
|
68 |
+
|
69 |
+
4. Rename the `sample.config.toml` file to `config.toml`. For Docker setups, you need only fill in the following fields:
|
70 |
+
|
71 |
+
- `OPENAI`: Your OpenAI API key. **You only need to fill this if you wish to use OpenAI's models**.
|
72 |
+
- `OLLAMA`: Your Ollama API URL. You should enter it as `http://host.docker.internal:PORT_NUMBER`. If you installed Ollama on port 11434, use `http://host.docker.internal:11434`. For other ports, adjust accordingly. **You need to fill this if you wish to use Ollama's models instead of OpenAI's**.
|
73 |
+
- `GROQ`: Your Groq API key. **You only need to fill this if you wish to use Groq's hosted models**.
|
74 |
+
- `ANTHROPIC`: Your Anthropic API key. **You only need to fill this if you wish to use Anthropic models**.
|
75 |
+
|
76 |
+
**Note**: You can change these after starting Perplexica from the settings dialog.
|
77 |
+
|
78 |
+
- `SIMILARITY_MEASURE`: The similarity measure to use (This is filled by default; you can leave it as is if you are unsure about it.)
|
79 |
+
|
80 |
+
5. Ensure you are in the directory containing the `docker-compose.yaml` file and execute:
|
81 |
+
|
82 |
+
```bash
|
83 |
+
docker compose up -d
|
84 |
+
```
|
85 |
+
|
86 |
+
6. Wait a few minutes for the setup to complete. You can access Perplexica at http://localhost:3000 in your web browser.
|
87 |
+
|
88 |
+
**Note**: After the containers are built, you can start Perplexica directly from Docker without having to open a terminal.
|
89 |
+
|
90 |
+
### Non-Docker Installation
|
91 |
+
|
92 |
+
1. Install SearXNG and allow `JSON` format in the SearXNG settings.
|
93 |
+
2. Clone the repository and rename the `sample.config.toml` file to `config.toml` in the root directory. Ensure you complete all required fields in this file.
|
94 |
+
3. Rename the `.env.example` file to `.env` in the `ui` folder and fill in all necessary fields.
|
95 |
+
4. After populating the configuration and environment files, run `npm i` in both the `ui` folder and the root directory.
|
96 |
+
5. Install the dependencies and then execute `npm run build` in both the `ui` folder and the root directory.
|
97 |
+
6. Finally, start both the frontend and the backend by running `npm run start` in both the `ui` folder and the root directory.
|
98 |
+
|
99 |
+
**Note**: Using Docker is recommended as it simplifies the setup process, especially for managing environment variables and dependencies.
|
100 |
+
|
101 |
+
See the [installation documentation](https://github.com/ItzCrazyKns/Perplexica/tree/master/docs/installation) for more information like exposing it your network, etc.
|
102 |
+
|
103 |
+
### Ollama Connection Errors
|
104 |
+
|
105 |
+
If you're encountering an Ollama connection error, it is likely due to the backend being unable to connect to Ollama's API. To fix this issue you can:
|
106 |
+
|
107 |
+
1. **Check your Ollama API URL:** Ensure that the API URL is correctly set in the settings menu.
|
108 |
+
2. **Update API URL Based on OS:**
|
109 |
+
|
110 |
+
- **Windows:** Use `http://host.docker.internal:11434`
|
111 |
+
- **Mac:** Use `http://host.docker.internal:11434`
|
112 |
+
- **Linux:** Use `http://<private_ip_of_host>:11434`
|
113 |
+
|
114 |
+
Adjust the port number if you're using a different one.
|
115 |
+
|
116 |
+
3. **Linux Users - Expose Ollama to Network:**
|
117 |
+
|
118 |
+
- Inside `/etc/systemd/system/ollama.service`, you need to add `Environment="OLLAMA_HOST=0.0.0.0"`. Then restart Ollama by `systemctl restart ollama`. For more information see [Ollama docs](https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-linux)
|
119 |
+
|
120 |
+
- Ensure that the port (default is 11434) is not blocked by your firewall.
|
121 |
+
|
122 |
+
## Using as a Search Engine
|
123 |
+
|
124 |
+
If you wish to use Perplexica as an alternative to traditional search engines like Google or Bing, or if you want to add a shortcut for quick access from your browser's search bar, follow these steps:
|
125 |
+
|
126 |
+
1. Open your browser's settings.
|
127 |
+
2. Navigate to the 'Search Engines' section.
|
128 |
+
3. Add a new site search with the following URL: `http://localhost:3000/?q=%s`. Replace `localhost` with your IP address or domain name, and `3000` with the port number if Perplexica is not hosted locally.
|
129 |
+
4. Click the add button. Now, you can use Perplexica directly from your browser's search bar.
|
130 |
+
|
131 |
+
## Using Perplexica's API
|
132 |
+
|
133 |
+
Perplexica also provides an API for developers looking to integrate its powerful search engine into their own applications. You can run searches, use multiple models and get answers to your queries.
|
134 |
+
|
135 |
+
For more details, check out the full documentation [here](https://github.com/ItzCrazyKns/Perplexica/tree/master/docs/API/SEARCH.md).
|
136 |
+
|
137 |
+
## Expose Perplexica to network
|
138 |
+
|
139 |
+
You can access Perplexica over your home network by following our networking guide [here](https://github.com/ItzCrazyKns/Perplexica/blob/master/docs/installation/NETWORKING.md).
|
140 |
+
|
141 |
+
## One-Click Deployment
|
142 |
+
|
143 |
+
[![Deploy to RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploylobe.svg)](https://repocloud.io/details/?app_id=267)
|
144 |
+
|
145 |
+
## Upcoming Features
|
146 |
+
|
147 |
+
- [x] Add settings page
|
148 |
+
- [x] Adding support for local LLMs
|
149 |
+
- [x] History Saving features
|
150 |
+
- [x] Introducing various Focus Modes
|
151 |
+
- [x] Adding API support
|
152 |
+
- [x] Adding Discover
|
153 |
+
- [ ] Finalizing Copilot Mode
|
154 |
+
|
155 |
+
## Support Us
|
156 |
+
|
157 |
+
If you find Perplexica useful, consider giving us a star on GitHub. This helps more people discover Perplexica and supports the development of new features. Your support is greatly appreciated.
|
158 |
+
|
159 |
+
### Donations
|
160 |
+
|
161 |
+
We also accept donations to help sustain our project. If you would like to contribute, you can use the following options to donate. Thank you for your support!
|
162 |
+
|
163 |
+
| Ethereum |
|
164 |
+
| ----------------------------------------------------- |
|
165 |
+
| Address: `0xB025a84b2F269570Eb8D4b05DEdaA41D8525B6DD` |
|
166 |
+
|
167 |
+
## Contribution
|
168 |
+
|
169 |
+
Perplexica is built on the idea that AI and large language models should be easy for everyone to use. If you find bugs or have ideas, please share them in via GitHub Issues. For more information on contributing to Perplexica you can read the [CONTRIBUTING.md](CONTRIBUTING.md) file to learn more about Perplexica and how you can contribute to it.
|
170 |
+
|
171 |
+
## Help and Support
|
172 |
+
|
173 |
+
If you have any questions or feedback, please feel free to reach out to us. You can create an issue on GitHub or join our Discord server. There, you can connect with other users, share your experiences and reviews, and receive more personalized help. [Click here](https://discord.gg/EFwsmQDgAu) to join the Discord server. To discuss matters outside of regular support, feel free to contact me on Discord at `itzcrazykns`.
|
174 |
+
|
175 |
+
Thank you for exploring Perplexica, the AI-powered search engine designed to enhance your search experience. We are constantly working to improve Perplexica and expand its capabilities. We value your feedback and contributions which help us make Perplexica even better. Don't forget to check back for updates and new features!
|
app.dockerfile
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM node:20.18.0-alpine
|
2 |
+
|
3 |
+
ARG NEXT_PUBLIC_WS_URL=ws://127.0.0.1:3001
|
4 |
+
ARG NEXT_PUBLIC_API_URL=http://127.0.0.1:3001/api
|
5 |
+
ENV NEXT_PUBLIC_WS_URL=${NEXT_PUBLIC_WS_URL}
|
6 |
+
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
7 |
+
|
8 |
+
WORKDIR /home/perplexica
|
9 |
+
|
10 |
+
COPY ui /home/perplexica/
|
11 |
+
|
12 |
+
RUN yarn install --frozen-lockfile
|
13 |
+
RUN yarn build
|
14 |
+
|
15 |
+
CMD ["yarn", "start"]
|
backend.dockerfile
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM node:18-slim
|
2 |
+
|
3 |
+
WORKDIR /home/perplexica
|
4 |
+
|
5 |
+
COPY src /home/perplexica/src
|
6 |
+
COPY tsconfig.json /home/perplexica/
|
7 |
+
COPY drizzle.config.ts /home/perplexica/
|
8 |
+
COPY package.json /home/perplexica/
|
9 |
+
COPY yarn.lock /home/perplexica/
|
10 |
+
|
11 |
+
RUN mkdir /home/perplexica/data
|
12 |
+
RUN mkdir /home/perplexica/uploads
|
13 |
+
|
14 |
+
RUN yarn install --frozen-lockfile --network-timeout 600000
|
15 |
+
RUN yarn build
|
16 |
+
|
17 |
+
CMD ["yarn", "start"]
|
config.toml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[API_KEYS]
|
2 |
+
OPENAI = ""
|
3 |
+
GROQ = "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"
|
4 |
+
ANTHROPIC = ""
|
5 |
+
GEMINI = ""
|
6 |
+
|
7 |
+
[API_ENDPOINTS]
|
8 |
+
OLLAMA = ""
|
9 |
+
SEARXNG = "http://localhost:32768"
|
10 |
+
|
11 |
+
[GENERAL]
|
12 |
+
PORT = 3_001
|
13 |
+
SIMILARITY_MEASURE = "cosine"
|
14 |
+
KEEP_ALIVE = "5m"
|
docker-compose.yaml
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
services:
|
2 |
+
searxng:
|
3 |
+
image: docker.io/searxng/searxng:latest
|
4 |
+
volumes:
|
5 |
+
- ./searxng:/etc/searxng:rw
|
6 |
+
ports:
|
7 |
+
- 4000:8080
|
8 |
+
networks:
|
9 |
+
- perplexica-network
|
10 |
+
restart: unless-stopped
|
11 |
+
|
12 |
+
perplexica-backend:
|
13 |
+
build:
|
14 |
+
context: .
|
15 |
+
dockerfile: backend.dockerfile
|
16 |
+
image: itzcrazykns1337/perplexica-backend:main
|
17 |
+
environment:
|
18 |
+
- SEARXNG_API_URL=http://searxng:8080
|
19 |
+
depends_on:
|
20 |
+
- searxng
|
21 |
+
ports:
|
22 |
+
- 3001:3001
|
23 |
+
volumes:
|
24 |
+
- backend-dbstore:/home/perplexica/data
|
25 |
+
- uploads:/home/perplexica/uploads
|
26 |
+
- ./config.toml:/home/perplexica/config.toml
|
27 |
+
extra_hosts:
|
28 |
+
- 'host.docker.internal:host-gateway'
|
29 |
+
networks:
|
30 |
+
- perplexica-network
|
31 |
+
restart: unless-stopped
|
32 |
+
|
33 |
+
perplexica-frontend:
|
34 |
+
build:
|
35 |
+
context: .
|
36 |
+
dockerfile: app.dockerfile
|
37 |
+
args:
|
38 |
+
- NEXT_PUBLIC_API_URL=http://127.0.0.1:3001/api
|
39 |
+
- NEXT_PUBLIC_WS_URL=ws://127.0.0.1:3001
|
40 |
+
image: itzcrazykns1337/perplexica-frontend:main
|
41 |
+
depends_on:
|
42 |
+
- perplexica-backend
|
43 |
+
ports:
|
44 |
+
- 3000:3000
|
45 |
+
networks:
|
46 |
+
- perplexica-network
|
47 |
+
restart: unless-stopped
|
48 |
+
|
49 |
+
networks:
|
50 |
+
perplexica-network:
|
51 |
+
|
52 |
+
volumes:
|
53 |
+
backend-dbstore:
|
54 |
+
uploads:
|
drizzle.config.ts
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { defineConfig } from 'drizzle-kit';
|
2 |
+
|
3 |
+
export default defineConfig({
|
4 |
+
dialect: 'sqlite',
|
5 |
+
schema: './src/db/schema.ts',
|
6 |
+
out: './drizzle',
|
7 |
+
dbCredentials: {
|
8 |
+
url: './data/db.sqlite',
|
9 |
+
},
|
10 |
+
});
|
package.json
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "perplexica-backend",
|
3 |
+
"version": "1.10.0-rc2",
|
4 |
+
"license": "MIT",
|
5 |
+
"author": "ItzCrazyKns",
|
6 |
+
"scripts": {
|
7 |
+
"start": "npm run db:push && node dist/app.js",
|
8 |
+
"build": "tsc",
|
9 |
+
"dev": "nodemon --ignore uploads/ src/app.ts ",
|
10 |
+
"db:push": "drizzle-kit push sqlite",
|
11 |
+
"format": "prettier . --check",
|
12 |
+
"format:write": "prettier . --write"
|
13 |
+
},
|
14 |
+
"devDependencies": {
|
15 |
+
"@types/better-sqlite3": "^7.6.10",
|
16 |
+
"@types/cors": "^2.8.17",
|
17 |
+
"@types/express": "^4.17.21",
|
18 |
+
"@types/html-to-text": "^9.0.4",
|
19 |
+
"@types/multer": "^1.4.12",
|
20 |
+
"@types/pdf-parse": "^1.1.4",
|
21 |
+
"@types/readable-stream": "^4.0.11",
|
22 |
+
"@types/ws": "^8.5.12",
|
23 |
+
"drizzle-kit": "^0.22.7",
|
24 |
+
"nodemon": "^3.1.0",
|
25 |
+
"prettier": "^3.2.5",
|
26 |
+
"ts-node": "^10.9.2",
|
27 |
+
"typescript": "^5.4.3"
|
28 |
+
},
|
29 |
+
"dependencies": {
|
30 |
+
"@iarna/toml": "^2.2.5",
|
31 |
+
"@langchain/anthropic": "^0.2.3",
|
32 |
+
"@langchain/community": "^0.2.16",
|
33 |
+
"@langchain/openai": "^0.0.25",
|
34 |
+
"@langchain/google-genai": "^0.0.23",
|
35 |
+
"@xenova/transformers": "^2.17.1",
|
36 |
+
"axios": "^1.6.8",
|
37 |
+
"better-sqlite3": "^11.0.0",
|
38 |
+
"compute-cosine-similarity": "^1.1.0",
|
39 |
+
"compute-dot": "^1.1.0",
|
40 |
+
"cors": "^2.8.5",
|
41 |
+
"dotenv": "^16.4.5",
|
42 |
+
"drizzle-orm": "^0.31.2",
|
43 |
+
"express": "^4.19.2",
|
44 |
+
"html-to-text": "^9.0.5",
|
45 |
+
"langchain": "^0.1.30",
|
46 |
+
"mammoth": "^1.8.0",
|
47 |
+
"multer": "^1.4.5-lts.1",
|
48 |
+
"pdf-parse": "^1.1.1",
|
49 |
+
"winston": "^3.13.0",
|
50 |
+
"ws": "^8.17.1",
|
51 |
+
"zod": "^3.22.4"
|
52 |
+
}
|
53 |
+
}
|
tsconfig.json
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"compilerOptions": {
|
3 |
+
"lib": ["ESNext"],
|
4 |
+
"module": "Node16",
|
5 |
+
"moduleResolution": "Node16",
|
6 |
+
"target": "ESNext",
|
7 |
+
"outDir": "dist",
|
8 |
+
"sourceMap": false,
|
9 |
+
"esModuleInterop": true,
|
10 |
+
"experimentalDecorators": true,
|
11 |
+
"emitDecoratorMetadata": true,
|
12 |
+
"allowSyntheticDefaultImports": true,
|
13 |
+
"skipLibCheck": true,
|
14 |
+
"skipDefaultLibCheck": true
|
15 |
+
},
|
16 |
+
"include": ["src"],
|
17 |
+
"exclude": ["node_modules", "**/*.spec.ts"]
|
18 |
+
}
|
yarn.lock
ADDED
The diff for this file is too large to render.
See raw diff
|
|