Coder Social home page Coder Social logo

starklings-app's Introduction

Starklings logo

Starklings App

A web interactive tutorial to start learning Cairo and Starknet.

About

Starklings App is a web interactive platform designed to help users kickstart their journey into learning Cairo. This platform is based on Starklings exercises, considered essential for those taking their first steps in understanding Cairo.

Our goal is to simplify the Starklings experience by getting rid of complex configurations and installations. Just access the app on a browser and start coding.

Components

Backend

The backend of the Starklings App is responsible for handling data processing and interactions with the Starknet exercises. Follow these steps to set up and run the backend:

cd api/

Install dependencies:

npm i

Run the development server:

npm run dev

Frontend

The frontend is the user interface of the Starklings App, providing an interactive environment for users to engage with Cairo exercises. To get the frontend up and running, follow these steps:

cd client/

Install dependencies:

npm i

Launch the development server:

npm run start

starklings-app's People

Contributors

dpinones avatar ndulio avatar nicon44 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

starklings-app's Issues

Add Dockerfile

Create a Dockerfile with the following:

  • NodeJS and npm
  • Rust
  • Scarb
  • Copy and launch the API
  • Expose the API

start from where you left off

save a currentExercise variable on local storage, so when a user closes the browser and opens it again, he can start from where he left off
add a start over button

create about modal

instead of showing the github button all the time in the navbar, show a ? icon that opens up a modal with more info about the project and the link to github

Compile cairo code

When compile button is pressed in the workspace, the cairo code should be compiled
if it succeeds, show a success notification, if not show an error notification

React app basic setup

configure the react app so it has

Add endpoint `scarb/build`

This endpoint should receive the user and the code. It should check if a folder exists for this user. If not, execute scarb new user. Now it should run scarb build inside this folder and return the result of this command.

Create endpoint resolver exercise

This endpoint should receive: user, exercise id, and code. Depending on the exercise, it should execute scarb build or scarb test.

add username for compile requests

username should be wallet in case there's a wallet connected, or a random string
in the second case, store the username in localStorage to use always the same value

Create Resolutions table

Create the resolutions table with the following schema.

CREATE TABLE Resolutions (
    id SERIAL PRIMARY KEY,
    user_name VARCHAR(255),
    exercise_id VARCHAR(255) REFERENCES Exercises(id),
    resolution_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE (user_name, exercise_id)
);

Additionally, when an exercise is completed, it should be saved in this table.

Add Logic Endpoints

Add logic to the endpoints:

  • /api/exercises
  • /api/exercises/:id
  • /api/groups
  • /api/groups/:id

Ensure that the requests match the mocks.

Also add a first version of the Cairo Code parser. Include making GET requests to the Starklings repository with Axios

API basic setup

Create an API with NodeJS. That includes:

  • Routers
  • Controllers
  • Connection to a PostgreSQL database

Add get hint functionality

Add a 'GET HINT' button in the action bar
on click, call the get hint API and show it as a (closable?) info alert in the left panel

Action bar should be always visible

Right now, when there is too much content in the left panel, you need to scroll down to see the action bar where the compile/next buttons live.

That bar should be always visible at the bottom of the left panel. If there's too much content, everything else should scroll.

Add match endpoint

A person can complete exercises without connecting their wallet. Now, if they complete several exercises and want to save their progress, they will connect their wallet. Create an endpoint to address this.

Add endpoint `scarb/test`

This endpoint should receive the user and the code. It should check if a folder exists for this user. If not, execute scarb new user. Now it should run scarb test inside this folder and return the result of this command.

Modify project structure

Create the api and client folders at the root of the project and move the files from the root to the client folder

Add Hint Endpoint

Add the endpoint /api/exercises/:id/hint. Based on the exercise id, it should retrieve the hint by consulting the info.toml in Starklings

Create a Script for the DB

Develop an SQL script that does the following:

  • Create the tables Exercises, Groups, and Modes.
  • Perform the inserts into these tables. For the Groups and Modes tables, extract the information from Starklings

Deploy the project on Render

  • Deploy the frontend and the backend on separate instances
  • Create a PostgreSQL database
  • Perform an end-to-end test

disable test exercises

There are some exercises that are of type 'demo'
We don't support those exercises yet
Show a warning message and enable next button on those exercises

Create workspace to complete a starklings exercise

create workspace that contains:

  • a space in the left where we can put the description of the exercise
  • an IDE in the right where the user can code
  • a button to compile the code in the right bottom

place this in a route /exercises/{exerciseName}

this page gets the exerciseName from the URL and makes the API call to get the exercise data and fill the components with it

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.