Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Professional PocketBase backend with CRUD operations, authentication, and real-time features

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

chakravartiraj/pocketbase-crud-backend

Repository files navigation

PocketBase Backend - Professional CRUD Demo

Deploy on Railway Deploy to Render License: MIT PocketBase

A comprehensive backend application demonstrating CRUD operations using PocketBase, featuring user management, product catalog, and order processing.

Features

  • 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

Tech Stack

  • 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

Project Structure

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

Quick Start

  1. Download PocketBase:

    ./scripts/download-pocketbase.sh
  2. Start the server:

    ./pocketbase serve --http=0.0.0.0:8090
  3. Access Admin UI: http://localhost:8090/_/

  4. API Base URL: http://localhost:8090/api/

  5. Web Demo: Open examples/crud-demo.html in your browser

🚀 Deploy to Production

Deploy on Railway Deploy to Render

See DEPLOYMENT_GUIDE.md for detailed deployment instructions.

API Endpoints

Authentication

  • POST /api/collections/users/auth-with-password - User login
  • POST /api/collections/users/records - User registration
  • POST /api/collections/users/request-password-reset - Password reset
  • POST /api/collections/users/auth-refresh - Refresh token

Users

  • GET /api/collections/users/records - List users
  • GET /api/collections/users/records/:id - Get user
  • PATCH /api/collections/users/records/:id - Update user
  • DELETE /api/collections/users/records/:id - Delete user

Products

  • GET /api/collections/products/records - List products
  • GET /api/collections/products/records/:id - Get product
  • POST /api/collections/products/records - Create product
  • PATCH /api/collections/products/records/:id - Update product
  • DELETE /api/collections/products/records/:id - Delete product

Categories

  • GET /api/collections/categories/records - List categories
  • POST /api/collections/categories/records - Create category
  • PATCH /api/collections/categories/records/:id - Update category
  • DELETE /api/collections/categories/records/:id - Delete category

Orders

  • GET /api/collections/orders/records - List orders
  • GET /api/collections/orders/records/:id - Get order
  • POST /api/collections/orders/records - Create order
  • PATCH /api/collections/orders/records/:id - Update order status

Development

Using Docker

docker-compose up -d

Manual Setup

  1. Install PocketBase
  2. Run migrations
  3. Start server
  4. Import sample data

Environment Variables

  • PB_ENCRYPTION_KEY - Database encryption key
  • PB_DATA_DIR - Data directory path (default: ./pb_data)
  • PB_PUBLIC_DIR - Public files directory (default: ./static)
  • PB_HOOKS_DIR - Hooks directory (default: ./pb_hooks)

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

About

Professional PocketBase backend with CRUD operations, authentication, and real-time features

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published