GithubHelp home page GithubHelp logo

angelogulina / fastify-preact-htm-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lmammino/fastify-preact-htm-boilerplate

0.0 2.0 0.0 76 KB

Quickly bootstrap your next web app with Fastify, Preact and htm

License: MIT License

JavaScript 97.14% Dockerfile 0.49% HTML 2.37%

fastify-preact-htm-boilerplate's Introduction

fastify-preact-htm-boilerplate

Quickly bootstrap your next web app with Fastify, Preact and htm (great stack for quick web prototypes).

Rationale ๐Ÿคฏ

Sometimes you just want to create a quick prototype of a web app to get feedback from friends and co-workers.

In such cases, I personally don't like to invest a lot of time configuring build toolchains and tools such as Babel or Jest, but I want to get straight to the core.

Since my favorite technologies to develop web apps are Fastify (API) and React (UI), I found this stack to work quite well as a compromise between familiarity, ease of development and possibility to improve over in case I want to convert the project to an actual production-ready app.

I am currently writing an article that goes into more details.

Link coming soon at loige.co.

Getting started ๐Ÿ‘ฉโ€๐Ÿ’ป

As easy as running this:

git clone https://github.com/lmammino/fastify-preact-htm-boilerplate.git my-new-project
cd my-new-project
rm -rf .git
npm install

Now enjoy editing the sample code in src:

  • src/ui: is for your frontend (Preact + htm)
  • src/server: is for your backend (Fastify)

To start the app, just run:

npm start

The app will be available at localhost:3000.

Ready to be distributed (with Docker) ๐Ÿณ

The project contains already a Dockerfile that allows you to package and run the project without having to have Node.js and NPM installed.

Run the following commands to run the app in a container:

docker build -t my-new-project .
docker run -it -p 3000:3000 my-new-project

Now enjoy your app at localhost:3000.

What's missing? ๐Ÿค”

This boilerplate does not suggest any way to compile your assets in a more production ready way. Also it doesn't make any frontend routing assumption (no library provided), nor it provides server side rendering (which you might want if you care about SEO).

Moreover, there's no default way to persist data in your backed. Picking the right database for your needs is left up to you.

These are only some of the aspects you have to generally keep in mind while building an application for production and this boilerplate leaves these concerns to you.

Contributing ๐Ÿค™

Everyone is very welcome to contribute to this project. You can contribute just by submitting bugs or suggesting improvements by opening an issue or by sending a pull request.

License ๐Ÿ‘ฎโ€โ™€๏ธ

Licensed under MIT License. ยฉ Luciano Mammino.

fastify-preact-htm-boilerplate's People

Contributors

lmammino avatar

Watchers

 avatar  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.