Giter Club home page Giter Club logo

proyecto_azle's Introduction

Fullstack dApp (Azle + Express + NextJS + ICP)

This template is designed to easily build applications deployed on ICP using Azle + Express for RESTful APIs and Next.js for frontend development.

Run Locally

Clone the project

  git clone https://github.com/adrian-d-hidalgo/azle-api-rest-nextjs

Go to the project directory

  cd azle-api-rest-nextjs

Install dependencies

npm install

Create a .env file:

# Create .env file
cp frontend/.env-example frontend/.env

Start a ICP local replica:

dfx start --background --clean

Get your canister ids:

# Create canisters
dfx canister create --all

# Get backend canister id
dfx canister id backend

# Get internet-identity canister id
dfx canister id internet-identity

Your .env file should look something like this:

# Replace BACKEND_CANISTER_ID with your backend canister id
NEXT_PUBLIC_API_REST_URL=http://BACKEND_CANISTER_ID.localshot:4943
# Replace INTERNET_IDENTITY_CANISTER_ID with your internet-identity canister id
NEXT_PUBLIC_INTERNET_IDENTITY_URL=http://INTERNET_IDENTITY_CANISTER_ID.localshot:4943

Deploy your canisters:

dfx deploy

You will receive a result similar to the following (ids could be different four you):

URLs:
  Frontend canister via browser
    frontend: http://127.0.0.1:4943/?canisterId=be2us-64aaa-aaaaa-qaabq-cai
  Backend canister via Candid interface:
    backend: http://127.0.0.1:4943/?canisterId=bd3sg-teaaa-aaaaa-qaaba-cai&id=bkyz2-fmaaa-aaaaa-qaaaq-cai

Open your web browser and enter the Frontend URL to view the web application in action.

Test frontend without deploy to ICP Replica

Comment the next line into frontend/next.config.mjs file:

// output: "export",

Then, navitate to frontend folder:

cd frontend

Run the following script:

npm run dev

proyecto_azle's People

Contributors

adrian-d-hidalgo avatar lizbeth456 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.