Welcome to Shopstr! 🛒⚡ We're excited to have you contribute to our global, permissionless Nostr marketplace for Bitcoin commerce.
- Prerequisites
- Fork and Clone
- Local Development Setup
- Development Workflow
- Code Quality Standards
- Testing
- Creating a Pull Request
- Docker Development
Before you begin, ensure you have the following installed on your system:
- Node.js: Version 18.17.0 or higher
- npm: Version 9.6.7 or higher
- Git: Latest version
- Docker (optional, for containerized development)
node --version # Should be >=18.17.0
npm --version # Should be >=9.6.7
git --version- Visit https://github.com/shopstr-eng/shopstr
- Click the "Fork" button in the top-right corner
- Select your GitHub account to create the fork
# Clone your forked repository
git clone https://github.com/YOUR-USERNAME/shopstr.git
# Navigate to the project directory
cd shopstr
# Add the original repository as upstream
git remote add upstream https://github.com/shopstr-eng/shopstr.git
# Verify remotes
git remote -vYou should see:
origin https://github.com/YOUR-USERNAME/shopstr.git (fetch)
origin https://github.com/YOUR-USERNAME/shopstr.git (push)
upstream https://github.com/shopstr-eng/shopstr.git (fetch)
upstream https://github.com/shopstr-eng/shopstr.git (push)
# Install all project dependencies
npm ciNote: We use
npm ciinstead ofnpm installfor consistent, reproducible installations based on thepackage-lock.jsonfile.
# Start the development server
npm run devThis application requires a PostgreSQL database. You can run it locally using Docker Compose:
-
Start PostgreSQL:
docker-compose up -d
-
Create a
.envfile in the root directory with the following:DATABASE_URL=postgresql://shopstr:shopstr@localhost:5432/shopstr -
The database tables will be automatically created on first connection.
-
To stop the database:
docker-compose down
-
To remove all data and start fresh:
docker-compose down -v
The application will be available at http://localhost:3000
- Open your browser to
http://localhost:3000 - Check that the application loads without errors
- Check the browser console for any warnings or errors
Before starting new work, always sync with the upstream repository:
# Fetch upstream changes
git fetch upstream
# Switch to main branch
git checkout main
# Merge upstream changes
git merge upstream/main
# Push updates to your fork
git push origin main# Create and switch to a new branch
git checkout -b feature/your-feature-name
# Or for bug fixes
git checkout -b fix/bug-descriptionMake your changes and commit them to your feature branch.
Run ESLint to check for code issues:
# Check for linting errors
npm run lint
# Fix auto-fixable issues
npx eslint . --ext .ts,.tsx --fixEnsure your code passes TypeScript checks:
# Run type checking
npm run type-checkFormat your code with Prettier:
# Check formatting
npx prettier --check .
# Fix formatting issues
npx prettier --write .Before committing, run all quality checks:
# Run linting and type checking together
npm run lint-all# Run all tests
npm test
# Run tests in watch mode during development
npm run test:watch- Write tests for new features and bug fixes
- Place test files next to the components they test or in a
__tests__directory - Use descriptive test names
- Follow existing test patterns
Before creating a pull request, ensure your code meets quality standards by running:
# Run the full build process
npm run build
# Run all linting and type checks
npm run lint-all
# Run tests
npm test
# Format code
npx prettier --write .Once all checks pass, push your changes and create a pull request.
# Build the Docker image
docker build -t shopstr .# Run the container
docker run -p 3000:3000 shopstrIf you need to set up additional services, you can create a docker-compose.yml file for your local development needs.
Thank you for contributing to Shopstr! 🚀 Your contributions help build the future of decentralized Bitcoin commerce.
Join our Discord server to ask questions and get help directly from the maintainers and community!