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.local
file 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 bcrypt
getTextFile(filename, password)
- Parameters: Filename, password
- Returns: File content if password matches
- Security: Uses bcrypt comparison
getAllTextFiles()
- Returns: Array of all filenames (without content)
deleteTextFile(filename)
- Parameters: Filename to delete
- Returns: Success status
TextVault/
βββ 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 lint
Create a .env.local
file:
# MongoDB Atlas Connection
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/textvault?retryWrites=true&w=majority
Never 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!