Skip to content

iiivanpopov/beger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’» Beger - Board Management System

React Hono Bun PostgreSQL Docker TypeScript

A modern, full-stack application for managing boards with user authentication, repairs tracking, and test results management. Features a React 19 frontend and blazing-fast Hono backend powered by Bun.

Created for my fathers job.

⚑ Quick Start

git clone https://github.com/iiivanpopov/beger.git
cd beger

cp .env.example .env # Then config

docker-compose build
docker-compose up -d

πŸš€ Features

  • πŸ” JWT Authentication - Secure user authentication with access/refresh tokens
  • πŸ‘₯ Role-Based Access Control - Admin and user roles with different permissions
  • πŸ”§ Repairs Management - Track and manage board repairs
  • πŸ“Š Test Results - Record and monitor test results
  • πŸ“‹ Google Sheets Integration - Import data directly from Google Sheets
  • 🎨 Modern UI - Beautiful and responsive interface with React 19
  • ⚑ High Performance - Built with Bun for exceptional speed
  • 🐳 Docker Ready - Easy deployment with Docker Compose
  • πŸ‘… Internationalization - Multi language

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

βš™οΈ Tech Stack

πŸ“± Frontend

Framework: React v19 βš›οΈ

πŸ”’ Backend

Framework: Hono v4 πŸ”₯

  • Drizzle ORM - TypeScript-first ORM for type safety
  • Valibot - Request validation
  • Bun - Ultra-fast JavaScript runtime with built-in PostgreSQL and Redis drivers

πŸ—„οΈ Database

  • PostgreSQL - Primary database
  • Redis - Caching and session management

πŸ”§ Development Tools

πŸ“¦ Installation (Docker Compose)

1. Clone the Repository

git clone https://github.com/iiivanpopov/beger.git
cd beger

2. Configure Environment Variables

Create a .env file in the root directory:

# Server Configuration
PORT=5333                                           # Backend port

JWT_ACCESS_SECRET=c9e5fd5df58770fea7063ebad0c78d6c  # Generate new secret for production
JWT_REFRESH_SECRET=2d03a2683014ad790487149e73d97bc2 # Generate new secret for production

# Admin Credentials
ADMIN_PASSWORD=                                     # Set a strong admin password

# Database Configuration
DB_USER=postgres                                    # PostgreSQL username
DB_PASSWORD=postgres                                # PostgreSQL password (change in production!)

# Google Sheets Integration
SHEET_URL=""                                        # Your Google Sheet CSV URL (in quotes)

The default JWT secrets shown above are for development only. Generate strong, random secrets using:

openssl rand -hex 32

πŸ“ Note: The SHEET_URL must be enclosed in double quotes

2.1 Custom Port Configuration (Optional)

If you need to use a different backend port, update both files:

.env:

PORT=4111  # Your custom port

apps/frontend/nginx.conf:

location /api/ {
  proxy_pass http://backend:4111/api/;
  # ... rest of configuration
}

3. Build the Project

docker-compose build

4. Start the Application

docker-compose up

Or run in detached mode:

docker-compose up -d

The application will be available at:

πŸ”„ Updating the Application

When new updates are available:

docker-compose down

git pull

docker-compose build

docker-compose up -d

πŸ“Š Google Sheets Integration Setup

The application supports importing data from Google Sheets. Here's how to set it up:

Step 1: Prepare Your Sheet

Ensure your Google Sheet has the exact column headers as shown:

Proper Format

Step 2: Publish to Web

  1. Open your sheet in Google Sheets
  2. Go to File β†’ Share β†’ Publish to web
  3. In the modal, select CSV (Comma-Separated Values) format (not "Web Page")
  4. Click Publish and copy the generated URL

Get Sheet URL

Step 3: Add to Environment

Add the CSV URL to your .env file (remember to use quotes):

SHEET_URL="https://docs.google.com/spreadsheets/d/e/YOUR_SHEET_ID/pub?output=csv"

πŸ“ Project Structure

beger/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ backend/
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ app/        # App init layer
β”‚   β”‚   β”‚   β”œβ”€β”€ modules/    # Feature modules
β”‚   β”‚   β”‚   β”œβ”€β”€ config/     # Configuration layer
β”‚   β”‚   β”‚   β”œβ”€β”€ database/   # Database schemas & migrations
β”‚   β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”‚   └── utils/      # Project shared utils
β”‚   β”‚   └── drizzle/        # Database migrations
β”‚   └── frontend/
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ api/        # API hooks & requests
β”‚       β”‚   β”œβ”€β”€ routes/     # Tanstack Router routes
β”‚       β”‚   β”œβ”€β”€ pages/      # Page components
β”‚       β”‚   β”œβ”€β”€ components/ # Business components
β”‚       β”‚   β”œβ”€β”€ providers/  # React context providers
β”‚       β”‚   β”œβ”€β”€ styles/     # CSS global styles
β”‚       β”‚   └── shared/     # UI-Kit, hooks, utils
β”œβ”€β”€ assets/
β”œβ”€β”€ docker-compose.yml
└── .env

πŸ‘οΈ Preview

Internationalization not included!

About

Beger Application Monorepo

Topics

Resources

Stars

Watchers

Forks

Languages