Skip to content
Merged
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
73 changes: 73 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Root Makefile for CrowdPass Project

.PHONY: setup build test test-contracts test-client deploy-testnet lint clean optimize docker-build docker-up docker-down

# Setup all dependencies
setup:
@echo "Installing dependencies for all components..."
cd client && npm install
cd soroban-client && npm install
cd tokenbound-client && npm install

# Build all components
build: build-contracts build-client

# Build Soroban contracts
build-contracts:
@echo "Building Soroban contracts..."
cd soroban-contract && cargo build --target wasm32-unknown-unknown --release

# Build Vite frontend
build-client:
@echo "Building frontend client..."
cd client && npm run build

# Run all tests
test: test-contracts test-client

# Run contract tests
test-contracts:
@echo "Running contract tests..."
cd soroban-contract && cargo test

# Run frontend tests
test-client:
@echo "Running frontend tests..."
cd client && npm run test:e2e

# Deploy contracts to testnet
deploy-testnet:
@echo "Deploying contracts to testnet..."
# Note: This assumes soroban-cli is installed and configured
cd soroban-contract && cargo build --target wasm32-unknown-unknown --release
# Example deployment for event_manager
soroban contract deploy \
--wasm soroban-contract/target/wasm32-unknown-unknown/release/event_manager.wasm \
--network testnet

# Run all linters
lint:
@echo "Running linters..."
cd client && npm run lint

# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
cd soroban-contract && cargo clean
cd client && rm -rf dist
cd client && rm -rf node_modules

# Optimize WASM files
optimize:
@echo "Optimizing WASM files..."
@find soroban-contract/target/wasm32-unknown-unknown/release -name "*.wasm" -exec soroban contract optimize --wasm {} \;

# Docker commands
docker-build:
docker-compose build

docker-up:
docker-compose up -d

docker-down:
docker-compose down
52 changes: 33 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,37 +144,51 @@ CrowdPass utilizes Stellar's Soroban smart contracts to implement:

### Installation

#### Using Makefile (Recommended)
```bash
# Clone the repository
git clone https://github.com/your-org/crowdpass.git
cd crowdpass
git clone https://github.com/crowdpass-live/tokenbound_impl.git
cd tokenbound_impl

# Install dependencies
npm install

# Build smart contracts
cd contracts
soroban contract build
# Setup all dependencies (client and contracts)
make setup

# Deploy to testnet
soroban contract deploy \
--wasm target/wasm32-unknown-unknown/release/crowdpass.wasm \
--network testnet
# Build all components
make build
```

### Quick Start
#### Using Docker (Local Development)
```bash
# Start all services (Stellar node, Contracts, Frontend)
make docker-up

# View logs
docker-compose logs -f frontend
```

#### Manual Installation
```bash
# Run local development server
npm run dev
# Install root dependencies (if any)
npm install

# Run tests
npm test
# Build smart contracts
cd soroban-contract
cargo build --target wasm32-unknown-unknown --release

# Deploy to production
npm run deploy
# Run frontend
cd ../client
npm install
npm run dev
```

### Quick Start Commands
- `make setup` - Install all dependencies
- `make build` - Build contracts and frontend
- `make test` - Run all tests
- `make docker-up` - Spin up local development environment
- `make docker-down` - Stop local environment
- `make lint` - Run linters

## Use Cases

### 🎵 Concert & Festival Ticketing
Expand Down
1 change: 1 addition & 0 deletions client/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 23.4.0
19 changes: 19 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Dockerfile for Frontend (Vite)
FROM node:18-alpine

WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy source code
COPY . .

# Expose Vite port
EXPOSE 5173

# Run development server
CMD ["npm", "run", "dev", "--", "--host"]
Loading
Loading