A comprehensive monorepo-based fullstack app building platform inspired by Expo, utilizing Turborepo for efficient monorepo management. MagicAppDev enables rapid development, customization, and deployment of apps across web and mobile platforms.
- Project Title & Brief Description
- Key Features
- Installation & Setup
- Usage & Examples
- Configuration & Customization
- Project Structure
- API Documentation
- Contributing Guidelines
- Testing
- Deployment
- Troubleshooting & FAQ
- License & Attribution
- Roadmap & Future Plans
- Contact & Support
MagicAppDev is a monorepo-based fullstack app building platform designed to streamline the development, customization, and deployment of web and mobile applications. It leverages Turborepo for efficient monorepo management and provides a suite of tools, including a CLI, web interface, mobile app, API, and database services.
- Developers looking to rapidly build and deploy fullstack applications.
- Teams requiring a scalable and customizable platform for app development.
- Organizations needing seamless integration with AI-powered tools for code generation and error fixing.
- Monorepo Structure: Utilizes Turborepo with pnpm for package management, including local/remote caching, TypeScript, and Node.js/JS as preferred languages.
- CLI Tool: Generate and manage app code, components, and packages with ease.
- Web Interface: Interactive AI chat for app creation, hot reload preview, and prompt suggestions.
- Mobile App: React Native-based app with interactive AI chat (SSE streaming), deep link authentication, and cross-platform component sharing.
- API & Database: High-performance backend on Cloudflare Workers/D1 with integrated AI model routing and provider support.
- AI Integration: Real-time streaming AI chat using Cloudflare Workers AI (Llama 3.1).
- Extensibility: Highly customizable with plugins and good debugging utilities.
- Node.js (v18 or higher)
- pnpm (v8 or higher)
- Git
-
Clone the Repository:
git clone https://github.com/magicappdev/magicappdev.git cd magicappdev -
Install Dependencies:
pnpm install
-
Set Up Environment Variables:
Create a
.envfile in the root directory and add the necessary environment variables. Refer to the Configuration & Customization section for details. -
Build the Project:
pnpm run build
- Windows: Ensure that you have the latest version of Node.js and pnpm installed. Use PowerShell or Git Bash for running commands.
- macOS/Linux: Ensure that your system has the necessary permissions for installing global packages and running scripts.
The CLI tool, npx create-magicappdev-app, allows you to generate and manage app code, components, and packages. Here are some examples:
-
Generate a New App:
npx create-magicappdev-app my-app
-
Generate a Component:
npx create-magicappdev-app generate component my-component
-
Run Doctor Command for Diagnostics:
npx create-magicappdev-app doctor
The web interface is hosted at *.magicappdev.workers.dev (Cloudflare Workers). It provides an interactive AI chat for app creation, hot reload preview, and prompt suggestions.
The mobile app is built using React Native and mirrors the features of the web interface. It includes optional packages like DevTools, Reanimated, Expo, Metro, and test setups.
Create a .env file in the root directory and add the following environment variables:
NODE_ENV=development
API_KEY=your_api_key_here
DATABASE_URL=your_database_url_here- CLI Settings: Configure the CLI tool by modifying the
packages/cli/src/config.tsfile. - Web Interface Settings: Configure the web interface by modifying the
apps/web/src/config.tsfile. - Mobile App Settings: Configure the mobile app by modifying the
apps/mobile/src/config.tsfile.
magicappdev/
├── .github/
├── .vscode/
├── apps/
│ ├── web/
│ └── mobile/
├── packages/
│ ├── cli/
│ ├── api/
│ ├── database/
│ ├── shared/
│ └── templates/
├── docs/
├── scripts/
├── package.json
├── pnpm-workspace.yaml
└── README.md
apps/web: Next.js-based web interface.apps/mobile: React Native-based mobile app.packages/cli: CLI tool for generating and managing app code.packages/api: API for backend services.packages/database: Database integration.packages/shared: Shared utilities and types.packages/templates: Templates for generating components and apps.
GET /api/projects: Retrieve a list of projects.POST /api/projects: Create a new project.GET /api/projects/:id: Retrieve a specific project.PUT /api/projects/:id: Update a specific project.DELETE /api/projects/:id: Delete a specific project.
-
Create a Project:
curl -X POST https://api.magicappdev.workers.dev/projects \ -H "Content-Type: application/json" \ -d '{"name": "my-project", "description": "A new project"}'
Response:
{ "id": "123", "name": "my-project", "description": "A new project" }
Authentication is handled via GitHub OAuth.
- Web/Mobile: Use the "Continue with GitHub" button to authenticate.
- CLI: Run
magicappdev auth loginto authenticate your local environment.
The system uses JWT for session management and stores profiles in Cloudflare D1.
- Search Existing Issues: Before submitting a new issue, search the issue tracker to ensure it hasn't been reported already.
- Create a New Issue: If the issue doesn't exist, create a new one with a clear title and description.
- Fork the Repository: Fork the repository and create a new branch for your changes.
- Make Changes: Implement your changes and ensure they adhere to the coding standards.
- Test Your Changes: Run the test suite to ensure your changes don't break existing functionality.
- Submit a Pull Request: Submit a pull request with a clear title and description of your changes.
- Follow the existing code style and conventions.
- Use TypeScript for type safety.
- Write clear and concise commit messages.
- Ensure all tests pass before submitting a pull request.
- Write new tests for any new functionality.
- Update existing tests if necessary.
-
Unit Tests:
pnpm run test:unit
-
Integration Tests:
pnpm run test:integration
-
End-to-End Tests:
pnpm run test:e2e
- All tests should pass without errors.
- Code coverage should meet the minimum threshold.
MagicAppDev is designed for Cloudflare.
cd packages/api
pnpm run deploycd apps/web
pnpm run deploy-
Build the Docker Image:
docker build -t magicappdev . -
Run the Docker Container:
docker run -p 3000:3000 magicappdev
If you encounter "workspace out of sync" errors, run:
pnpm nx sync- Dependency Issues: Ensure all dependencies are installed correctly. Run
pnpm installif you encounter dependency-related errors. - Environment Variables: Double-check your
.envfile for missing or incorrect environment variables. - Build Errors: Ensure your code adheres to the project's coding standards and TypeScript types.
Error: Missing API Key: Ensure your.envfile includes a validAPI_KEY.Error: Database Connection Failed: Verify yourDATABASE_URLin the.envfile.Error: Build Failed: Check the console output for specific errors and address them accordingly.
Q: How do I update the CLI tool?
A: Run pnpm update to update all dependencies, including the CLI tool.
Q: Can I use MagicAppDev with other package managers?
A: MagicAppDev is optimized for pnpm, but you can use other package managers like npm or yarn with some adjustments.
Q: How do I contribute to the project?
A: Follow the Contributing Guidelines section for detailed instructions.
MagicAppDev is licensed under the MIT License.
- Turborepo: For efficient monorepo management.
- pnpm: For fast and disk-space-efficient package management.
- Next.js: For the web interface.
- React Native: For the mobile app.
- Cloudflare: For API and database hosting.
- Plugin System: Enhance extensibility with a plugin system.
- Additional Templates: Add more templates for generating components and apps.
- Improved AI Integration: Enhance AI-powered code generation and error fixing.
- v1.0.0: Initial release with core features.
- v2.0.0: Enhanced plugin system and additional templates.
- v3.0.0: Improved AI integration and performance optimizations.
- Windows Support: Some features may not work as expected on Windows due to path and permission issues.
- Mobile App: The mobile app is currently in beta and may have some bugs.
For bug reports and feature requests, please use the issue tracker.
- Discord: Join our Discord server for community support and discussions.
- Slack: Join our Slack workspace for team collaboration.
For direct inquiries, you can contact the maintainer at involvex.