Skip to content
Open

ddd #370

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 4 additions & 78 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,12 @@
# Celo Composer CLI
# ZİYARETCİ DEFTERİ ( CELO )
<img width="1123" height="559" alt="image" src="https://github.com/user-attachments/assets/1713fe5d-93d8-4ff9-be29-fc8057b7bc4f" />
Zonguldak Buılders Workshop Projesi
<img width="1911" height="965" alt="image" src="https://github.com/user-attachments/assets/044e7cad-2d7c-4a23-b4d8-6d2ed60bf64e" />

A powerful CLI tool for generating customizable Celo blockchain starter kits with modern monorepo architecture.

## Features

- 🚀 **Modern Stack**: Next.js 14, TypeScript, Tailwind CSS, shadcn/ui
- 📦 **Monorepo Ready**: Turborepo with PNPM workspaces
- 🎨 **Beautiful UI**: Pre-configured shadcn/ui components
- 🔧 **Developer Experience**: Interactive prompts and clear feedback
- 🌍 **Celo Optimized**: Ready for Celo blockchain development

## Installation

```bash
# Install dependencies
pnpm install

# Build the CLI
pnpm build

# Link for global usage (optional)
npm link
```

## Usage

### Create a new Celo project

```bash
# Interactive mode
pnpm dev create

# With project name
pnpm dev create my-celo-app

# With options
pnpm dev create my-celo-app --description "My awesome Celo app" --skip-install
```

### Command Options

- `--description <description>` - Project description
- `--skip-install` - Skip package installation

## Generated Project Structure

```
my-celo-app/
├── apps/
│ └── web/ # Next.js application
├── packages/
│ ├── ui/ # shadcn/ui components
│ └── utils/ # Shared utilities
├── package.json # Root package.json
├── pnpm-workspace.yaml # PNPM workspace config
├── turbo.json # Turborepo configuration
└── tsconfig.json # TypeScript configuration
```

## Development

```bash
# Start development
pnpm dev

# Build
pnpm build

# Lint
pnpm lint

# Run tests
pnpm test
```

## Tech Stack

- **CLI Framework**: Commander.js + Inquirer.js
- **Template Engine**: Plop.js
- **Language**: TypeScript
- **Generated Projects**: Next.js 14 + Turborepo + shadcn/ui

## License

MIT
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ program
.description('Create a new Celo project')
.argument('[project-name]', 'Name of the project')
.option('-d, --description <description>', 'Project description')
.option('-t, --template <type>', 'Template type (basic, farcaster-miniapp, minipay, ai-chat)')
.option('-t, --template <type>', 'Template type (basic, farcaster-miniapp, minipay, ai-chat, guestbook)')
.option('--wallet-provider <provider>', 'Wallet provider (rainbowkit, thirdweb, none)')
.option('-c, --contracts <framework>', 'Smart contract framework (hardhat, foundry, none)')
.option('--smart-contract <template>', 'Smart contract template to include (none, guestbook)')
.option('--skip-install', 'Skip package installation')
.option('-y, --yes', 'Skip all prompts and use defaults')
.action(createCommand);
Expand Down
62 changes: 33 additions & 29 deletions templates/contracts/hardhat/contracts/Lock.sol.hbs
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;

// Uncomment this line to use console.log
// import "hardhat/console.sol";

contract Lock {
uint public unlockTime;
address payable public owner;

event Withdrawal(uint amount, uint when);

constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);

unlockTime = _unlockTime;
owner = payable(msg.sender);
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/// @title Simple on-chain Guestbook / Visitor Log
/// @author 0xmerdows (example)
/// @notice Küçük bir ziyaretçi hatıra defteri (guestbook) akıllı kontratı.
/// - Ziyaretçi isim + mesaj bırakır (string).
/// - Mesaj bırakılırken opsiyonel olarak Ether gönderebilir (bahşiş).
/// - Kontrat sahibi mesajları silebilir (soft delete) ve kontratta biriken Ether'i çekebilir.
contract Guestbook {
struct Entry {
address author;
string name;
string message;
uint256 timestamp;
bool deleted;
uint256 value; // gönderilen Ether (wei)
}

function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);
Entry[] private entries;
address public owner;

require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");
event NewEntry(
uint256 indexed index,
address indexed author,
string name,
string message,
uint256 timestamp,
uint256 value
);

emit Withdrawal(address(this).balance, block.timestamp);
event EntryDeleted(uint256 indexed index, address indexed moderator);
event OwnerChanged(address indexed previousOwner, address indexed newOwner);
event Withdraw(address indexed to, uint256 amount);

modifier onlyOwner() {
require(msg.sender == owner, "Guestbook: caller is not the owner");

owner.transfer(address(this).balance);
}
}