DaX f929c384c1
Some checks failed
Deploy / deploy-frontend (push) Successful in 2m5s
Deploy / tag-deploy (push) Has been skipped
Deploy / detect (push) Successful in 5s
Deploy / deploy-api (push) Failing after 22s
Fix migration step: source nvm before running node on EC2
SSM runs with minimal PATH that doesn't include nvm-managed node.
Source nvm.sh before executing migrate.js.
2026-03-05 01:43:41 +01:00
dd
2025-06-18 23:28:55 +02:00
2025-06-17 18:39:09 +02:00

Filamenteka

A web application for tracking Bambu Lab filament inventory with automatic color coding.

Features

  • Automatic Color Coding - Table rows are automatically colored based on filament colors
  • Search & Filter - Quick search across all filament properties
  • Sortable Columns - Click headers to sort by any column
  • Gradient Support - Special handling for gradient filaments like Cotton Candy Cloud
  • Responsive Design - Works on desktop and mobile devices
  • Sale Management - Bulk sale pricing with countdown timers
  • Admin Panel - Protected dashboard for inventory management
  • Spool Types - Support for both regular and refill spools

Technology Stack

  • Frontend: Next.js + React + TypeScript + Tailwind CSS
  • Backend: Node.js API server (Express)
  • Database: PostgreSQL (AWS RDS)
  • Infrastructure: AWS CloudFront + S3 (Frontend), EC2 (API), RDS (Database)
  • CI/CD: Gitea Actions
  • IaC: Terraform

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL (for local development)
  • AWS Account (for deployment)
  • Terraform 1.0+ (for infrastructure)

Setup Instructions

1. Clone the Repository

git clone https://git.demirix.dev/DaX/Filamenteka.git
cd Filamenteka

2. Install Dependencies

npm install

3. Environment Setup

Create a .env.local file for local development:

NEXT_PUBLIC_API_URL=http://localhost:4000/api

4. Deploy with Terraform

cd terraform
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your values

terraform init
terraform plan
terraform apply

Local Development

# Run development server
npm run dev

# Run tests
npm test

# Run linting
npm run lint

# Check for security issues
npm run security:check

Visit http://localhost:3000 to see the app.

Table Format

The filament table displays these columns:

  • Tip - Material type (e.g., PLA, PETG, ABS)
  • Finish - Finish type (e.g., Basic, Matte, Silk)
  • Boja - Color name (e.g., Mistletoe Green, Hot Pink)
  • Refill - Number of refill spools
  • Spulna - Number of regular spools
  • Kolicina - Total quantity (refill + spulna)
  • Cena - Price per unit
  • Sale - Active sale percentage and end date

Color Mapping

The app includes mappings for common Bambu Lab colors:

  • Basic colors: Red, Blue, Green, Yellow, etc.
  • Special colors: Mistletoe Green, Indigo Purple, Hot Pink, etc.
  • Gradient filaments: Cotton Candy Cloud
  • Matte finishes: Scarlet Red, Marine Blue, etc.

Unknown colors default to light gray.

Deployment

Pushing to main triggers automatic deployment via Gitea Actions:

  • Frontend changes are built, tested, and deployed to S3/CloudFront
  • API changes are deployed to EC2 via AWS SSM

Manual deployment is also available:

# Frontend
./scripts/deploy-frontend.sh

# API
./scripts/deploy-api-update.sh

Admin Panel

Access the admin panel at /upadaj for:

  • Managing filament inventory
  • Adding/editing/deleting filaments
  • Managing color definitions and pricing
  • Bulk sale management

Adding New Colors

Colors can be managed through:

  1. Admin Panel: Navigate to /upadaj/colors to add colors via UI
  2. Code: Edit src/data/bambuLabColors.ts for frontend color display:
export const bambuLabColors: Record<string, ColorMapping> = {
  // ... existing colors
  'New Color Name': { hex: '#HEXCODE' },
};

Database Migrations

Run database migrations:

# Run all pending migrations
npm run migrate

# Clear migration history (development only)
npm run migrate:clear

API Deployment

Deploy API server updates:

# Use the deployment script
./scripts/deploy-api-update.sh

Troubleshooting

Color Not Showing

  • Check if the color name matches exactly in the database
  • Ensure color exists in colors table
  • Add the color mapping to bambuLabColors.ts
  • Colors are case-insensitive but spelling must match

Build Errors

  • Run npm run test:build to verify build succeeds
  • Check TypeScript errors with npx tsc --noEmit
  • Ensure all environment variables are set

Database Connection Issues

  • Verify PostgreSQL is running
  • Check connection string in environment variables
  • Ensure database migrations have been run

License

MIT

Description
3D printing filament inventory management for Bambu Lab filaments
Readme 16 MiB
Languages
TypeScript 76.8%
JavaScript 11.4%
HCL 4.7%
Shell 3.7%
PLpgSQL 2.3%
Other 1.1%