diff --git a/.gitignore b/.gitignore index 3aa970b..a0db81a 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ npm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* +bun-debug.log* # local env files .env.local diff --git a/README.md b/README.md index a0091eb..264e446 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,27 @@ LocalGreenChain is a revolutionary plant tracking system that uses blockchain te ## 🚀 Quick Start ### Prerequisites -- Node.js 14+ and npm/yarn +- **Bun 1.0+** (https://bun.sh) - A fast JavaScript runtime and package manager - Basic knowledge of plant propagation (optional but helpful!) +### Why Bun? +LocalGreenChain uses Bun for faster installation, builds, and runtime performance: +- **3x faster** package installation compared to npm +- **Native TypeScript support** without configuration +- **Built-in bundler** for optimal production builds +- **Compatible** with npm packages + +### Installing Bun +If you don't have Bun installed: + +```bash +# macOS/Linux/WSL +curl -fsSL https://bun.sh/install | bash + +# Or using npm +npm install -g bun +``` + ### Installation 1. **Clone the repository** @@ -53,9 +71,7 @@ cd localgreenchain 2. **Install dependencies** ```bash -npm install -# or -yarn install +bun install ``` 3. **Set up environment variables** (optional) @@ -70,9 +86,7 @@ PLANTS_NET_API_KEY=your_api_key_here 4. **Run the development server** ```bash -npm run dev -# or -yarn dev +bun run dev ``` 5. **Open your browser** @@ -204,6 +218,7 @@ GET /api/plants/network ## 🏗️ Architecture ### Tech Stack +- **Runtime**: Bun (fast JavaScript runtime and package manager) - **Frontend**: Next.js, React, TypeScript, Tailwind CSS - **Blockchain**: Custom implementation with proof-of-work - **Storage**: JSON file-based (production can use database) @@ -280,7 +295,7 @@ git checkout -b feature/amazing-feature # ... # Run tests (when available) -npm test +bun test # Commit with clear message git commit -m "Add amazing feature" diff --git a/bunfig.toml b/bunfig.toml new file mode 100644 index 0000000..d9f3644 --- /dev/null +++ b/bunfig.toml @@ -0,0 +1,19 @@ +# Bun configuration for LocalGreenChain + +[install] +# Install dependencies from the lockfile if it exists +frozenLockfile = false + +# Configure which registries to use +registry = "https://registry.npmjs.org/" + +# Cache directory +cache = "node_modules/.cache/bun" + +[run] +# Automatically install dependencies when running scripts +autoInstall = true + +[test] +# Test configuration (when tests are added) +preload = [] diff --git a/package.json b/package.json index 1d771b6..9e37e25 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,18 @@ { - "name": "example-marketing", - "version": "1.5.0", + "name": "localgreenchain", + "version": "1.0.0", "private": true, "license": "MIT", "scripts": { "dev": "next dev -p 3001", "build": "next build", - "preview": "next build && next start -p 3001", + "start": "next start -p 3001", + "preview": "bun run build && bun run start", "lint": "next lint", "cy:open": "cypress open", "cy:run": "cypress run", - "test:e2e": "start-server-and-test 'yarn preview' http://localhost:3001 cy:open", - "test:e2e:ci": "start-server-and-test 'yarn preview' http://localhost:3001 cy:run" + "test:e2e": "start-server-and-test 'bun run preview' http://localhost:3001 cy:open", + "test:e2e:ci": "start-server-and-test 'bun run preview' http://localhost:3001 cy:run" }, "dependencies": { "@tailwindcss/forms": "^0.4.0",