A comprehensive backend application demonstrating CRUD operations using PocketBase, featuring user management, product catalog, and order processing.
- User Management: Registration, authentication, profile management
- Product Catalog: Create, read, update, delete products with categories
- Order Processing: Order creation, status tracking, order history
- File Upload: Product images and user avatars
- Real-time Updates: WebSocket support for live data synchronization
- API Documentation: Comprehensive REST API endpoints
- Admin Dashboard: Built-in admin interface for data management
- Backend: PocketBase (Go-based BaaS)
- Database: SQLite (embedded)
- Authentication: JWT-based auth with PocketBase
- File Storage: Local file system
- API: RESTful endpoints + Real-time subscriptions
pocketbase-backend/
├── README.md # Project documentation
├── docker-compose.yml # Docker setup for easy deployment
├── Dockerfile # Container configuration
├── pb_data/ # PocketBase data directory
├── pb_migrations/ # Database migrations
├── pb_hooks/ # Custom business logic hooks
├── static/ # Static files and uploads
├── docs/ # API documentation
├── scripts/ # Utility scripts
└── examples/ # Usage examples and demos
-
Download PocketBase:
./scripts/download-pocketbase.sh
-
Start the server:
./pocketbase serve --http=0.0.0.0:8090
-
Access Admin UI: http://localhost:8090/_/
-
API Base URL: http://localhost:8090/api/
-
Web Demo: Open
examples/crud-demo.html
in your browser
See DEPLOYMENT_GUIDE.md for detailed deployment instructions.
POST /api/collections/users/auth-with-password
- User loginPOST /api/collections/users/records
- User registrationPOST /api/collections/users/request-password-reset
- Password resetPOST /api/collections/users/auth-refresh
- Refresh token
GET /api/collections/users/records
- List usersGET /api/collections/users/records/:id
- Get userPATCH /api/collections/users/records/:id
- Update userDELETE /api/collections/users/records/:id
- Delete user
GET /api/collections/products/records
- List productsGET /api/collections/products/records/:id
- Get productPOST /api/collections/products/records
- Create productPATCH /api/collections/products/records/:id
- Update productDELETE /api/collections/products/records/:id
- Delete product
GET /api/collections/categories/records
- List categoriesPOST /api/collections/categories/records
- Create categoryPATCH /api/collections/categories/records/:id
- Update categoryDELETE /api/collections/categories/records/:id
- Delete category
GET /api/collections/orders/records
- List ordersGET /api/collections/orders/records/:id
- Get orderPOST /api/collections/orders/records
- Create orderPATCH /api/collections/orders/records/:id
- Update order status
docker-compose up -d
- Install PocketBase
- Run migrations
- Start server
- Import sample data
PB_ENCRYPTION_KEY
- Database encryption keyPB_DATA_DIR
- Data directory path (default: ./pb_data)PB_PUBLIC_DIR
- Public files directory (default: ./static)PB_HOOKS_DIR
- Hooks directory (default: ./pb_hooks)
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.