Convert Figma logo to code with AI

analogjs logoanalog

The fullstack meta-framework for Angular. Powered by Vite and Nitro

2,497
237
2,497
18

Top Related Projects

95,657

Deliver web apps with confidence 🚀

23,468

Smart Monorepos · Fast CI

Server-side rendering and Prerendering for Angular

Reactive State for Angular

CLI tool for Angular

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

Quick Overview

Analog is a meta-framework for building applications and websites using Angular. It combines the power of Angular with the flexibility of Vite, offering server-side rendering (SSR), static site generation (SSG), and API routes. Analog aims to provide a modern, efficient development experience for Angular developers.

Pros

  • Seamless integration of Angular with Vite for faster build times and improved developer experience
  • Built-in support for SSR and SSG, enhancing performance and SEO capabilities
  • API routes for easy backend functionality integration
  • TypeScript support out of the box

Cons

  • Relatively new project, which may lead to potential instability or lack of extensive community support
  • Learning curve for developers unfamiliar with meta-frameworks or SSR/SSG concepts
  • Limited ecosystem compared to more established frameworks like Next.js or Nuxt.js

Code Examples

  1. Creating a simple Analog component:
import { Component } from '@angular/core';

@Component({
  selector: 'app-hello',
  standalone: true,
  template: '<h1>Hello, Analog!</h1>',
})
export class HelloComponent {}
  1. Defining an API route:
import { defineEventHandler } from 'h3';

export default defineEventHandler(() => {
  return {
    message: 'Hello from Analog API!',
  };
});
  1. Using server-side data fetching:
import { Component } from '@angular/core';
import { injectLoad } from '@analogjs/core';

@Component({
  selector: 'app-user',
  standalone: true,
  template: '<h2>User: {{ user.name }}</h2>',
})
export class UserComponent {
  user = injectLoad(async () => {
    const response = await fetch('https://api.example.com/user');
    return response.json();
  });
}

Getting Started

To start a new Analog project, follow these steps:

  1. Install the Analog CLI globally:

    npm install -g @analogjs/cli
    
  2. Create a new Analog project:

    analog new my-analog-app
    cd my-analog-app
    
  3. Start the development server:

    npm run dev
    

Your Analog app will now be running at http://localhost:5173.

Competitor Comparisons

95,657

Deliver web apps with confidence 🚀

Pros of Angular

  • Mature and well-established framework with extensive documentation and community support
  • Comprehensive ecosystem with built-in tools for testing, routing, and state management
  • Strong TypeScript integration and powerful dependency injection system

Cons of Angular

  • Steeper learning curve due to its complexity and numerous concepts to grasp
  • Larger bundle size compared to more lightweight alternatives
  • Opinionated structure may feel restrictive for some developers

Code Comparison

Angular:

@Component({
  selector: 'app-root',
  template: '<h1>{{ title }}</h1>'
})
export class AppComponent {
  title = 'Angular App';
}

Analog:

export default component$(() => {
  const title = 'Analog App';
  return <h1>{title}</h1>;
});

Analog aims to provide a more lightweight and flexible approach to Angular development, focusing on server-side rendering and static site generation. It leverages modern web technologies while maintaining compatibility with the Angular ecosystem. Angular, on the other hand, offers a more comprehensive and opinionated framework with a wider range of built-in features and tools.

While Angular provides a robust solution for large-scale applications, Analog may be more suitable for developers seeking a simpler, more performant alternative that still benefits from Angular's core concepts and ecosystem.

23,468

Smart Monorepos · Fast CI

Pros of Nx

  • Mature ecosystem with extensive documentation and community support
  • Supports multiple frontend frameworks (Angular, React, Vue) and backend technologies
  • Powerful code generation and project scaffolding capabilities

Cons of Nx

  • Steeper learning curve due to its extensive feature set
  • Can be overkill for smaller projects or teams
  • Requires more configuration and setup compared to simpler alternatives

Code Comparison

Nx workspace configuration:

{
  "npmScope": "myorg",
  "affected": { "defaultBase": "main" },
  "implicitDependencies": {
    "package.json": { "dependencies": "*", "devDependencies": "*" }
  }
}

Analog configuration:

{
  "name": "my-analog-app",
  "type": "module",
  "scripts": {
    "dev": "analog dev",
    "build": "analog build"
  }
}

Both Nx and Analog aim to improve development workflows, but Nx offers a more comprehensive solution for monorepo management and scalability across various technologies. Analog, on the other hand, focuses specifically on Angular and provides a simpler, more opinionated approach to building server-side rendered applications. While Nx requires more setup and configuration, it offers greater flexibility and extensibility for large-scale projects. Analog provides a more streamlined experience for Angular developers looking to quickly build and deploy SSR applications.

Server-side rendering and Prerendering for Angular

Pros of Universal

  • Mature and well-established solution for server-side rendering in Angular
  • Extensive documentation and community support
  • Seamless integration with existing Angular applications

Cons of Universal

  • Requires more configuration and setup compared to Analog
  • Can be slower in development mode due to additional build steps
  • Limited support for newer Angular features without manual configuration

Code Comparison

Universal:

import { NgModule } from '@angular/core';
import { ServerModule } from '@angular/platform-server';
import { AppModule } from './app.module';
import { AppComponent } from './app.component';

@NgModule({
  imports: [AppModule, ServerModule],
  bootstrap: [AppComponent],
})
export class AppServerModule {}

Analog:

import { defineConfig } from '@analogjs/platform';

export default defineConfig({
  ssr: true,
  prerender: {
    routes: ['/'],
  },
});

Universal requires more boilerplate code to set up server-side rendering, while Analog offers a more streamlined configuration approach. Analog's setup is more concise and easier to understand at a glance, potentially leading to faster development and easier maintenance.

Reactive State for Angular

Pros of NgRx

  • Mature and widely adopted state management solution for Angular
  • Extensive ecosystem with additional libraries and tools
  • Strong community support and extensive documentation

Cons of NgRx

  • Steep learning curve and boilerplate code
  • Can be overkill for smaller applications
  • Requires careful planning to avoid over-engineering

Code Comparison

NgRx:

@Effect()
loadBooks$ = this.actions$.pipe(
  ofType(BookActionTypes.Load),
  mergeMap(() => this.bookService.getAll()
    .pipe(
      map(books => new LoadBooksSuccess(books)),
      catchError(error => of(new LoadBooksFailure(error)))
    ))
);

Analog:

export const books = analog({
  get: async () => {
    const response = await fetch('/api/books');
    return response.json();
  }
});

Key Differences

  • NgRx follows a more complex, Redux-inspired architecture
  • Analog aims for simplicity and ease of use
  • NgRx provides fine-grained control over state management
  • Analog focuses on server-side rendering and API integration

Use Cases

NgRx is well-suited for large-scale applications with complex state management needs, while Analog is designed for simpler applications that prioritize server-side rendering and straightforward API integration.

CLI tool for Angular

Pros of Angular CLI

  • Mature and well-established tool with extensive documentation
  • Robust set of features for generating, developing, and building Angular applications
  • Strong community support and regular updates

Cons of Angular CLI

  • Can be complex and overwhelming for beginners
  • Slower build times for large projects
  • Less flexibility in terms of customization compared to newer alternatives

Code Comparison

Angular CLI:

ng new my-app
cd my-app
ng serve

Analog:

npm create analog@latest my-app
cd my-app
npm run dev

Summary

Angular CLI is a powerful and mature tool for Angular development, offering a wide range of features and strong community support. However, it can be complex for beginners and may have slower build times for large projects.

Analog, on the other hand, is a newer alternative that aims to simplify the development process and provide faster build times. It offers a more streamlined approach to creating Angular applications, but may lack some of the advanced features and extensive documentation found in Angular CLI.

Both tools have their strengths, and the choice between them depends on the specific needs of the project and the developer's experience level with Angular development.

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

Pros of Ionic Framework

  • Mature and widely adopted framework with a large community and ecosystem
  • Supports multiple platforms (iOS, Android, web) with a single codebase
  • Extensive UI component library and theming capabilities

Cons of Ionic Framework

  • Steeper learning curve due to its comprehensive nature
  • Performance can be slower compared to native apps, especially for complex applications
  • Larger bundle sizes, which may impact initial load times

Code Comparison

Ionic Framework:

import { Component } from '@angular/core';
import { IonicModule } from '@ionic/angular';

@Component({
  selector: 'app-home',
  template: '<ion-content><ion-button>Click me</ion-button></ion-content>',
  standalone: true,
  imports: [IonicModule],
})
export class HomePage {}

Analog:

import { Component } from '@angular/core';

@Component({
  selector: 'app-home',
  template: '<button>Click me</button>',
  standalone: true,
})
export class HomePage {}

Key Differences

  • Ionic Framework provides a rich set of pre-built UI components, while Analog focuses on minimal setup for Angular applications
  • Ionic Framework targets cross-platform mobile development, whereas Analog is primarily for web applications
  • Analog emphasizes server-side rendering and static site generation, which are not primary features of Ionic Framework

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Analog

All Contributors

Discord server Twitter

Analog is the meta-framework for building applications and websites with Angular.

Similar to other meta-frameworks such as Next.JS, Nuxt, SvelteKit, Qwik City, and others, Analog provides a similar experience, building on top of Angular.

Documentation

Visit the docs at https://analogjs.org

Features

  • Powered by Vite
  • Supports Vitest/Storybook
  • Server and deployment integrations powered by Nitro
  • File-based routing
  • Server-side data fetching
  • Support for using markdown as content routes
  • Integrated API/server routes
  • Hybrid SSR/SSG support
  • Supports Angular CLI and Nx workspaces

Getting Started

Use your package manager of choice to create a new project

With npm:

npm create analog@latest

With pnpm:

pnpm create analog@latest

With Bun:

bun create analog@latest

With Yarn:

yarn create analog

Follow the prompts to scaffold the project and start the development server.

Open in StackBlitz

Supporting Analog

Sponsors

GitHub Accelerator NxDevTools House of Angular Code.Build Snyder Tech

Contributing

Analog welcomes contributors! Please read the contributing doc for details.

Credits

The name was inspired by this project https://github.com/rrdelaney/Analog.

Contributors ✨

Thanks goes to these wonderful people for contributing to Analog (emoji key):

Brandon
Brandon

💻 📖 🤔
Lars Gyrup Brink Nielsen
Lars Gyrup Brink Nielsen

📖 ⚠️
Marko Stanimirović
Marko Stanimirović

🔧 🚇 📖 💻 🎨
Jason Hodges
Jason Hodges

📖
Tim Deschryver
Tim Deschryver

🚇
Dale Nguyen
Dale Nguyen

💻 🎨
Andrés Villanueva
Andrés Villanueva

📖 🌍
Umair Hafeez
Umair Hafeez

🚇
Brandon Largeau
Brandon Largeau

🚇
Maina Wycliffe
Maina Wycliffe

💻 🚇
Preston Lamb
Preston Lamb

💻 📖
Andrew Luca
Andrew Luca

💻
Chau Tran
Chau Tran

💻 🚇
Simone
Simone

💻
Kyler Johnson
Kyler Johnson

💻
Marc
Marc

📖 💻
himyjan
himyjan

💻
Alex Kovalev
Alex Kovalev

📖
Nuhman Pk
Nuhman Pk

📖
Miloš Lajtman
Miloš Lajtman

💻
profanis
profanis

💻
Reece McDonald
Reece McDonald

📖
Matteo Pietro Dazzi
Matteo Pietro Dazzi

💻
Lukáš Matta
Lukáš Matta

📖
Luciano
Luciano

📖 💻
Robin Goetz
Robin Goetz

💻
Vadim Evseev
Vadim Evseev

💻
Danny Koppenhagen
Danny Koppenhagen

📖 💻
Tomasz Flis
Tomasz Flis

📖
AdditionAddict
AdditionAddict

📖 💻
Sander
Sander

💻
Chris Perko
Chris Perko

💻 📖
Christian Lüdemann
Christian Lüdemann

💻
Yasser
Yasser

💻
Michał Dyrcz
Michał Dyrcz

💻
Otoniel Guajardo
Otoniel Guajardo

📖
gergobergo
gergobergo

💻 📖
saurajit
saurajit

📖
Mircea Rilă
Mircea Rilă

📖 🚇
Dominik
Dominik

📖 💻 🚇
Henrique Custódia
Henrique Custódia

📖
ISODA Yu
ISODA Yu

📖
Cynthia Iradukunda
Cynthia Iradukunda

📖
Drunkenpilot
Drunkenpilot

📖 💻
Jeremy Hofer
Jeremy Hofer

📖 💻 🚇
Olalekan Raheem
Olalekan Raheem

📖
Luis Castro
Luis Castro

💻 📖 🌍
Q
Q

💻 📖
Glenn Latomme
Glenn Latomme

📖
Justin Rassier
Justin Rassier

📖 💻 🚇
Matthieu Riegler
Matthieu Riegler

📖 🚇 💻
Ashley Hunter
Ashley Hunter

💻
Artur Androsovych
Artur Androsovych

💻 📖
Bjorn Lu
Bjorn Lu

🚇
Omar BELKHODJA
Omar BELKHODJA

💻
Deepak Rudra Paul
Deepak Rudra Paul

📖
Michael Avrukin
Michael Avrukin

📖
Rafael Mestre
Rafael Mestre

💻 📖 🚇
Santosh Yadav
Santosh Yadav

📖
Tenessy
Tenessy

🚇 💻 ⚠️
Jad Chahed
Jad Chahed

📖 🌍
Gesiel Rosa
Gesiel Rosa

📖 🌍
Besim Gürbüz
Besim Gürbüz

📖 🌍
Lukas Nys
Lukas Nys

📖
Andreas Ländle
Andreas Ländle

💻
Pascal Küsgen
Pascal Küsgen

📖
Alejandro Cuba Ruiz
Alejandro Cuba Ruiz

📖 🌍
Shreyas0410
Shreyas0410

📖
Denis Bendrikov
Denis Bendrikov

📖
iancharlesdouglas
iancharlesdouglas

📖
Olivier Combe
Olivier Combe

💻
Sasidharan SD
Sasidharan SD

📖
Ajit Panigrahi
Ajit Panigrahi

💻
nepage-l
nepage-l

💻
Jeff
Jeff

💻
Sammy Mohamed
Sammy Mohamed

📖
Josh Morony
Josh Morony

💻
Ilir Beqiri
Ilir Beqiri

📖
Michał Nieruchalski
Michał Nieruchalski

💻
Angel Fraga Parodi
Angel Fraga Parodi

🚇 💻
Alex
Alex

🚇 💻
Doguhan Uluca
Doguhan Uluca

📖
N. Can KIRIK
N. Can KIRIK

💻
ShPelles
ShPelles

📖
Pavan Kumar Jadda
Pavan Kumar Jadda

💻
Esther White
Esther White

💻 📖
Michael Richter
Michael Richter

💻
Rafael Triantafillidis
Rafael Triantafillidis

💻
Pooya Parsa
Pooya Parsa

📖
Corbin Crutchley
Corbin Crutchley

📖
Leblanc Meneses
Leblanc Meneses

🚇 💻 📖
James Culveyhouse
James Culveyhouse

💻
Naji
Naji

💻
Bitcollage
Bitcollage

📖
Sonu Kapoor
Sonu Kapoor

💻
ezzabuzaid
ezzabuzaid

💻
Eduardo Roth
Eduardo Roth

📖
Ryan Clements
Ryan Clements

📖
ByeongGi
ByeongGi

📖 🌍
Younes Jaaidi
Younes Jaaidi

💻 ⚠️
BoogMon
BoogMon

📖
Anthony Garera
Anthony Garera

📖
Stewan
Stewan

💻 ⚠️
Nate Radebaugh
Nate Radebaugh

💻
Wolfram Sokollek
Wolfram Sokollek

🚇
Muhammad Uzair
Muhammad Uzair

📖
Pranav Ramesh
Pranav Ramesh

📖
Ben Snyder
Ben Snyder

📖 🚇
Jan-Niklas W.
Jan-Niklas W.

📖
Sergey Gultyayev (Serhii Hultiaiev)
Sergey Gultyayev (Serhii Hultiaiev)

💻 📖
Anderson Feitosa
Anderson Feitosa

💻
Jun
Jun

📖 🌍
Felix Herold
Felix Herold

📖 🌍
Soheil Nazari [CHECK24]
Soheil Nazari [CHECK24]

📖
Maksymilian Szokalski
Maksymilian Szokalski

🚇 💻
Alfonso Andrés López Molina
Alfonso Andrés López Molina

💻
Nermal
Nermal

📖
tobiasegli
tobiasegli

💻
Larson
Larson

💻
Ilyass
Ilyass

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

NPM DownloadsLast 30 Days