Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Book And Comment

This project is an implementation of a system to manage writers, readers, and books using the Motoko programming language, suitable for deployment on the Internet Computer. The system is designed to handle various entities and their interactions within a literary context.

Features

  • Writer Management: Writers can add their books to the system along with comments. They have the option to make their identity visible or remain anonymous.
  • Reader Engagement: Readers can select books, provide feedback, and choose whether their preferences and feedback are visible.
  • Book Catalog: A collection of books is maintained, each associated with a writer (if not anonymous) and comments from both writers and readers.
  • Feedback System: Readers can leave feedback on books, contributing to a community-driven review system.

Data Structures

  • Writer, Reader, and Book types are defined to encapsulate the attributes of each entity.
  • HashMaps are used to store and manage books, writers, readers, comments, and feedback efficiently.
  • Buffers are utilized to maintain a dynamic list of writers.

Functions

  • addWriter: Adds a writer and their book to the system, updating the book catalog and comments accordingly.
  • addReader: Records a reader's book choice and feedback, influencing the visibility of their interactions based on their preference.

Installation

This system exemplifies the use of the actor model in Motoko to manage stateful interactions in a decentralized environment. It showcases the potential for building community-driven platforms on the Internet Computer. To get started, you might want to explore the project directory structure and the default configuration file. Working with this project in your development environment will not affect any production deployment or identity tokens.

To learn more before you start working with bounty_project, see the following documentation available online:

If you want to start working on your project right away, you might want to try the following commands:

cd bounty_project/
dfx help
dfx canister --help

Running the project locally

If you want to test your project locally, you can use the following commands:

# Starts the replica, running in the background
dfx start 

# Deploys your canisters to the replica and generates your candid interface
dfx deploy

Note on frontend environment variables

If you are hosting frontend code somewhere without using DFX, you may need to make one of the following adjustments to ensure your project does not fetch the root key in production:

  • setDFX_NETWORK to ic if you are using Webpack
  • use your own preferred method to replace process.env.DFX_NETWORK in the autogenerated declarations
    • Setting canisters -> {asset_canister_id} -> declarations -> env_override to a string in dfx.json will replace process.env.DFX_NETWORK with the string in the autogenerated declarations
  • Write your own createActor constructor

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages