A free and open platform for community pantries of all shapes and sizes. Byte4Bite is designed to allow community pantries to manage and maintain inventory in the most easiest and frictionless way possible.
- Admin Dashboard - Manage inventory, fulfill orders, and track donations
- User Portal - Browse items, create carts, and track orders
- Multi-Pantry Support - Support multiple community pantries on one platform
- Order Fulfillment - Complete workflow from cart to pickup
- Notifications - Email and SMS notifications for order updates
- Analytics & Reporting - Track usage, inventory trends, and impact metrics
- Donation Tracking - Manage donors and track contributions
- Go - High-performance backend with Gin framework
- PostgreSQL - Robust relational database
- GORM - Go ORM for database operations
- JWT - Secure authentication
- React - Modern UI framework
- TypeScript - Type-safe development
- Vite - Fast build tool
- React Router - Client-side routing
- Axios - HTTP client
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- Standalone Binaries - Easy deployment on Windows/Linux
- Go 1.21+ - Download
- Node.js 20+ - Download
- PostgreSQL 16+ - Download
- Docker & Docker Compose (optional) - Download
-
Clone the repository
git clone https://github.com/byte4bite/byte4bite.git cd byte4bite -
Start all services
docker-compose up -d
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
- Health Check: http://localhost:8080/health
-
Copy environment file
cp .env.example .env
-
Start PostgreSQL (using Docker)
docker-compose -f docker-compose.dev.yml up -d
-
Install dependencies
go mod download
-
Run the backend
go run cmd/server/main.go
The backend will be available at http://localhost:8080
-
Navigate to frontend directory
cd frontend -
Copy environment file
cp .env.example .env
-
Install dependencies
npm install
-
Start development server
npm run dev
The frontend will be available at http://localhost:5173
byte4bite/
├── cmd/
│ └── server/ # Application entry point
├── internal/
│ ├── api/ # API handlers and routes
│ ├── auth/ # Authentication logic
│ ├── config/ # Configuration management
│ ├── database/ # Database connection and migrations
│ ├── models/ # Database models
│ ├── repositories/ # Data access layer
│ ├── services/ # Business logic
│ └── utils/ # Utility functions
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ ├── context/ # React context
│ │ ├── hooks/ # Custom hooks
│ │ ├── types/ # TypeScript types
│ │ └── utils/ # Utility functions
│ └── public/ # Static assets
├── migrations/ # Database migrations
├── scripts/ # Utility scripts
├── docker-compose.yml # Production Docker setup
└── docker-compose.dev.yml # Development Docker setup
POST /api/v1/auth/register- Register new userPOST /api/v1/auth/login- Login userPOST /api/v1/auth/refresh- Refresh tokenPOST /api/v1/auth/logout- Logout user
GET /api/v1/pantries- List all pantriesGET /api/v1/items- List available items
GET /api/v1/users/me- Get current userGET /api/v1/carts/current- Get current cartPOST /api/v1/carts/items- Add item to cartGET /api/v1/users/orders- Get user orders
GET /api/v1/admin/dashboard- Admin dashboardPOST /api/v1/admin/items- Create itemGET /api/v1/admin/orders- Manage ordersPOST /api/v1/admin/categories- Create category
See API Documentation for complete endpoint list.
The application uses PostgreSQL with the following main tables:
- users - User accounts and authentication
- pantries - Community pantry information
- categories - Item categories
- items - Inventory items
- carts - User shopping carts
- cart_items - Items in carts
- orders - Submitted orders
- donations - Donation tracking
- notifications - Email/SMS notifications
See Database Schema for detailed information.
# Backend tests
go test ./...
# Frontend tests
cd frontend
npm test# Linux
GOOS=linux GOARCH=amd64 go build -o byte4bite-linux-amd64 ./cmd/server
# Windows
GOOS=windows GOARCH=amd64 go build -o byte4bite-windows-amd64.exe ./cmd/servercd frontend
npm run builddocker-compose build
docker-compose up -dSERVER_HOST- Server host (default: 0.0.0.0)SERVER_PORT- Server port (default: 8080)ENVIRONMENT- Environment (development/production)DB_HOST- Database hostDB_PORT- Database portDB_USER- Database userDB_PASSWORD- Database passwordDB_NAME- Database nameJWT_SECRET- JWT signing secret (REQUIRED in production)JWT_EXPIRY_HOURS- Token expiry time in hours
VITE_API_URL- Backend API URL
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
See IMPLEMENTATION_PLAN.md for the complete development roadmap.
✅ Phase 1: Project Foundation (Completed)
- Go backend structure
- React frontend with TypeScript
- PostgreSQL database setup
- Docker configuration
- Environment setup
🚧 Phase 2: Authentication & User Management
- User registration and login
- JWT authentication
- Role-based access control
- User profile management
Built with ❤️ for community pantries everywhere.