AlgoLearn is an interactive platform designed to help users learn and practice algorithms revolving around Algorand Smart Contracts. Built with modern web technologies, it provides an intuitive interface and multi-language support to enhance the learning experience.
The application is live and can be accessed here: https://algo-learn.com
- Interactive Algorithm Practice: Solve practice problems and see step-by-step implementations of algorithms.
- Search Functionality: Quickly find chapters by title, content, or code snippets using a powerful search feature with real-time results.
- Multi-Language Code Compilation: Practice, compile, and test algorithms in Python, Java, Go, and more.
- Algorand SDK Support: Includes environment setup for Algorand code in Python (
py-algorand-sdk
), JavaScript (algosdk
), and Go (go-algorand-sdk
). - User-Friendly UI: Clean and responsive design built with Tailwind CSS for an intuitive user experience.
- State Management: Efficient state management implemented using React Hooks.
- Scalable Framework: Built with Next.js for optimal performance, scalability, and flexibility.
Category | Technologies/Tools |
---|---|
Frontend | React, Next.js (TypeScript), Tailwind CSS, Shadcn/UI, Lucide React, Axios, React Suspense, Next.js Image & Link components |
Backend | Next.js API Routes (for some tasks), Express/Node.js server (in separate code-runner context), Docker (for ephemeral code execution), Python + py-algorand-sdk , Node.js + algosdk , Go + pinned go-algorand-sdk in a single Docker image |
Containerization | Docker (Alpine-based image containing Python, Node, Go, plus pinned Algorand SDK dependencies) |
Data Management | Static Data Files (@/data/chapters ) |
Development Tools | Node.js, npm, TypeScript, ESLint, Prettier |
Version Control | GitHub |
UI/UX Features | Responsive Design, Dark Mode Toggle, Accessibility (ARIA), Dropdown Menus |
Icons | Lucide React Icons |
Security | Docker-based code isolation for user snippets, external code execution environment with pinned Go modules, error handling & logging |
Deployment | Vercel (for the Next.js frontend), GCP VM (e2-micro) hosting Docker-based code-runner backend |
Additional Libraries | Axios for HTTP requests, React Suspense for async data, Shadcn/UI for component library, plus environment variables & secrets management |
- User Submits Code: The user interface sends code (in Python, JavaScript, or Go) and the chosen language to the backend.
- Node.js/Express Server: A dedicated server receives the snippet and orchestrates ephemeral Docker containers.
- Docker Container: The snippet is mounted into a Docker container that already has Python, Node, Go, and the respective Algorand SDKs installed.
- Code Execution: Docker runs the snippet (e.g.,
python3 script.py
,node script.js
, orgo run main.go
). The server captures output or errors. - Result Returned: Output is sent back to the frontend in real time.
This approach ensures isolation (each snippet runs in a fresh environment) and includes Algorand SDK capabilities in all three languages for advanced contract interactions.
Follow these steps to set up the project locally:
-
Clone the Repository:
git clone https://github.com/mibernard/algolearn.git cd algolearn
-
Install Dependencies:
npm install
-
Run the Application:
npm run dev
By default, this starts the Next.js frontend on http://localhost:3000.
-
Configure the Backend (Optional Advanced):
- If you’re also running the Docker-based code-runner backend locally, you need:
- Docker installed.
- A suitable Docker image built with
go-algorand-sdk
,py-algorand-sdk
, andalgosdk
.
- Ensure environment variables for any external compilers or APIs (Judge0, etc.) are configured.
- If you’re also running the Docker-based code-runner backend locally, you need:
-
Access the Application: Open your browser to http://localhost:3000.
- The frontend is hosted on Vercel. Push to the main branch, and Vercel automatically builds and deploys.
- The Docker-based code-runner is hosted on a GCP e2-medium VM with Docker installed. The Node.js/Express server runs there (via PM2). Adjust your API endpoints to point from the Next.js app to this external service.
Contributions are welcome! Follow these steps:
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
. - Commit your changes:
git commit -m "Add a feature"
. - Push to the branch:
git push origin feature-name
. - Submit a pull request.
This project is licensed under the MIT License.
- Leo Costa - Smart Contract and Backend Developer
- Matthew Bernard - Frontend Developer