This project is a Full Text Search Engine powered by MongoDB and developed using TypeScript with Express that saves the headline and the url of an online article. It provides a foundation for creating applications or services that require full text search capabilities and supports fuzzy search for more flexible text matching.
I had a problem
Months ago, wanting to stay up-to-date with k8s world, I signed up for a newsletter wich sends me an email with a lot of useful "How to" guides and some insightful articles. Unfortunately, most articles remain unread, and when I will need them in the future, I will have forgotten that I already have the solution.
This is why this project is born: this is a way to save title and URL of an article, and when I need them, I will first search in my personal database
Before you can run this project, make sure you have the following prerequisites installed on your system:
- Node.js: You can download and install Node.js from nodejs.org.
- MongoDB: Ensure you have MongoDB installed locally or access to a MongoDB server.
-
Clone the repository to your local machine:
git clone https://github.com/aleRizzolo/MongoTextQuery.git
-
Change into the project directory:
cd MongoTextQuery/server
-
Create a
.env
file by copying the contents from.env.sample
. You can do this manually or use the following command:cp .env.sample .env
Edit the
.env
file and replace the placeholder values with your MongoDB connection details. -
Install the project dependencies using npm:
npm install
-
Build the application:
npm run build
The Full Text Search Engine should now be up and running on http://localhost:3000
(or 8080 if PORT variable is not defined).
The project has the following structure:
server/
: Contains all the server directoriessrc/
: Contains the TypeScript source code.routes/
: Define your API routes here.models/
: Define your MongoDB data models.types/
: Define the types for the models and for the routes.
utils/
: Contains logger configuration.db.ts
: Connection to the Databaseindex.ts
: The main entry point of the application.
If you would like to contribute to this project, please open an issue or create a pull request on the GitHub repository.