Skip to content

KooshaPari/BytePort

Repository files navigation

Byteport

An IAC Deployment + UX Generation platform for Software Developer Portfolios

With One IAC File Defining your Application Structured and related infra, Byteport deploys your project from your github repository onto your aws cloud platform, then utilizing chatgpt(soon llama) to then send object templates for additions to demonstration/portfolio sites to display and provide interaction access to these projects (and show them off automagically!)

Refer to Fixit-Go Chatta For Project Examples, Slickport for Portfolio integration example

Quickstart

Prepwork:

  • Install SpinCLI, golang etc
  • Clone Project, open 3 terminals -> backend\byteport -> spin build up, backend\nvms -> go run main.go , frontend\web -> npm i -> npm run dev
  • Grab Demosite and startup(if you don't want to setup api routes rn either remove the demonstrator call in the deploy function OR clone and run slickport with npm run dev and provide localhost:5180, ILOVEKUSHPAPI for credentials)
  • localhost:5173/signup -> signup -> first time setup -> home -> ready

Deploy Prep

  • Grab an application and in the root create a README.md, and an odin.nvms, follow pattern below: NAME: app DESCRIPTION: basic todo SERVICES:
  • NAME: "main" (REQUIRED - Points to url/, typically for frontend)
  • PATH: "./frontend"
  • PORT: 8080
  • ENV={hello=hi} (not tested)
  • NAME: "backend""
  • PATH: "./backend"
  • PORT: 8081
  • Readme will be fed as part of prompt to describe your project and add context, do a quick detailed bullet list etc
  • map all API URLs in your program to /service/apiaction other than main which takes /*
  • If too lazy refer to Chatta or Fixit-Go repos which are ready for byteport deployment

Deploy

  • Go to UI, pick repo, write name and descr(rest are useless atm) deploy, wait a bit (no user ui progress indication atm refer to spin instance in terminal), check portfolio and dashboard, instance now avail.

GPT YAP BELOW (outdated)

Project Manifesto: BytePort - MicroVM Cloud Management and Portfolio Integration

                   ▄     ▀
                              ▀  ▄
           ▄       ▀     ▄  ▄ ▄▀
                             ▄ ▀▄▄
                   ▄     ▀    ▀  ▀▄▀█▄
                                     ▀█▄

▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▀▀█
██████ █████ ███ █████ ███ █████ ███ ▀█
██████ █████ ███ █████ ▀▀▀ █████ ███ ▄█▄
██████ █████ ███ █████ █████ ███ ████▄
██████ █████ ███ █████ ▄▄▄ █████ ███ █████
██████ █████ ███ ████ ███ █████ ███ ████▀
▀▀▀██▄ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ██▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://loco.rs

environment: development
database: automigrate
logger: debug
compilation: debug
modes: server

listening on localhost:5150

Table of Contents

  1. Introduction
  2. Project Overview
  3. Objectives
  4. Technologies and Tools
  5. Project Architecture
  6. Development Phases and Timeline
  7. Implementation Details
  8. Deployment Strategy
  9. Security Considerations
  10. Testing and Quality Assurance
  11. Project Management and Collaboration
  12. Conclusion

Introduction

This manifesto outlines the development of BytePort, a cloud-based platform for deploying and managing applications using a custom-developed MicroVM technology called NanoVMS. The project leverages SvelteKit for the frontend and Loco.rs for the backend. BytePort aims to provide a Docker-like experience for deploying applications but uses lightweight virtual machines instead of containers, offering users greater control and isolation.

Project Overview

Project Name: BytePort - MicroVM Cloud Management and Portfolio Integration

MicroVM Technology Name: NanoVMS

Description:

BytePort is a cloud solution for deploying web applications and other projects directly from Git repositories. It creates and deploys pre-configured MicroVMs based on user specifications using the custom-developed NanoVMS technology. Upon successful deployment, BytePort integrates the project into the user's portfolio (e.g., kooshapari.com), adding project pages and linking the frontend of each web app to its respective project. Non-web app projects can also be deployed with custom configurations. Clients can view, debug, clone, and rebuild these instances as needed.

Objectives

Primary Objectives

  • Develop NanoVMS MicroVM Technology:
    • Create a custom lightweight virtualization platform to run single-purpose VMs efficiently.
  • Implement VM Management System:
    • Develop a system to manage MicroVMs without relying on Docker.
  • Frontend Development with SvelteKit:
    • Build a dynamic and responsive dashboard for users to manage their MicroVMs and portfolio integrations.
  • Backend Development with Loco.rs:
    • Implement a high-performance backend using Rust and Loco.rs for secure and efficient processing.
  • Integration with Git Repositories:
    • Allow users to deploy applications directly from their Git repositories using custom configuration files.
  • Portfolio Integration:
    • Automate the addition of project pages to user portfolios, including generating descriptions and screenshots.

Secondary Objectives

  • Future Integration of Custom Hypervisor and OS:
    • Design the system to allow future insertion of a custom hypervisor and operating system.
  • Learning-Oriented Development:
    • Combine learning and development phases, ensuring relevant concepts are learned just before implementation.
  • User Authentication and AWS Account Linking:
    • Use databases for secure user authentication and link to their AWS accounts.
  • LLM Integration:
    • Utilize Language Learning Models (LLMs) to generate portfolio components like descriptions, with opt-out and review options.

Technologies and Tools

Frontend

  • Framework: SvelteKit
  • Language: TypeScript
  • Styling: Tailwind CSS
  • State Management: Svelte stores
  • HTTP Client: Fetch API

Backend

  • Framework: Loco.rs (Rust)
  • Language: Rust
  • Database: SQLite (development), PostgreSQL (production)
  • ORM: Diesel
  • MicroVM Technology: NanoVMS (custom-developed)
  • Authentication: JSON Web Tokens (JWT)

DevOps and Deployment

  • Cloud Platform: AWS (EC2, S3, IAM)
  • CI/CD Tools: GitHub Actions
  • Containerization: Not used; deployment is based on MicroVMs

Development Tools

  • Version Control: Git
  • IDE: Visual Studio Code with Rust and Svelte extensions
  • Project Management: GitHub Projects

Project Architecture

Overview

BytePort will follow a modular architecture, with a focus on the custom-developed MicroVM technology, NanoVMS, which provides lightweight virtualization without the overhead of full virtual machines or the complexity of containers. The system allows users to deploy applications in isolated environments, customized through declarative configuration files.

Components

  1. Frontend (SvelteKit):

    • Manages user interactions, including submission of MicroVM configurations.
    • Provides interfaces for portfolio integration settings.
  2. Backend (Loco.rs):

    • Parses custom configuration files (similar to Dockerfile clones).
    • Generates scripts for MicroVM initialization.
    • Manages MicroVM provisioning, orchestration, and lifecycle using NanoVMS.
    • Handles business logic, data processing, and database interactions.
  3. Database:

    • Stores user data, MicroVM configurations, state information, and logs.
  4. MicroVM Layer (NanoVMS):

    • Custom-developed lightweight virtualization platform.
    • Runs single-purpose VMs efficiently.
    • Supports rapid cloning and booting of MicroVMs from base images.
  5. Portfolio Integration Module:

    • Automates updates to user portfolios after successful deployments.
    • Uses LLMs to generate project descriptions with user approval.

Data Flow

  • User Interaction:
    • Users submit configuration files via the frontend.
  • Configuration Parsing:
    • Backend parses the configuration and generates initialization scripts.
  • MicroVM Provisioning:
    • Backend orchestrates MicroVM creation and initialization using NanoVMS.
  • Application Deployment:
    • MicroVM pulls the Git repository and starts the application as per configuration.
  • Portfolio Update:
    • If enabled, the system updates the user's portfolio with project details.

Development Phases and Timeline

The development timeline combines learning and implementation phases, ensuring that relevant concepts are learned just before they are applied.

Phase 1: Project Setup and Planning (Week 1)

  • Learning Objectives:
    • Basics of Rust, SvelteKit, and virtualization concepts.
  • Development Tasks:
    • Set up repositories and development environments.
    • Define project requirements and specifications.
    • Design database schema and API endpoints.

Phase 2: Backend Foundations (Weeks 2-3)

  • Learning Objectives:
    • Advanced Rust programming and Loco.rs framework.
  • Development Tasks:
    • Implement user authentication and AWS account linking.
    • Develop basic API endpoints.
    • Integrate with the database using Diesel ORM.

Phase 3: Frontend Foundations (Weeks 3-4)

  • Learning Objectives:
    • Advanced features of SvelteKit and Tailwind CSS.
  • Development Tasks:
    • Set up the SvelteKit project.
    • Design UI/UX prototypes.
    • Implement authentication flows on the frontend.

Phase 4: Development of NanoVMS MicroVM Technology (Weeks 4-6)

  • Learning Objectives:
    • Deep understanding of virtualization, OS-level isolation, and kernel features.
  • Development Tasks:
    • Develop the NanoVMS platform to manage MicroVMs.
    • Implement the necessary system calls and kernel interactions.
    • Ensure the platform provides efficient and secure isolation.

Phase 5: Integration of VM Configuration Management (Weeks 6-7)

  • Learning Objectives:
    • Configuration management and automation tools.
  • Development Tasks:
    • Define the syntax and structure of custom configuration files.
    • Implement parsing logic in the backend.
    • Integrate MicroVM initialization scripts generation.

Phase 6: Portfolio Integration Module (Weeks 7-8)

  • Learning Objectives:
    • Basics of LLMs and their integration into applications.
  • Development Tasks:
    • Implement portfolio integration features.
    • Integrate LLMs for generating project descriptions.
    • Set up screenshot generation or image upload functionalities.

Phase 7: Full Integration and Testing (Weeks 8-9)

  • Learning Objectives:
    • Testing methodologies and tools.
  • Development Tasks:
    • Connect frontend with backend APIs.
    • Perform unit, integration, and end-to-end tests.
    • Debug and resolve identified issues.

Phase 8: Deployment and DevOps (Week 10)

  • Learning Objectives:
    • AWS services and CI/CD pipelines.
  • Development Tasks:
    • Set up AWS infrastructure (EC2 instances, IAM roles).
    • Configure CI/CD pipelines with GitHub Actions.
    • Deploy the application to the cloud environment.

Phase 9: Security and Optimization (Week 11)

  • Learning Objectives:
    • Security best practices and performance optimization.
  • Development Tasks:
    • Implement SSL/TLS for secure communication.
    • Optimize application performance.
    • Conduct security audits and penetration testing.

Phase 10: Documentation and Finalization (Week 12)

  • Development Tasks:
    • Write comprehensive documentation (API docs, user guides).
    • Prepare deployment scripts and environment configurations.
    • Conduct a final review and make necessary adjustments.

Implementation Details

Backend Implementation

  • Routing and Controllers:

    • Define RESTful API routes using Loco.rs.
    • Implement controllers for handling requests and responses.
  • Authentication Middleware:

    • Implement JWT-based authentication.
    • Secure API endpoints with middleware.
  • Database Models and ORM:

    • Define models for users, MicroVMs, projects, and logs.
    • Use Diesel ORM for database interactions.
  • MicroVM Management (NanoVMS):

    • Integrate NanoVMS for MicroVM provisioning and lifecycle management.
    • Implement APIs to create, start, stop, and delete MicroVMs.
    • Develop an abstraction layer for future integration with custom hypervisor and OS.
  • Configuration Parsing:

    • Develop logic to parse custom configuration files.
    • Generate initialization scripts based on user specifications.

Frontend Implementation

  • Routing:

    • Use SvelteKit's file-based routing for pages (e.g., /dashboard, /projects).
  • State Management:

    • Utilize Svelte stores for managing global state.
  • UI Components:

    • Create reusable components with Tailwind CSS styling.
    • Implement responsive design for various devices.
  • API Integration:

    • Develop a service layer for API calls.
    • Handle errors and loading states gracefully.
  • Portfolio Integration:

    • Implement interfaces for users to manage portfolio settings.
    • Provide options to opt-in or opt-out of portfolio additions.

Deployment Strategy

Backend Deployment

  • AWS Deployment:

    • Deploy the backend on AWS EC2 instances.
    • Use IAM roles for secure resource access.
  • MicroVM Deployment:

    • Use NanoVMS to run MicroVMs on the host system.
    • Ensure that the infrastructure supports the custom MicroVM technology.

Frontend Deployment

  • Static Site Generation:
    • Build the SvelteKit app for production.
    • Serve static files via AWS S3 and CloudFront.

CI/CD Pipelines

  • Automation:
    • Use GitHub Actions for automated builds and deployments.
    • Implement testing stages in the pipeline.

Security Considerations

  • Authentication and Authorization:

    • Enforce strong password policies.
    • Implement role-based access control (RBAC).
  • Data Protection:

    • Encrypt sensitive data in transit and at rest.
    • Regularly back up databases securely.
  • Network Security:

    • Configure AWS security groups and firewalls.
    • Use HTTPS with SSL certificates.
  • Isolation:

    • Ensure that NanoVMS provides strong isolation between MicroVMs.
    • Implement security measures to prevent cross-VM interference.
  • Vulnerability Management:

    • Keep dependencies updated.
    • Conduct regular security audits.

Testing and Quality Assurance

  • Testing Strategies:

    • Unit Testing: Test individual components and functions.
    • Integration Testing: Test interactions between frontend, backend, and MicroVMs.
    • End-to-End Testing: Simulate user workflows.
  • Continuous Testing:

    • Integrate tests into the CI/CD pipeline.
    • Automate test execution on code commits.
  • Performance Testing:

    • Use tools to assess application performance.
    • Optimize based on results.

Project Management and Collaboration

  • Agile Methodology:

    • Use Scrum with sprints aligned to learning and development phases.
    • Conduct regular stand-ups and retrospectives.
  • Version Control:

    • Use Git with a branching strategy like GitFlow.
  • Communication:

    • Use platforms like Slack for real-time communication.
    • Document progress and decisions in shared documents.

Conclusion

BytePort aims to revolutionize application deployment by providing a custom MicroVM management solution through the development of NanoVMS. This approach offers the isolation and control of virtual machines with the efficiency closer to containers. By combining learning and development, the project not only builds a powerful tool but also enhances the developer's expertise in key technologies. The system is designed with future expansion in mind, including the integration of a custom hypervisor and operating system, making BytePort a forward-thinking platform in the cloud management space.


This updated manifesto reflects the incorporation of the custom-developed MicroVM technology, NanoVMS, aligning the project's goals with the necessary technologies and development strategies to achieve them. Extended Project Manifesto: Integrating Hypervisor and OS Development into BytePort

Table of Contents

1.	Introduction
2.	Extended Project Overview
3.	Objectives
4.	Technologies and Tools
5.	Extended Project Architecture
6.	Development Phases and Timeline
7.	Implementation Details
8.	Integration Strategy
9.	Security Considerations
10.	Testing and Quality Assurance
11.	Project Management and Collaboration
12.	Conclusion

Introduction

This manifesto outlines the extended development of the BytePort platform by incorporating a custom Hypervisor/Emulator and a Custom Operating System (OS), all built using Rust or a language other than C/C++. The goal is to create a comprehensive, end-to-end solution for VM management, virtualization, and OS operation, enhancing learning and showcasing advanced system programming capabilities.

Extended Project Overview

Project Name: BytePort Extended VM Management Platform

Description: Building upon the initial BytePort VM Management Service, this extended project aims to develop a homemade hypervisor and a custom operating system. These components will integrate seamlessly with the existing platform, providing users with deeper control over virtualization and the underlying OS, and offering an enriched educational experience in systems programming.

Objectives

Primary Objectives:

•	Hypervisor/Emulator Development:
•	Develop a custom hypervisor to manage virtual machines at a low level.
•	Implement essential virtualization functionalities (CPU virtualization, memory management, I/O handling).
•	Ensure compatibility with the existing VM management platform.
•	Custom Operating System Development:
•	Design and implement a basic OS kernel.
•	Provide essential OS features (process management, file system, networking).
•	Optimize the OS for use within the hypervisor environment.

Secondary Objectives:

•	Integrate the custom hypervisor with the BytePort platform for seamless VM management.
•	Enable users to deploy and manage the custom OS within their virtual machines.
•	Document the development process for educational purposes.
•	Enhance security measures at the virtualization and OS levels.

Technologies and Tools

Hypervisor Development:

•	Language: Rust
•	Virtualization Techniques: Hardware-assisted virtualization (using technologies like Intel VT-x or AMD-V)
•	Libraries and Crates:
•	vm-virt: For virtualization abstractions
•	kvm-bindings and kvm-ioctls: For interfacing with the Linux KVM API (if using KVM)
•	Debugging Tools:
•	GDB with Rust support
•	QEMU for emulation and testing

OS Development:

•	Language: Rust
•	Operating System Development Libraries:
•	bootloader: For booting the OS kernel
•	x86_64: For low-level hardware interaction
•	uart_16550: For serial port communication
•	Build Tools:
•	cargo-xbuild or cargo with appropriate targets
•	Debugging and Testing:
•	QEMU for emulation
•	Bochs or VirtualBox for virtualization testing

Existing Technologies (from previous project):

•	Frontend: SvelteKit, TypeScript, Tailwind CSS
•	Backend: Loco.rs (Rust), SQLx or Diesel ORM
•	DevOps and Deployment: Docker, AWS

Extended Project Architecture

Overview

The extended BytePort platform will consist of three main layers:

1.	Frontend Interface (SvelteKit):
•	Remains largely the same, providing user interfaces for VM and OS management.
2.	Backend Services (Loco.rs):
•	Enhanced to interface with the custom hypervisor.
•	Manages VM life cycles and OS deployment within VMs.
3.	Virtualization Layer:
•	Custom Hypervisor: Replaces or augments existing virtualization tools.
•	Custom OS: Runs within the virtual machines managed by the hypervisor.

Data Flow

•	User Interaction: Users issue commands via the frontend to manage VMs and deploy the custom OS.
•	API Requests: Frontend sends requests to the backend API.
•	Backend Processing: Backend communicates with the hypervisor to manage VMs and with the OS for operations within VMs.
•	Hypervisor Operations: Hypervisor handles low-level VM management, resource allocation, and execution of the custom OS.
•	Response: System states and outputs are communicated back to the user through the frontend.

Development Phases and Timeline

Phase 1: Research and Planning (Weeks 1-2)

•	Hypervisor Research:
•	Study existing hypervisors (KVM, Xen, Firecracker) and their architectures.
•	Understand hardware virtualization features (Intel VT-x, AMD-V).
•	OS Development Planning:
•	Define the scope and features of the custom OS.
•	Plan kernel architecture and essential modules.

Phase 2: Hypervisor Development (Weeks 3-8)

•	Week 3-4:
•	Set up the development environment for low-level Rust programming.
•	Implement CPU virtualization and basic VM creation.
•	Week 5-6:
•	Implement memory management for VMs.
•	Handle I/O virtualization and device emulation.
•	Week 7-8:
•	Integrate the hypervisor with the backend services.
•	Test VM management functionalities via the frontend.

Phase 3: OS Development (Weeks 5-10)

•	Week 5-6:
•	Bootloader implementation to load the OS kernel.
•	Basic kernel initialization and CPU setup.
•	Week 7-8:
•	Implement memory management (paging, segmentation).
•	Develop process management and scheduling.
•	Week 9-10:
•	Implement a simple file system.
•	Add basic networking capabilities.

Phase 4: Integration and Testing (Weeks 11-12)

•	Hypervisor and OS Integration:
•	Ensure the custom OS runs smoothly within the custom hypervisor.
•	Optimize performance and resource utilization.
•	System Testing:
•	Perform extensive testing of the hypervisor and OS.
•	Debug and fix issues related to virtualization and OS operations.

Phase 5: Platform Integration (Weeks 13-14)

•	Backend Updates:
•	Modify backend services to support new hypervisor functionalities.
•	Update API endpoints for extended VM and OS management.
•	Frontend Enhancements:
•	Add interfaces for deploying and interacting with the custom OS.
•	Implement monitoring tools for VM and OS performance.

Phase 6: Documentation and Finalization (Weeks 15-16)

•	Documentation:
•	Document the hypervisor and OS development processes.
•	Update user guides and API documentation.
•	Final Review:
•	Conduct security audits.
•	Prepare the system for deployment.

Implementation Details

Hypervisor Implementation

•	CPU Virtualization:
•	Use hardware virtualization extensions to create virtual CPUs.
•	Handle context switching between VMs and the host.
•	Memory Management:
•	Implement virtual memory mapping for VMs.
•	Use Extended Page Tables (EPT) or Nested Paging.
•	I/O Virtualization:
•	Emulate essential devices (storage, network interfaces).
•	Implement paravirtualized drivers for performance.
•	Interfacing with Backend:
•	Expose an API or CLI for backend interaction.
•	Ensure thread safety and concurrency control.

OS Implementation

•	Boot Process:
•	Develop a bootloader compliant with BIOS or UEFI.
•	Initialize hardware components and system state.
•	Kernel Architecture:
•	Use a modular monolithic or microkernel approach.
•	Implement core modules for process and memory management.
•	Process Management:
•	Create a scheduler for multitasking.
•	Implement inter-process communication (IPC) mechanisms.
•	File System:
•	Design a simple file system (e.g., FAT12/16/32).
•	Implement file operations (read, write, open, close).
•	Networking:
•	Develop basic networking stack (TCP/IP).
•	Support network communication within VMs.

Integration Strategy

Seamless Integration with Backend

•	API Extensions:
•	Extend backend APIs to include hypervisor control commands.
•	Add endpoints for OS deployment and management.
•	Backend-Hypervisor Communication:
•	Use IPC mechanisms or direct library calls.
•	Ensure secure and efficient communication channels.

Frontend Enhancements

•	User Interface Updates:
•	Add controls for hypervisor settings and VM configurations.
•	Provide dashboards for OS-level monitoring.
•	User Experience:
•	Ensure that the complexity of hypervisor and OS management is abstracted for the user.
•	Offer guided workflows for common tasks.

Compatibility Considerations

•	Backward Compatibility:
•	Ensure existing functionalities remain unaffected.
•	Provide options to use the custom hypervisor or existing virtualization tools.
•	Modular Design:
•	Design components to be interchangeable.
•	Facilitate future enhancements or replacements.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published