8000 GitHub - mhariemars/SheisDevcon-Mhars: ICP Codecamp portolio template
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mhariemars/SheisDevcon-Mhars

 
 

Repository files navigation

DEVCON x ICP Smart Contracts Portfolio

Level 2 Motoko Template

Welcome to your new Portfolio Template project, and welcome to the Internet Computer development community! This README serves as an introduction to get you started quickly with your project.

By default, creating a new project adds this README and some template files to your project directory. Feel free to customize the template files and include your own code to speed up your development cycle.


Getting Started

In order to use this template make sure that you are using dfx version 0.15.1 for native javascript development framework

Walkthrough how to get 0.15.1 using dfx version manager.

dfxvm install 0.15.1 dfxvm default 0.15.1 restart your terminal HAPPY CODING

Before you dive into development, here are some key resources to help you get familiar with the project:

Initial Setup

To get started, 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.

Project Setup Commands

Once you're ready to work on your project, here are some commands to help you get started:

cd portfolio_template/
dfx help
dfx canister --help

Running the Project Locally

To test and run your project locally, follow these steps:

  1. Start the Replica: This command starts the replica running in the background.

    dfx start --background
  2. Deploy the Canisters: Deploy your canisters to the replica and generate your candid interface.

    dfx deploy

    Once the deployment is complete, your application will be available at:

    http://localhost:4943?canisterId={asset_canister_id}
    
  3. Generate a New Candid Interface: If you make any changes to the backend canister, regenerate the candid interface by running:

    npm run generate

    This is recommended before starting the frontend development server, and it will be automatically run when you execute dfx deploy.


Frontend Development

If you're working on the frontend and want to start the development server, use the following command:

npm start

This will start the frontend server at:

http://localhost:8080

API requests will be proxied to the replica at port 4943.


Frontend Environment Variables

If you are hosting the frontend code outside of DFX, you may need to make adjustments to ensure that the project doesn’t fetch the root key in production:

  • Set DFX_NETWORK to ic if you are using Webpack.
  • Use your own method to replace process.env.DFX_NETWORK in the autogenerated declarations:
    • Set canisters -> {asset_canister_id} -> declarations -> env_override to a string in dfx.json.
    • Write your own createActor constructor for more advanced setups.

Summary

You're now ready to start working with the Portfolio Template project. Customize it, build your canisters, and have fun developing on the Internet Computer. If you run into any issues or need help, feel free to check the official documentation.

Happy coding! 🚀

About

ICP Codecamp portolio template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 73.6%
  • JavaScript 19.5%
  • Motoko 4.0%
  • CSS 2.9%
0