A text sharing tool for developers
Frontend
Report Bug
·
Request Feature
- Table of Contents
- About The Project
- Getting Started
- Usage
- API Documentation
- Deployment
- Security
- Roadmap
- Contributing
- License
- Contact
- Acknowledgements
PastePortal is a revolutionary new application that makes sharing text a breeze. Designed with developers in mind, PastePortal eliminates the need for the traditional copy-paste method, making it easy to share context without any additional complexity.
Whether you're working on a large project with multiple team members or simply need to share a small snippet of code, PastePortal is the perfect solution. With its user-friendly interface and powerful functionality, it's no wonder why PastePortal is quickly becoming the go-to choice for developers everywhere.
Try it out today and see the difference for yourself!
- Next.js - React framework for production
- TypeScript - Type safety
- Supabase - Backend database
- Tailwind CSS - Styling
- PWA - Progressive Web App support
- Node.js 18.x or higher
- npm or yarn
- Supabase account (SaaS)
- Git
- Clone the repository
git clone https://github.com/stiliajohny/pasteportal.git
cd pasteportal- Install dependencies
npm install-
Set up environment variables (see Environment Variables)
-
Run Supabase migrations (see Supabase Setup)
-
Start the development server
npm run devOpen http://localhost:3000 to view the application.
Create a .env.local file in the root directory with the following variables:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
ENCRYPTION_KEY=your-32-byte-encryption-key-here
NEXT_PUBLIC_ADSENSE_CLIENT_ID=ca-pub-your-adsense-client-id
NEXT_PUBLIC_VSCODE_CALLBACK_URI=vscode://your.extension.id/auth-callbackImportant Notes:
ENCRYPTION_KEY: Must be a secure random 32-byte key (64 hex characters) or any string that will be used to derive a 32-byte key using scryptNEXT_PUBLIC_ADSENSE_CLIENT_ID: Optional. Your Google AdSense client ID (format:ca-pub-xxxxxxxxxxxxxxx). If not set, AdSense ads will not be displayed.NEXT_PUBLIC_VSCODE_CALLBACK_URI: Optional. Custom VS Code callback URI (e.g.,vscode://publisher.extension/auth-callback). Defaults tovscode://JohnStilia.pasteportal/auth-callbackwhen not set.- Keep your encryption key secure and never commit it to version control
- For production, use a secure method to generate and store the encryption key
-
Create a Supabase project (if you haven't already) at supabase.com
-
Run migrations to set up the database schema:
# Using Supabase CLI (recommended)
supabase db push
# Or manually run the SQL migration file:
# supabase/migrations/001_initial_schema.sql- Verify the table was created:
The migration creates a pastes table with the following structure:
id(TEXT, primary key, 6-character hex)paste(TEXT, encrypted content)recipient_gh_username(TEXT)timestamp(TIMESTAMP)created_at(TIMESTAMP)
The table includes Row Level Security (RLS) policies for public read/write access.
The frontend is available at https://pasteportal.app.
You can:
- View pastes by visiting
https://pasteportal.app?id=<paste-id> - Manually retrieve pastes using the sidebar "Get Paste" option
- Install as a PWA for offline access
Store a new paste.
Request Body:
{
"paste": "Your text content here",
"recipient_gh_username": "recipient"
}Response:
{
"response": {
"message": "The paste was successfully inserted into the database",
"id": "abc123",
"timestamp": "2024-01-01T00:00:00.000Z",
"paste": "Your text content here",
"joke": "A random programming joke"
}
}Retrieve a paste by ID.
Response:
{
"response": {
"message": "The paste was successfully retrieved from the database",
"id": "abc123",
"paste": "Your text content here",
"recipient_gh_username": "recipient",
"joke": "A random programming joke"
}
}The application is configured for deployment on Netlify:
-
Connect your repository to Netlify
-
Set environment variables in Netlify dashboard:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYENCRYPTION_KEYNEXT_PUBLIC_ADSENSE_CLIENT_ID(optional)
-
Configure custom domain
pasteportal.appin Netlify dashboard -
Deploy - Netlify will automatically build and deploy using the
netlify.tomlconfiguration
The netlify.toml file includes:
- Build settings
- API route redirects
- PWA headers
- Security headers
- All paste content is encrypted using AES-256-GCM before storing in the database
- Encryption key is stored in environment variables and never exposed to clients
- Encryption/decryption happens server-side only
- Always use a strong, randomly generated encryption key
- Never commit
.env.localor encryption keys to version control - Use environment variables for all sensitive configuration
- Regularly rotate encryption keys in production
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the GPLv3 License. See LICENSE for more information.
John Stilia - stilia.johny@gmail.com