A modern pastebin application built with React frontend and Flask backend, featuring syntax highlighting, private pastes, and user management.
- 🎨 Modern UI - Clean, responsive interface with dark/light theme support
- 🔐 User Authentication - Secure registration and login system
- 📝 Paste Management - Create, edit, delete, and share code snippets
- 🔒 Privacy Controls - Public or private paste visibility
- 📊 View Tracking - Track paste view counts
- 🔑 API Access - RESTful API with API key authentication
- 🎯 Syntax Highlighting - Beautiful code formatting
- 📱 Responsive Design - Works on desktop and mobile
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- Framer Motion for animations
- Lucide React for icons
- Flask with SQLAlchemy ORM
- PostgreSQL database
- JWT authentication
- Bcrypt password hashing
- Gunicorn WSGI server
-
Clone the repository
git clone <repository-url> cd PasteFrontEnd
-
Start with Docker Compose
docker-compose up --build
-
Access the application
- Frontend: http://localhost:4174
- Backend API: http://localhost:5001
- Database: localhost:5432
npm install
npm run dev
cd backend
pip install -r requirements.txt
python -m flask run
Create a .env
file in the backend directory:
SECRET_KEY=your-super-secret-key-here
INVITE_CODE=test
DB_HOST=db
DB_PORT=5432
DB_NAME=pastebin
DB_USER=pasteuser
DB_PASSWORD=pastepass
POST /api/auth/register
- Register new userPOST /api/auth/login
- User loginPOST /api/auth/logout
- User logout
GET /api/pastes
- Get user's pastesPOST /api/pastes
- Create new pasteGET /api/pastes/{id}
- Get specific pastePUT /api/pastes/{id}
- Update pasteDELETE /api/pastes/{id}
- Delete pastePOST /api/pastes/{id}/view
- Increment view count
GET /api/user/profile
- Get user profilePOST /api/user/generate-api-key
- Generate new API key
PasteFrontEnd/
├── src/ # Frontend source code
│ ├── components/ # React components
│ ├── pages/ # Page components
│ ├── contexts/ # React contexts
│ └── utils/ # Utility functions
├── backend/ # Flask backend
│ └── snipserve/ # Backend package
│ ├── routes.py # API routes
│ ├── models.py # Database models
│ └── config.py # Configuration
├── docker-compose.yml # Docker orchestration
└── README.md
- frontend - React application
- backend - Flask API server
- db - PostgreSQL database
This project is open source and available under the MIT License.