Skip to content

stefanoslig/bulletproof-lit

Repository files navigation

Bulletproof Lit 🛡️

A simple, scalable, and powerful architecture for building production ready Lit applications .

This repository is a migration of bulletproof-react to Lit and its ecosystem.

I'm currently in the early stages of working on this project, and it's still a work in progress.

Introduction

Lit is an excellent tool for building front-end applications using native web components. It has an ecosystem with many great libraries for most of things you might need. However, being forced to make so many choices can be overwhelming. It is also very flexible, you can write Lit applications in any way you like, but that flexibility comes with a cost. Since there is no pre-defined architecture that developers can follow, it often leads to a messy, inconsistent, and over-complicated codebase.

This repo attempts to present a way of creating Lit applications using some of the best tools in the ecosystem with a good project structure that scales very well.

The goal here is to serve as a collection of resources and best practices when developing Lit applications. It is supposed to showcase solving most of the real-world problems of an application in a practical way and help developers write better applications.

Feel free to explore the sample app codebase to get the most value out of the repo.

What makes a Lit application "bulletproof"?

This repo doesn't aim to be a silver bullet for all Lit applications as there are many different use cases, but it tries to provide a solid foundation for building applications based on the following principles:

  • Easy to get started with
  • Simple to understand and maintain
  • Uses the right tools for the job
  • Clean boundaries between different parts of the application
  • Everyone on the team is on the same page when it comes to how things are done
  • Secure
  • Performant
  • Scalable in terms of codebase and team size
  • Issues detectable as early as possible

Disclaimer:

This is not supposed to be a template, boilerplate or a framework. It is an opinionated guide that shows how to do some things in a certain way. You are not forced to do everything exactly as it is shown here, decide what works best for you and your team and stay consistent with your style.

To get most out of it, do not get limited by the technologies used in this sample app, but rather focus on the principles and the concepts that are being presented here. The tools and libraries used here are just a suggestion, you can always replace them with something that fits your needs better. Sometimes, your project might require a slightly different approach, and that's totally fine.

Table Of Contents:

Contributing

Contributions are always welcome! If you have any ideas, suggestions, fixes, feel free to contribute. You can do that by going through the following steps:

  1. Clone this repo
  2. Create a branch: git checkout -b your-feature
  3. Execute the yarn prepare script.
  4. Make some changes
  5. Test your changes
  6. Push your branch and open a Pull Request

License

MIT