Text Analyzer Tool is a simple application built with React, Keycloak, TypeScript to analyze texts. The API provides endpoints to add texts, analyze them for the number of words, characters, sentences, paragraphs, and to find the longest words in the text.
Follow this url: https://github.com/Mueem-Nahid/text-analyzer-tool-backend
Video: https://drive.google.com/file/d/1YJt3VIW15heCDZsEfPwzpGfllm__KnUc/view?usp=sharing
- nodejs
- mongodb
- keycloak. Install and configure keycloak: https://www.keycloak.org/getting-started/getting-started-zip
-
Clone this repository:
git clone https://github.com/Mueem-Nahid/text-analyzer-frontend.git
-
Navigate into the project directory
-
Install dependencies: npm install
Add .env
file, add required config according to the .env.sample.
To run the server locally, execute:
npm run dev
The server will start listening on port 3000 by default. You can then access the API endpoints using tools like Postman or curl.
- React
- Tailwind css
- TS
- Redux toolkit, react query
- SSO (Oauth2.0, keycloak)
- Keycloak for SSO.
-
URL:
http://localhost:5000/api/v1/analyzer/
-
Method:
POST
-
Headers:
email: [email protected] Authorization: token
-
Request Body:
{ "text": "The quick brown fox jumps over the lazy dog. The lazy dog slept in the sun." }
-
Success Response:
-
Code:
201 Created
-
Content:
{ "success": true, "message": "Text inserted successfully !", "data": { "_id": "609f848e6aafb3d40a3f0db1", "text": "The quick brown fox jumps over the lazy dog. The lazy dog slept in the sun.", "email": "[email protected]", "createdAt": "2024-04-20T00:00:00.000Z", "updatedAt": "2024-04-20T00:00:00.000Z" } }
-
URL:
http://localhost:5000/api/v1/analyzer/
-
Method:
GET
-
Headers:
email: [email protected] Authorization: token
-
Success Response:
-
Code:
200 OK
-
Content:
[ { "success": true, "message": "Text inserted successfully !", "data": { "_id": "609f848e6aafb3d40a3f0db1", "text": "The quick brown fox jumps over the lazy dog. The lazy dog slept in the sun.", "email": "[email protected]", "createdAt": "2024-04-20T00:00:00.000Z", "updatedAt": "2024-04-20T00:00:00.000Z" } } ]
-
URL:
http://localhost:5000/api/v1/analyzer/:id
-
Method:
GET
-
Headers:
email: [email protected] Authorization: token
-
URL Params:
id=[integer]
-
Success Response:
-
Code:
200 OK
-
Content:
{ "success": true, "message": "Text inserted successfully !", "data": { "_id": "609f848e6aafb3d40a3f0db1", "text": "The quick brown fox jumps over the lazy dog. The lazy dog slept in the sun.", "email": "[email protected]", "createdAt": "2024-04-20T00:00:00.000Z", "updatedAt": "2024-04-20T00:00:00.000Z" } }
- URL:
http://localhost:5000/api/v1/analyzer/:id
- Method:
DELETE
- Headers:
email: [email protected] Authorization: token
- URL Params:
id=[integer]
- Success Response:
- Code:
204 No Content
-
URL:
http://localhost:5000/api/v1/analyzer/:id/words
-
Method:
GET
-
Headers:
email: [email protected] Authorization: token
-
Success Response:
-
Code:
200 OK
-
Content:
{ "success": true, "message": "Number of words fetched successfully !", "data": { "count": 9 } }
-
URL:
http://localhost:5000/api/v1/analyzer/:id/characters
-
Method:
GET
-
Headers:
email: [email protected] Authorization: token
-
Success Response:
-
Code:
200 OK
-
Content:
{ "success": true, "message": "Number of words fetched successfully !", "data": { "count": 9 } }
-
URL:
http://localhost:5000/api/v1/analyzer/:id/paragraphs
-
Method:
GET
-
Headers:
email: [email protected] Authorization: token
-
Success Response:
-
Code:
200 OK
-
Content:
{ "success": true, "message": "Number of words fetched successfully !", "data": { "count": 9 } }
-
URL:
http://localhost:5000/api/v1/analyzer/:id/sentences
-
Method:
GET
-
Headers:
email: [email protected] Authorization: token
-
Success Response:
-
Code:
200 OK
-
Content:
{ "success": true, "message": "Number of words fetched successfully !", "data": { "count": 9 } }
-
URL:
http://localhost:5000/api/v1/analyzer/:id/longest-words
-
Method:
GET
-
Headers:
email: [email protected] Authorization: token
-
Success Response:
-
Code:
200 OK
-
Content:
{ "success": true, "message": "Number of words fetched successfully !", "data": { "longestWords": ["aaabcd"] } }
- URL:
http://localhost:5000/api/v1/analyzer/report/:id
- Method:
GET
- Headers:
email: [email protected] Authorization: token
- Success Response:
- Code:
200 OK
This project is authored by Mueem Nahid.