-
- NestJS (Backend)
- Vite (Frontend)
- MySQL (Database)
- TypeORM (ORM)
- Tailwind CSS (Styling) -> very basic styling though
- Logger (Winston) -> can be found inside combined.log, error.log
- NestJS Throttler (Rate Limiting) -> please check app module ts and it has overriden once at text-analyzer controller
- concurrently (npm package) -> to run frontend and backend concurrently
- SSO using auth0
- Too Many Requests (429) -> custom exception page at frontend
- 404 page -> frontend when no route found
- Swagger API Documentation ->
http://localhost:5000/api
-
git clone https://github.com/ashraf-kabir/text-analyzer.git
-
cd text-analyzer
# chmod +x initialize.sh ./initialize.sh
./initialize.bat
-
CREATE DATABASE text_analyzer; USE text_analyzer; DROP TABLE IF EXISTS `text`; CREATE TABLE `text` ( `id` int NOT NULL AUTO_INCREMENT, `content` text NOT NULL, `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; INSERT INTO `text` (`id`, `content`, `createdAt`) VALUES (1, 'Random Text. Test Hello Dhaka.\nTest 123', '2024-09-28 01:27:04'), (2, 'Scar tissue that I wish you saw. Sarcastic mister know-it-all.', '2024-09-28 09:12:51'), (3, 'New text', '2024-09-28 11:17:28'), (4, 'Random evening', '2024-09-28 14:44:39');
-
npm run dev
-
http://localhost:5173
-
http://localhost:5000
-
-
-
Add Text CURL
curl --location 'http://localhost:5000/api/v1/text-analyzer' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <TOKEN>' \ --data '{ "text": "Scar tissue that I wish you saw. Sarcastic mister know-it-all." }'
-
Get Texts CURL
curl --location 'http://localhost:5000/api/v1/text-analyzer' \ --header 'Authorization: Bearer <TOKEN>'
-
Get Text by ID CURL
curl --location 'http://localhost:5000/api/v1/text-analyzer/1' \ --header 'Authorization: Bearer <TOKEN>'
-
Update Text by ID CURL
curl --location --request PUT 'http://localhost:5000/api/v1/text-analyzer/1' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <Token>' \ --data '{ "text": "Random Text." }'
-
Delete Text by ID CURL
curl --location --request DELETE 'http://localhost:5000/api/v1/text-analyzer/1' \ --header 'Authorization: Bearer <Token>'
-
-
- Count Words
curl --location 'http://localhost:5000/api/v1/text-analyzer/count-words/1' \ --header 'Authorization: Bearer <TOKEN>'
- Count Characters
curl --location 'http://localhost:5000/api/v1/text-analyzer/count-characters/1' \ --header 'Authorization: Bearer <TOKEN>'
- Count Sentences
curl --location 'http://localhost:5000/api/v1/text-analyzer/count-sentences/2' \ --header 'Authorization: Bearer <TOKEN>'
- Count Paragraphs
curl --location 'http://localhost:5000/api/v1/text-analyzer/count-paragraphs/1' \ --header 'Authorization: Bearer <TOKEN>'
- Longest Word
curl --location 'http://localhost:5000/api/v1/text-analyzer/longest-word/2' \ --header 'Authorization: Bearer <TOKEN>'
- Count Words
-
sudo git clone https://github.com/ashraf-kabir/text-analyzer.git
cd text-analyzer
npm install
sudo cp .env.example .env
cd client
npm install
sudo cp .env.example .env
cd ..
# go back to project root
# serve the application frontend and backend concurrently
npm run dev
Note: setup mysql and create database text_analyzer and table text as mentioned above.
Ashraf Kabir
Email: ashrafkabir95@gmail.com
WhatsApp: +8801751336666