An open API service indexing awesome lists of open source software.

https://github.com/Olanetsoft/compact-by-example

Learn Midnight's Compact language through practical examples.
https://github.com/Olanetsoft/compact-by-example

compact midnightntwrk privacy smart-contracts

Last synced: 3 months ago
JSON representation

Learn Midnight's Compact language through practical examples.

Awesome Lists containing this project

README

          

# Compact by Example

Learn Midnight's Compact language through practical examples. This project is built on the Midnight Network.

Visit [https://compact-by-example.org](https://compact-by-example.org). Inspired by [Solidity by Example](https://solidity-by-example.org/).

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING.md)
[![Made for Midnight](https://img.shields.io/badge/Made%20for-Midnight%20Network-0066FF.svg)](https://midnight.network)
[![Documentation](https://img.shields.io/badge/docs-compact--by--example.org-3385FF.svg)](https://compact-by-example.org)
[![Community](https://img.shields.io/badge/Discord-Join%20Us-7289DA.svg?logo=discord&logoColor=white)](https://discord.com/invite/midnightnetwork)
[![GitHub Stars](https://img.shields.io/github/stars/Olanetsoft/compact-by-example?style=social)](https://github.com/Olanetsoft/compact-by-example)

## What is This?

A community-driven collection of Compact smart contract examples for building privacy-preserving applications on Midnight Network. Each example is complete, tested, and ready to run.

## Quick Start

**Prerequisites:**

- Node.js v18 or higher
- npm or yarn

**Installation:**

```bash
# Clone the repository
git clone https://github.com/Olanetsoft/compact-by-example.git
cd compact-by-example

# Install dependencies
npm install

# Start the development server
npm run dev
```

Visit `http://localhost:3000` to view the documentation locally.

## Project Structure

```
compact-by-example/
├── basics/ # Fundamentals
│ ├── hello-world.mdx
│ ├── first-app.mdx
│ └── primitive-types.mdx
├── .github/ # Issue templates, PR templates, CI/CD
├── images/ # Assets and graphics
├── logo/ # Brand assets
├── docs.json # Mintlify configuration
└── index.mdx # Homepage
```

## Content Categories

Help us build these sections:

- **Privacy & ZK Proofs** - Zero-knowledge circuits and private state
- **Smart Contracts** - Tokens, NFTs, and DAOs
- **DeFi** - Decentralized finance protocols
- **Advanced Patterns** - Complex contract architectures
- **Security** - Best practices and common vulnerabilities

## Contributing

We welcome contributions! Whether you're fixing a typo, improving documentation, or adding a new example.

**How to contribute:**

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/your-example`)
3. Make your changes (follow our [style guide](./CONTRIBUTING.md))
4. Test your code (`npm run dev`)
5. Commit with clear messages (`git commit -m 'Add: your feature'`)
6. Push to your branch (`git push origin feature/your-example`)
7. Open a Pull Request

Read our [Contributing Guide](./CONTRIBUTING.md) for detailed instructions.

## Community

- [Discord](https://discord.com/invite/midnightnetwork) - Ask questions, share projects
- [Twitter](https://twitter.com/MidnightNtwrk) - Latest updates
- [YouTube](https://www.youtube.com/@MidnightNetwork) - Video tutorials

## Resources

- [Midnight Documentation](https://docs.midnight.network) - Official docs

## License

MIT - see [LICENSE](./LICENSE) file for details.

---

Built by the Midnight community • [Report Bug](https://github.com/Olanetsoft/compact-by-example/issues/new?template=bug_report.md) • [Request Feature](https://github.com/Olanetsoft/compact-by-example/issues/new?template=feature_request.md) • [Submit Example](https://github.com/Olanetsoft/compact-by-example/issues/new?template=new_example.md)