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.
- 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.
Writer,Reader, andBooktypes are defined to encapsulate the attributes of each entity.HashMapsare used to store and manage books, writers, readers, comments, and feedback efficiently.Buffersare utilized to maintain a dynamic list of writers.
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.
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 --helpIf 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 deployIf 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:
- set
DFX_NETWORKtoicif you are using Webpack - use your own preferred method to replace
process.env.DFX_NETWORKin the autogenerated declarations- Setting
canisters -> {asset_canister_id} -> declarations -> env_override to a stringindfx.jsonwill replaceprocess.env.DFX_NETWORKwith the string in the autogenerated declarations
- Setting
- Write your own
createActorconstructor