Thank you for your interest in contributing to copy-paste.space! This document provides guidelines and instructions for contributing to this project.
- Project Overview
- Getting Started
- Development Setup
- Project Structure
- Coding Standards
- Making Changes
- Testing
- Submitting Changes
- Code Review Process
- Reporting Issues
- Feature Requests
- Questions and Support
copy-paste.space is a minimalistic web tool that enables instant cross-device text sharing through a clean, browser-based interface. The project consists of:
- Frontend: React with TypeScript, Vite, TailwindCSS
- Backend: Node.js with Express, TypeScript, MongoDB
- Deployment: Vercel (frontend), Railway (backend)
- Node.js (version 18 or higher)
- npm or yarn
- Git
- MongoDB (for local development)
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/copy-paste.space.git cd copy-paste.space - Add the original repository as upstream:
git remote add upstream https://github.com/rshdhere/copy-paste.space.git
-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Create environment variables:
cp .env.example .env
Configure the following variables in your
.envfile:PORT=8080 MONGODB_URI=your_mongodb_connection_string NODE_ENV=development -
Start the development server:
npm run dev
The backend will be available at
http://localhost:8080
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will be available at
http://localhost:5173
You can run both services simultaneously by opening two terminal windows:
Terminal 1 (Backend):
cd backend
npm run devTerminal 2 (Frontend):
cd frontend
npm run devonline-clipboard/
├── backend/ # Backend server (Node.js + Express)
│ ├── src/
│ │ ├── database/ # Database connection and models
│ │ ├── middleware/ # Express middleware (rate limiting, IP blocking)
│ │ ├── routes/ # API route handlers
│ │ ├── types/ # TypeScript type definitions
│ │ ├── utility/ # Utility functions
│ │ └── server.ts # Main server file
│ ├── package.json
│ └── tsconfig.json
├── frontend/ # Frontend application (React + TypeScript)
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── store/ # Redux components
│ │ ├── utils/ # Utility functions
│ │ ├── assets/ # Static assets
│ │ └── main.tsx # Application entry point
│ ├── package.json
│ └── vite.config.ts
└── README.md
- Use TypeScript for all new code
- Define proper types and interfaces
- Avoid using
anytype unless absolutely necessary - Use strict TypeScript configuration
- Use 2 spaces for indentation
- Use single quotes for strings
- Use semicolons at the end of statements
- Use camelCase for variables and functions
- Use PascalCase for classes and interfaces
- Use UPPER_SNAKE_CASE for constants
- Use functional components with hooks
- Use TypeScript interfaces for props
- Keep components small and focused
- Use meaningful component and prop names
- Use async/await for asynchronous operations
- Implement proper error handling
- Use middleware for cross-cutting concerns
- Follow RESTful API conventions
- Use kebab-case for file names
- Use PascalCase for component files
- Use descriptive names that indicate purpose
-
Ensure you're on the main branch and it's up to date:
git checkout main git pull upstream main
-
Create a new branch for your feature:
git checkout -b feature/your-feature-name
Branch naming conventions:
feature/descriptive-namefor new featuresfix/issue-descriptionfor bug fixesdocs/update-descriptionfor documentation changesrefactor/component-namefor code refactoring
- Write your code following the coding standards
- Test your changes locally
- Commit your changes with descriptive messages
Use conventional commit format:
type(scope): description
[optional body]
[optional footer]
Examples:
feat(frontend): add dark mode togglefix(backend): resolve rate limiting issuedocs: update contributing guidelinesrefactor(components): simplify Button component
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Run the linter to check for code quality issues:
cd frontend
npm run lintCurrently, the project doesn't have automated tests, but you should:
- Test your API endpoints manually
- Verify rate limiting works correctly
- Test database operations
- Check error handling
- Test the application in different browsers
- Test on mobile devices
- Verify text sharing works across devices
- Test rate limiting functionality
- Check error handling for invalid inputs
- Verify CORS settings work correctly
- Ensure your code follows the coding standards
- Test your changes thoroughly
- Update documentation if necessary
- Make sure all commits are properly formatted
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Go to your fork on GitHub and click "New Pull Request"
-
Fill out the pull request template:
- Title: Clear, descriptive title
- Description: Explain what changes you made and why
- Type of Change: Select the appropriate type
- Testing: Describe how you tested your changes
-
Submit the pull request
- Keep pull requests focused on a single feature or fix
- Provide clear descriptions of changes
- Include screenshots for UI changes
- Reference any related issues
- Respond to review comments promptly
Reviewers will check for:
- Code follows project standards
- Changes are properly tested
- Documentation is updated if needed
- No security vulnerabilities introduced
- Performance considerations addressed
- Error handling is appropriate
- Initial review: Within 2-3 days
- Follow-up reviews: Within 1-2 days of updates
- Final approval: When all concerns are addressed
- Check if the issue has already been reported
- Try to reproduce the issue on the latest version
- Check if it's a configuration or environment issue
When reporting an issue, please include:
- Title: Clear, descriptive title
- Description: Detailed description of the problem
- Steps to Reproduce: Step-by-step instructions
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment: Browser, OS, device information
- Screenshots: If applicable
- Check if the feature has already been requested
- Consider if it aligns with the project's goals
- Think about the implementation complexity
- Title: Clear, descriptive title
- Description: Detailed description of the feature
- Use Case: Why this feature is needed
- Proposed Implementation: How it could be implemented
- Alternatives Considered: Other approaches you've considered
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Code Review: Ask questions in pull request comments
- Be respectful and inclusive
- Help others learn and grow
- Provide constructive feedback
- Follow the project's code of conduct
- Project README
- TypeScript Documentation
- React Documentation
- Express.js Documentation
- TailwindCSS Documentation
Thank you for contributing to copy-paste.space! Your contributions help make this tool better for everyone.