#A to ₿ - Decentralized Package Delivery
A to ₿ is a decentralized package delivery application built on Nostr, allowing users to post packages, view available packages on a map, pick up packages for delivery, and confirm deliveries - all without relying on centralized servers.
This project was developed in response to the A to ₿ Dev Bounty.
##A to ₿ Logo ###Features
- Decentralized Communication: Uses Nostr protocol for peer-to-peer communication
- Package Management: Post, view, pick up, and deliver packages
- Interactive Map: View available packages on an interactive map
- Status Tracking: Track packages through their entire lifecycle
- Offline Support: Local storage fallback when Nostr is unavailable
- Relay Management: Configure and test Nostr relays
- QR Code Delivery Confirmation: Generate QR codes for delivery confirmation
- Next.js: React framework for the frontend
- Nostr Protocol: Decentralized social networking protocol
- Tailwind CSS: Utility-first CSS framework
- shadcn/ui: High-quality UI components
- Local Storage: For offline data persistence
- Leaflet: For interactive maps
- Vibe Coded with AI
Node.js 16+ and npm/yarn
A Nostr browser extension (Alby or nos2x recommended)
Installation
-
Clone the repository:
git clone https://github.com/yourusername/a-to-b.gitcd a-to-b
-
Install dependencies: npm install
yarn install
- Start the development server: npm run dev
yarn dev 4. Open http://localhost:3000
in your browser
Install a Nostr browser extension (Alby)
Connect with your Nostr key on the login page
- Navigate to "Post Package" from the home screen
- Fill in package details (title, pickup location, destination, cost)
- Submit the form to create a new package
- Navigate to "View Packages" from the home screen
- Toggle between "Available Packages" and "My Packages" views
- See packages on the map or in the list view
- Click on a package to view details
- Find an available package in the "View Packages" screen
- Click the "Pick Up" button to accept the delivery job
- The package will now appear in your "My Deliveries" list
- Navigate to "My Deliveries" from the home screen
- Select the package you're delivering
- Click "Show QR Code" to generate a confirmation code for the recipient, mark delivered there or
- Click "Complete" when the delivery is finished
- Navigate to "Settings" from the "View Packages" screen
- Add, remove, or check the status of Nostr relays
- Add suggested relays with a single click
#Project Structure a-to-b/ ├── app/ # Next.js app router pages │ ├── login/ # Login page │ ├── post-package/ # Package creation page │ ├── view-packages/ # Package listing and map view │ ├── my-deliveries/ # Active deliveries management │ └── settings/ # Relay configuration ├── components/ # React components │ ├── ui/ # UI components (shadcn) │ ├── nostr-login.tsx # Nostr authentication │ ├── package-map.tsx # Map visualization │ └── ... ├── lib/ # Utility functions and services │ ├── nostr.ts # Nostr integration │ ├── nostr-service.ts # Nostr relay management │ ├── nostr-keys.ts # Key management │ └── local-package-service.ts # Local storage management └── public/ # Static assets
A to ₿ uses custom Nostr event kinds:
30001: Package events
30002: Delivery events
The application connects to multiple Nostr relays for redundancy and uses local storage as a fallback when Nostr is unavailable.
The application includes a debug panel accessible from the "View Packages" screen that allows you to:
- Check relay connectivity
- View local storage data
- Troubleshoot Nostr issues
- Fork the repository
- Create your feature branch (git checkout -b feature/amazing-feature)
- Commit your changes (git commit -m 'Add some amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.