A modern, full-stack web application for securely storing and managing encrypted text files in the cloud.
👉 For the latest version and active development, please visit:
This repository (Gupta/TextVault) has been superseded. Please use the link above for the most up-to-date version.
- Features
- Tech Stack
- Project Architecture
- Getting Started
- Workflow
- API Endpoints
- Project Structure
- Contributing
- 🔐 Password-Protected Files - Secure your text files with bcrypt encryption
- 📁 File Management - Create, view, and manage multiple text files
- ☁️ Cloud Storage - Store files securely on MongoDB Atlas
- 🎨 Modern UI - Beautiful, responsive interface with Framer Motion animations
- ⚡ Real-time Updates - Instant file synchronization
- 🎯 Fast Performance - Optimized with Next.js and React 19
- 📱 Mobile Responsive - Works seamlessly on all devices
- Framework: Next.js 15.0.3
- UI Library: React 19.0 RC
- Styling: Tailwind CSS + TailwindCSS Animate
- Animations: Framer Motion
- Components: Radix UI
- Icons: Lucide React + React Icons
- Notifications: React Toastify
- Runtime: Node.js
- Database: MongoDB Atlas
- Authentication: Bcrypt
- ORM: Mongoose
- Package Manager: npm
- Code Editor: VS Code (recommended)
- Build Tool: Next.js Built-in
┌─────────────────────────────────────────────────────────────┐
│ TEXTVAULT APPLICATION │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────┴─────────────┐
│ │
┌─────▼──────┐ ┌──────▼──────┐
│ Frontend │ │ Backend │
│ (Next.js) │ │ (Node.js) │
└─────┬──────┘ └──────┬──────┘
│ │
┌───────────┼──────────────┐ │
│ │ │ │
┌───▼───┐ ┌───▼────┐ ┌─────▼────┐ │
│ Pages │ │ Comp. │ │ Actions │ │
│ (JSX) │ │ (UI) │ │(Server) │ │
└───────┘ └────────┘ └────┬─────┘ │
│ │
┌────▼──────────▼────┐
│ Mongoose ORM │
└────┬───────────────┘
│
┌────▼──────────────┐
│ MongoDB Atlas │
│ (Cloud DB) │
└───────────────────┘
- Node.js (v18 or higher)
- npm or yarn
- MongoDB Atlas Account
- Git
-
Clone the repository
git clone https://github.com/Gupta-02/TEXT-RETRIVER.git cd TextVault -
Install dependencies
npm install --legacy-peer-deps
-
Set up environment variables
- Create a
.env.localfile in the root directory - Add your MongoDB Atlas URI:
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/textvault?retryWrites=true&w=majority
- Create a
-
Start the development server
npm run dev
-
Open in browser
- Navigate to http://localhost:3000
Quick Setup Guide:
- Visit mongodb.com/cloud/atlas
- Create a free account
- Create a cluster (M0 free tier)
- Create a database user with username & password
- Allow network access (allow all IPs for development)
- Copy the connection string and add it to
.env.local
┌──────────────────────────────────────────────────────────────┐
│ USER INTERACTION FLOW │
└──────────────────────────────────────────────────────────────┘
┌────────────────┐
│ User Opens │
│ Application │
└────────┬───────┘
│
▼
┌────────────────┐
│ Homepage / │
│ Dashboard │
└────────┬───────┘
│
┌──────┴──────┐
│ │
▼ ▼
┌─────────┐ ┌──────────────┐
│ Create │ │ View/Access │
│ File │ │ Existing │
│ (Drop) │ │ Files │
└────┬────┘ └──────┬───────┘
│ │
▼ ▼
┌──────────────┐ ┌─────────────────┐
│ Input File │ │ Enter Password │
│ Content & │ │ & View Content │
│ Set Password │ │ │
└────┬─────────┘ └─────────┬───────┘
│ │
▼ ▼
┌──────────────┐ ┌──────────────────┐
│ Encrypt with │ │ Decrypt Content │
│ Bcrypt │ │ Using Password │
└────┬─────────┘ └──────────┬───────┘
│ │
▼ ▼
┌──────────────┐ ┌──────────────────┐
│ Save to │ │ Display File │
│ MongoDB │ │ Content │
│ Atlas │ │ │
└──────────────┘ └──────────────────┘
Frontend Request
│
▼
┌──────────────────────┐
│ Next.js Server │
│ Action Handler │
└──────┬───────────────┘
│
▼
┌──────────────────────┐
│ Mongoose Models │
│ (TextFile Schema) │
└──────┬───────────────┘
│
▼
┌──────────────────────┐
│ Bcrypt Hashing │
│ (Password Security) │
└──────┬───────────────┘
│
▼
┌──────────────────────┐
│ MongoDB Query │
│ (CRUD Operations) │
└──────┬───────────────┘
│
▼
┌──────────────────────┐
│ Database Response │
└──────┬───────────────┘
│
▼
┌──────────────────────┐
│ JSON Response │
└──────┬───────────────┘
│
▼
Frontend UI Update
addTextFile(text, textName, password)
- Parameters: File content, filename, password
- Returns: Success status with message
- Security: Password is hashed with bcryptgetTextFile(filename, password)
- Parameters: Filename, password
- Returns: File content if password matches
- Security: Uses bcrypt comparisongetAllTextFiles()
- Returns: Array of all filenames (without content)deleteTextFile(filename)
- Parameters: Filename to delete
- Returns: Success statusTextVault/
├── public/ # Static assets
├── src/
│ ├── app/
│ │ ├── layout.js # Root layout component
│ │ ├── page.js # Home page
│ │ ├── globals.css # Global styles
│ │ ├── drop/
│ │ │ └── page.jsx # File upload page
│ │ └── view/
│ │ └── page.jsx # File view page
│ ├── components/
│ │ └── ui/
│ │ ├── button.jsx # Button component
│ │ ├── input.jsx # Input component
│ │ ├── dialog.jsx # Modal component
│ │ ├── blur-in.jsx # Blur animation
│ │ ├── shimmer-button.jsx # Shimmer effect
│ │ └── ... # Other UI components
│ ├── actions/
│ │ └── index.js # Server actions (CRUD)
│ ├── lib/
│ │ ├── connectDb.js # MongoDB connection
│ │ └── utils.js # Utility functions
│ └── Models/
│ └── TextFile.js # MongoDB schema
├── .env.local # Environment variables (git ignored)
├── .gitignore # Git ignore rules
├── package.json # Dependencies
├── tailwind.config.js # Tailwind configuration
├── next.config.mjs # Next.js configuration
└── README.md # This file
- Passwords are hashed using bcrypt (not stored as plain text)
- Each file can have a unique password
- Secure comparison prevents timing attacks
- Uses Next.js Server Actions for backend logic
- React hooks for frontend state
- MongoDB for persistent storage
- Responsive Design: Works on mobile, tablet, desktop
- Animations: Smooth transitions with Framer Motion
- Accessible Components: Built with Radix UI
# Start development server
npm run dev
# Build for production
npm build
# Start production server
npm start
# Run linting
npm lintCreate a .env.local file:
# MongoDB Atlas Connection
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/textvault?retryWrites=true&w=majorityNever commit .env.local to git! It's already in .gitignore
- next: 15.0.3 - React framework
- react: 19.0.0-rc - UI library
- mongodb: Cloud database
- mongoose: ODM for MongoDB
- bcrypt: Password hashing
- tailwindcss: Utility-first CSS
- framer-motion: Animation library
- radix-ui: Accessible components
- react-toastify: Notifications
- Push your code to GitHub
- Visit vercel.com
- Import your repository
- Add environment variables
- Click Deploy
- Netlify
- Railway
- Heroku
- AWS
Contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Gupta - GitHub Profile
- Next.js team for the amazing framework
- MongoDB for cloud database
- Tailwind CSS for beautiful styling
- All open-source contributors
If you have any questions or issues:
- Check existing Issues
- Create a new Issue with detailed information
- Contact the maintainer
Made with ❤️ by Gupta
⭐ Star this repo if you found it helpful!