A modern full-stack web application for transforming and storing text with secure user authentication.
-
🔒 User Authentication
- Secure registration & login system
- Password hashing with bcrypt
- JWT-protected routes
-
📝 Text Transformation
- Convert to uppercase/lowercase
- Select all text with one click
- Copy to clipboard
- Character and word count
-
💾 Text Management
- Save transformed texts to your account
- View all your saved texts
- Update existing texts
- Delete unwanted texts
-
🛡️ Security
- JWT authentication
- Password hashing
- API rate limiting
- HTTP headers hardened with Helmet
-
🎨 Modern UI
- Responsive design with Tailwind CSS
- Gradient styling and animations
- Clean, intuitive interface
- Node.js + Express
- MongoDB + Mongoose
- JWT for authentication
- Express-validator
- Security: Helmet, bcrypt, rate limiting
- React 18 + Vite
- Tailwind CSS for styling
- Fetch API for data handling
- Node.js (v14+)
- MongoDB (local or Atlas)
-
Clone the repository
git clone https://github.com/yourusername/text-utils.git cd text-utils -
Configure environment variables
Create a
.envfile in thebackenddirectory:JWT_SECRET=your_super_secret_key_here PORT=5000 MONGODB_URI=mongodb://localhost:27017/TextUtils -
Install dependencies
# Backend setup cd backend npm install # Frontend setup cd ../frontend npm install
-
Run the application
# Start backend (from backend directory) npm run dev # Start frontend (from frontend directory) npm run dev
-
Access the application
Open your browser and navigate to http://localhost:3000
| Endpoint | Method | Description | Authentication |
|---|---|---|---|
/api/register |
POST | Register new user | Public |
/api/login |
POST | Login and get JWT | Public |
/api/texts |
GET | Retrieve all user texts | Protected |
/api/texts |
POST | Create new text | Protected |
/api/texts/:id |
PUT | Update existing text | Protected |
/api/texts/:id |
DELETE | Delete a text | Protected |
text-utils/
├── backend/ # Node.js server
│ ├── middleware/ # Auth middleware
│ ├── models/ # MongoDB schemas
│ ├── routes/ # API endpoints
│ └── server.js # Express app entry
│
└── frontend/ # React application
├── src/
│ ├── api/ # API service functions
│ ├── components/ # React components
│ └── App.jsx # Main component
├── index.html # HTML entry
└── tailwind.config.js # Tailwind configuration
- Password hashing with bcrypt
- JWT authentication for protected routes
- API rate limiting to prevent brute force attacks
- HTTP headers hardened with Helmet
- Input validation with Express-validator
- Enter text in the main text area
- Use the buttons to transform text (uppercase, lowercase, etc.)
- View character and word count metrics in real-time
- Login to your account or register a new one
- Transform your text as needed
- Click "Save" to store it to your account
- Access your saved texts from the dashboard
- Edit or delete saved texts as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Birat Aryal - GitHub Profile