qirang/nlip
Sync form the github repo Nlip
Nlip - Network Lightweight Clipboard
English | 简体中文
A lightweight network clipboard system implemented by Cursor that supports text and file sharing across multiple platforms.
<p align="center"> <img src="docs/images/logo.png" alt="Nlip Logo" width="200"/> <br> <a href="https://github.com/QirangMilco/nlip/releases"> <img src="https://img.shields.io/github/v/release/QirangMilco/nlip" alt="GitHub release"> </a> <a href="https://github.com/QirangMilco/nlip/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/QirangMilco/nlip" alt="License"> </a> <a href="https://github.com/QirangMilco/nlip/actions"> <img src="https://github.com/QirangMilco/nlip/workflows/CI/badge.svg" alt="CI Status"> </a> </p>
Table of Contents
- Features
- Tech Stack
- Getting Started
- Project Structure
- Development
- Deployment
- Contributing
- Security
- License
- Acknowledgments
Features
Core Features
- Multi-platform Support: Web, Browser Extension, Mobile App
- Content Sharing: Seamless text and file sharing
- Space Management:
- Space-based content organization
- Advanced permission management
- Collaborator invitation system with email support
- Fine-grained collaborator access control
- Real-time Sync: Real-time updates across all platforms
- Guest Features
- Guest uploads in public spaces
- Guest content preview support
- Smart Management:
- Automatic expired content cleanup
- Overflow management
- Collaborator activity tracking
Security Features
- Authentication: JWT-based user authentication
- Access Control:
- Space-level permission management
- Role-based collaborator permissions (view/edit)
- Secure invitation system
- Protection
- Rate limiting
- File type filtering
- Content expiration mechanism
- Email verification for invitations
User Experience
- Responsive design
- Offline support
- Multi-language interface
- Dark mode
Tech Stack
Backend
- Go 1.20+
- Gin Web Framework
- SQLite Database
- JWT Authentication
- WebSocket Real-time Communication
- Rate Limiting
- File Storage System
Frontend
- Web: React 18 + TypeScript 5 + Ant Design 5
- Browser Extension: Chrome Extension API + React
- Mobile App: Flutter 3
- State Management: Redux Toolkit + Redux Persist
- HTTP Client: Axios
- Build Tool: Vite
API Documentation
For detailed API documentation, see API Documentation
API Features
- RESTful API design
- JWT authentication
- Real-time WebSocket notifications
- Rate limiting
- Standardized error handling
- API version control
- Debug mode support
API Example
// Login example
const response = await fetch('/api/v1/nlip/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
username: 'test',
password: '123456'
})
});
const data = await response.json();
// Use the returned token
const token = data.token;For more examples, please refer to API Documentation
Getting Started
Prerequisites
- Go 1.20+
- Node.js 18+
- Flutter 3.0+
- SQLite 3
Installation
- Clone the repository
git clone https://github.com/yourusername/nlip.git
cd nlip- Install backend dependencies
cd src/backend
go mod download- Install frontend dependencies
cd src/frontend/web
npm install- Configure environment variables
# Backend
cp src/backend/config.example.json src/backend/config.dev.json
# Edit config.dev.json with your settings
# Frontend
cp src/frontend/web/.env.example src/frontend/web/.env.local
# Edit .env.local with your settings- Start development servers
# Backend
cd src/backend
go run main.go
# Frontend
cd src/frontend/web
npm run devDevelopment Access
- Web App: http://localhost:5173
- API Server: http://localhost:3000
- API Documentation: http://localhost:3000/swagger/index.html
Project Structure
nlip/
├── src/
│ ├── backend/ # Go backend
│ │ ├── config/ # Configuration
│ │ ├── handlers/ # Request handlers
│ │ ├── middleware/ # Middleware
│ │ ├── models/ # Data models
│ │ ├── routes/ # Route definitions
│ │ ├── utils/ # Utilities
│ │ └── main.go # Entry point
│ └── frontend/ # Frontend application
│ └── src/ # Source code
│ ├── api/ # API clients
│ ├── components/# React components
│ ├── config/ # Configuration files
│ ├── constants/# Constants
│ ├── hooks/ # Custom hooks
│ ├── pages/ # Page components
│ ├── routes/ # Route configurations
│ ├── store/ # State management
│ ├── styles/ # Style files
│ └── types/ # TypeScript definitions
├── docs/ # Documentation
└── scripts/ # Build scriptsDevelopment
Code Style
- Go: Follow official Go style guide
- TypeScript: ESLint + Prettier
- SCSS: Stylelint
- Commit Messages: Conventional Commits
Branch Strategy
- main: Production ready code
- develop: Development branch
- feature/*: New features
- bugfix/*: Bug fixes
- release/*: Release preparation
Deployment
Docker Deployment
# Build images
docker-compose build
# Start services
docker-compose up -dManual Deployment
See Deployment Guide
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'feat: add some feature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For detailed guidelines, see Contributing Guide
Security
- JWT-based authentication
- Rate limiting
- Input validation and sanitization
- File type filtering
- Content expiration mechanism
- HTTPS enforced in production
For security issues, please refer to our Security Policy
License
This project is licensed under the MIT License - see the LICENSE file for details
Acknowledgments
Support
If you find this project helpful, please consider giving it a star ⭐️
