Skip to content
Closed
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
100 changes: 33 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,52 @@
# Celo Composer CLI
# Savemny Project 💰 Micro Savings & Mobile Payroll Platform (Celo + DeFi)
<img width="1213" height="367" alt="image" src="https://github.com/user-attachments/assets/a3db5625-f735-4b09-a138-ca5d9950f588" />
> A DeFi-powered micro-savings and mobile payroll platform where users receive their salaries in stablecoins and invest for the future by staking CELO through an integrated retirement fund.

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

## Features
## 🚀 Overview

- 🚀 **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
This project combines **Decentralized Finance (DeFi)** with a **mobile salary management system** to help users save, invest, and plan for the future — all on the **Celo blockchain**.

## Installation
### ✳️ Core Features
- **Micro Savings:** Users can save small amounts regularly, powered by smart contracts.
- **Mobile Payroll:** Salaries are paid directly to users’ wallets in stablecoins (e.g. cUSD).
- **CELO Staking:** Integrated retirement fund where users can stake their CELO for long-term returns.
- **Transparent & Secure:** Built on Celo — optimized for mobile-first, low-cost DeFi access.

```bash
# Install dependencies
pnpm install
---

# Build the CLI
pnpm build
## 🧱 Tech Stack

# Link for global usage (optional)
npm link
```
| Layer | Technology |
|-------|-------------|
| Blockchain | [Celo](https://celo.org/) |
| Smart Contracts | Solidity, Hardhat |
| Frontend | React / Next.js |
| Backend (optional) | Node.js + Express |
| Wallet Integration | Celo Wallet / RainbowKit / Thirdweb |
| Deployment | Celo Testnet (Alfajores) or Mainnet |

## Usage
---
<img width="1421" height="652" alt="image" src="https://github.com/user-attachments/assets/c142d48b-5fbe-48b8-99a2-4adbe300d28a" />

### Create a new Celo project
## ⚙️ Installation

```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
# 1. Clone the repository
git clone [https://github.com/yourusername/micro-savings-platform.git](https://github.com/berkcicekk/celo-savemny-project-zonguldak)

## 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
# 2. Enter the directory
cd micro-savings-platform

# Build
pnpm build
# 3. Install dependencies
npm install

# Lint
pnpm lint
# 4. Compile and deploy smart contracts
npx hardhat compile
npx hardhat run scripts/deploy.js --network alfajores

# 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
74 changes: 52 additions & 22 deletions templates/contracts/hardhat/contracts/Lock.sol.hbs
Original file line number Diff line number Diff line change
@@ -1,34 +1,64 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

// Uncomment this line to use console.log
// import "hardhat/console.sol";
/**
* @title MicroSavingsPayroll
* @dev Basit bir örnek: maaş ödemesi ve CELO staking mantığı
*/
contract MicroSavingsPayroll {

contract Lock {
uint public unlockTime;
address payable public owner;
address public owner; // Platform sahibi
mapping(address => uint256) public balances; // Kullanıcı bakiyeleri
mapping(address => uint256) public staked; // Stake edilmiş miktar

event Withdrawal(uint amount, uint when);
event SalaryPaid(address indexed user, uint256 amount);
event Staked(address indexed user, uint256 amount);
event Unstaked(address indexed user, uint256 amount);

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

unlockTime = _unlockTime;
owner = payable(msg.sender);
modifier onlyOwner() {
require(msg.sender == owner, "Only owner can call");
_;
}

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);
/**
* @dev Kullanıcıya maaş ödemesi yapar (örneğin stablecoin transferi yerine CELO native token)
*/
function paySalary(address user) external payable onlyOwner {
require(msg.value > 0, "Salary must be greater than 0");
balances[user] += msg.value;
emit SalaryPaid(user, msg.value);
}

require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");
/**
* @dev Kullanıcı maaş bakiyesinin bir kısmını stake eder
*/
function stake(uint256 amount) external {
require(balances[msg.sender] >= amount, "Insufficient balance");
balances[msg.sender] -= amount;
staked[msg.sender] += amount;
emit Staked(msg.sender, amount);
}

emit Withdrawal(address(this).balance, block.timestamp);
/**
* @dev Kullanıcı stake ettiği miktarı geri alır (örnek amaçlı, faiz eklenmemiştir)
*/
function unstake(uint256 amount) external {
require(staked[msg.sender] >= amount, "Not enough staked");
staked[msg.sender] -= amount;
balances[msg.sender] += amount;
emit Unstaked(msg.sender, amount);
}

owner.transfer(address(this).balance);
/**
* @dev Kullanıcı bakiyesini çeker
*/
function withdraw(uint256 amount) external {
require(balances[msg.sender] >= amount, "Not enough balance");
balances[msg.sender] -= amount;
payable(msg.sender).transfer(amount);
}
}