Welcome to Agentic Preview, a cutting-edge, asynchronous FastAPI backend service that revolutionizes the way developers create, manage, and deploy applications. By seamlessly integrating the powerful capabilities of Agentic Editor and Agentic Preview into a unified Agentic Platform, we offer a comprehensive solution for modern software development workflows.
In today's fast-paced software development landscape, efficiency and automation are key. Agentic Preview addresses these needs by providing a robust platform that combines AI-assisted coding, streamlined project management, and effortless deployment capabilities. Our solution leverages the power of Fly.io for deployments and integrates advanced AI technologies to assist in coding tasks, making it an indispensable tool for developers of all levels.
Agentic Preview is designed to be your all-in-one solution for:
- Rapid prototyping and development
- Efficient project management
- Seamless deployment and preview of applications
- AI-assisted code generation and refactoring
Whether you're a solo developer working on a passion project or part of a large team tackling complex applications, Agentic Preview has the tools and features to streamline your workflow and boost productivity.
Agentic Preview offers a rich set of features designed to enhance every aspect of your development process:
-
Unified Agentic Platform
- Seamlessly integrates Agentic Editor and Agentic Preview functionalities
- Provides a cohesive environment for coding, managing, and deploying projects
-
AI-Assisted Coding with Aider
- Harnesses the power of advanced language models for intelligent code editing
- Offers code generation, refactoring, and optimization suggestions
- Supports natural language prompts for code-related tasks
-
Asynchronous Deployments
- Rapidly deploy GitHub repositories to Fly.io
- Ensures non-blocking operations for improved performance and responsiveness
-
Comprehensive Project Management
- Create, update, and manage multiple projects effortlessly
- Track project status, history, and associated resources
-
User Management System
- Manage user accounts and permissions
- Associate users with specific projects for collaborative development
-
Intelligent Resource Management
- Automatically cleans up resources after usage
- Implements smart allocation and deallocation of computing resources
-
Customizable Deployments
- Supports custom deployment arguments and configurations
- Allows fine-tuning of deployment processes to meet specific project needs
-
Real-time Logging and Monitoring
- Stream deployment and application logs in real-time
- Monitor application performance and status effortlessly
-
Robust Database Integration
- Utilizes SQLAlchemy for efficient and reliable data management
- Supports complex queries and data operations
-
RESTful API
- Well-documented API endpoints for easy integration with other tools and services
- Follows best practices for API design and implementation
-
Containerization Support
- Includes Dockerfile for easy containerization of applications
- Ensures consistency across different development and deployment environments
Before diving into the world of Agentic Preview, let's ensure you have everything set up correctly. Follow these comprehensive installation steps to get started:
-
Python: Agentic Preview requires Python 3.8 or higher. You can download it from python.org.
-
Poetry: We use Poetry for dependency management. Install it by following the instructions at python-poetry.org.
-
Fly.io CLI: You'll need the Fly.io command-line tool (flyctl) for deployments. Install it using:
For macOS and Linux:
curl -L https://fly.io/install.sh | shFor Windows (using PowerShell):
iwr https://fly.io/install.ps1 -useb | iex
-
Git: Ensure you have Git installed on your system. Download it from git-scm.com.
-
Clone the Repository: Open your terminal and run:
git clone https://github.com/ruvnet/agentic-preview.git cd agentic-preview -
Install Dependencies: Use Poetry to install the project dependencies:
poetry install
-
Authenticate with Fly.io: Set up your Fly.io account:
flyctl auth login
-
Set Up Environment Variables: Create a
.envfile in the root directory with the following content:DATABASE_URL=sqlite:///./agentic_platform.db OPENAI_API_KEY=your_openai_api_key FLY_API_TOKEN=your_fly_api_tokenReplace
your_openai_api_keyandyour_fly_api_tokenwith your actual API keys. -
Initialize the Database: Run the database initialization script:
poetry run python agentic_platform/init_db.py
-
Verify Installation: Ensure everything is set up correctly by running:
poetry run python -c "from agentic_platform import __version__; print(f'Agentic Preview version: {__version__}')"
Congratulations! You've successfully installed Agentic Preview and are ready to start using its powerful features.
Now that you have Agentic Preview installed, let's explore how to use its various features and capabilities.
-
Activate the Virtual Environment:
poetry shell
-
Run the Application:
uvicorn agentic_platform.main:app --host 0.0.0.0 --port 8000 --reload
The application will start, and you can access it at
http://localhost:8000.
Agentic Preview offers a rich set of API endpoints to interact with its various features. Here's an overview of the main endpoints:
-
Run Aider for AI-Assisted Coding:
- POST
/run-aider - Example usage:
curl -X POST "http://localhost:8000/run-aider" \ -H "Content-Type: application/json" \ -d '{ "chat_mode": "code", "edit_format": "diff", "model": "gpt-4", "prompt": "Optimize the database query in main.py", "files": ["main.py", "database.py"] }'
- POST
-
List All Projects:
- GET
/projects - Example usage:
curl "http://localhost:8000/projects"
- GET
-
List All Users:
- GET
/users - Example usage:
curl "http://localhost:8000/users"
- GET
-
Deploy an Application:
- POST
/deploy - Example usage:
curl -X POST "http://localhost:8000/deploy" \ -H "Content-Type: application/json" \ -d '{ "repo": "username/repository", "branch": "main", "args": ["--build-arg", "ENV=production"] }'
- POST
-
Check Deployment Status:
- GET
/status/{app_name} - Example usage:
curl "http://localhost:8000/status/my-awesome-app"
- GET
-
Stream Application Logs:
- GET
/logs/{app_name} - Example usage:
curl "http://localhost:8000/logs/my-awesome-app"
- GET
-
Create a New Project:
curl -X POST "http://localhost:8000/projects" \ -H "Content-Type: application/json" \ -d '{ "name": "My Awesome Project", "description": "A revolutionary web application", "repository_url": "https://github.com/username/awesome-project" }'
-
Update Project Details:
curl -X PUT "http://localhost:8000/projects/1" \ -H "Content-Type: application/json" \ -d '{ "description": "An even more revolutionary web application" }'
-
Delete a Project:
curl -X DELETE "http://localhost:8000/projects/1"
-
Generate Code Based on a Prompt:
curl -X POST "http://localhost:8000/run-aider" \ -H "Content-Type: application/json" \ -d '{ "chat_mode": "code", "edit_format": "diff", "model": "gpt-4", "prompt": "Create a Python function to calculate Fibonacci numbers", "files": ["math_utils.py"] }'
-
Refactor Existing Code:
curl -X POST "http://localhost:8000/run-aider" \ -H "Content-Type: application/json" \ -d '{ "chat_mode": "code", "edit_format": "diff", "model": "gpt-4", "prompt": "Refactor the main() function to improve readability", "files": ["main.py"] }'
Agentic Preview offers various configuration options to tailor the platform to your specific needs:
-
Application-wide Settings: Modify
agentic_platform/config.pyto adjust global settings such as database URLs, API keys, and default values. -
Deployment Settings: Fine-tune deployment configurations in
agentic_platform/api/deploy.py. This includes settings for Fly.io deployments and resource allocation. -
Aider Behavior: Customize the AI-assisted coding features by modifying
agentic_platform/api/aider.py. Adjust model parameters, prompts, and output formats. -
Database Models: If you need to extend or modify the data structure, update the models in
agentic_platform/models.py. -
API Endpoints: Add or modify API endpoints in
agentic_platform/main.pyto extend the platform's functionality.
We welcome contributions from the community! If you'd like to contribute to Agentic Preview, please follow these steps:
- Fork the repository on GitHub.
- Create a new branch for your feature or bug fix.
- Write your code and add tests if applicable.
- Ensure all tests pass by running
pytest. - Submit a pull request with a clear description of your changes.
For more detailed information on contributing, please read our CONTRIBUTING.md file.
Agentic Preview is open-source software licensed under the MIT License. See the LICENSE file for more details.
If you encounter any issues or have questions about Agentic Preview, please don't hesitate to:
- Open an issue on our GitHub repository.
- Join our community forum at community.agentic-preview.com.
- Follow us on Twitter @AgenticPreview for the latest updates and announcements.
We're excited to see what you'll build with Agentic Preview! Happy coding!