Coder Social home page Coder Social logo

leowilkin / astro-launchpad Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kyr0/astro-launchpad

0.0 0.0 0.0 11.89 MB

An Astro project template for decent projects: auth, i18next, Bootstrap, sitemap, webworker, robots.txt, preact, react, endpoints, endpoint clients, OAuth, various Astro features and data loading preconfigured

Home Page: https://astro-launchpad.vercel.app

Shell 0.09% JavaScript 10.38% TypeScript 7.58% CSS 71.51% SCSS 0.21% Astro 10.23%

astro-launchpad's Introduction

Welcome to Astro Launchpad

Demo site: https://astro-launchpad.vercel.app/

This is an Astro 2.0 template project that can be used to launch decent projects with Astro, boosters included (hence the name).

You'll find this project configured with SSG and SSR routes together in one Astro project using Astro 2.0's hybrid output. It is configured to deploy to Vercel for hosting, SSR and API microservices (serverless and edge, as you wish), for which even API clients are automatically generated in pages/api-client.

Turborepo is used to manage the monorepo. This project follows the turbo best practices for eslint, prettier, tsconfig, code sharing and build caching (local and remote).

Project layout

This project deploys on Vercel. You can clone this repo and deploy it on Vercel. Make sure to set the root directory to: apps/server as this is the primary Astro project we deploy!

You can find the Vercel configuration in apps/server/vercel.json. It makes sure that turbo is used. I've also decided to activate Remote Caching.

App

You can have many apps in parallel that could re-use code from the packages. They are always located in the apps folder. By default, one server app is created and serves are the primarily deploy target for Vercel.

  • apps/server: An Astro 2.0 hybrid rendering-enabled project. Implements the application logic, all the pages, application data, API microservice endpoints etc. pp.

The project is also pre-configured with @vercel/analytics, preact, astrojs-service-worker, @astrojs/image, astro-robots-txt, astro-sitemap, astro-webmanifest, eslint, browserslist, dotenv, prettier, tsconfig custom base config.

Image optimization

This project comes with the sharp package for local image optimization pre-configured. Make sure to run in case that you're running into issues like: 'Something went wrong installing the "sharp" module':

brew uninstall vips (in case it is already installed via brew)

npm install --ignore-scripts=false --foreground-scripts --verbose sharp

Shared packages

Shared packages are located in packages/*, such as:

  • packages/components: Astro components to be used by all Apps and packages
  • packages/i18n: Internationalization layer (isomorphic, based on i18next)
  • packages/auth: Authentication layer (isomorphic based on auth-astro)
  • packages/icons: A collection of SVG icons
  • packages/reactive: A nano library of helper functions to work with Preact
  • packages/theme: Tailwind theming helper library to merge CSS classes into one
  • packages/tsconfig: A unified tsconfig that is used in all packages and apps
  • packages/format: Prettier configuration for all packages and apps
  • packages/eslint-config-custom: Eslint configuration for all packages and apps

Performance stats

  • No cache (Vercel, remote in CI/CD): Builds in 40s
  • With cache (Vercel, remote in CI/CD): FULL TURBO: 6s, one package or app affected: 34s (of which 24s is yarn install...)
  • Locally, full build: 3.79s (on a Apple M1 Max machine/2021)

astro-launchpad's People

Contributors

kyr0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.