Skip to content

Learn Fastify step-by-step, by building a Recipe App. Follow the outline below/commits to see what's new at each level. Create a issue if something doesn't work for you.

one-aalam/havyt

Repository files navigation

Havyt

Learn Fastify by building a Recipe App (Typescript Ready)

Havyt is Node.js Full-Stack Web Application that's built ground-up, step-by-step to

  • Introduce the essential components of Fastify like the server, router and powerful constructs like plugins, hooks and decorators all while remaining simple in its approach so that it's easy for new comers to the Framework to pick things
  • Show the workings of a modern Node.js framework that values stability, extensibility and speed over simple ergnomics
  • Possibly accomodate all sorts of very common use cases with time (while remaining commited to simplicity) either in the main branch
    • Fastify for APIs
    • Fastify for Server Side Web Apps
    • Fastify & Auth
  • Or, extended use cases like (in the different branches or forks)
    • Fastify & Modern FE Frameworks (Svelte, SolidJS, Next.js, Vite, etc.)
    • Fastify Fully-Tested (setup is available, but lagging currently )
    • Fastify and different DB flavors(The main repo has just a hand-rolled FS based data store)
    • Fastify & GraphQL
    • Fastify for Serverless
    • Fastify & Micro-services

Note: The repo may remain Concept-Complete First than Feature-complete, so that individual important commits could be checked out, and built upon as an exercise to learn about different features in-depth.

Commits so far...

partially documented

Topic Sub-topic Commit
1.Setup Set-up Typescript, ESLint, Prettier, ts-node-dev
Husky and lint-staged
2. Model Entities Add Types
Add Fixtures
3. Serve Your first HTTP Server
Your First HTTP Server with Fastify
Use ES Syntax for a better looking code
Keep Fastify App and Server, close but separate
Catch Server exceptions, and exit the process
4. GET what they want Create routes per resource
Get creative with /GETs
Type what you receive
Get more creative with /GET (recipe)
Tell what you don't have
Tell what you don't have (JSON edition)
5. Be able to get more of what they want HTTP verb galore - more ways to receive actions (category)
Enforce constraints, inform data issues
Type easy
Exercise: Add more methods for recipe
6. Validate what you get Add validation with JSON Schema
Schemas to Types
Add serialisation with JSON Schema
Re-factor: Add Per-resource schema files
Derive types from schemas
Add schemas to Get All calls
                        |

When to expect the new changes?

There's no timeline, but I try to contribute once every week in this repo with application of one single concept. You can watch the repo, or follow me on Twitter to be notified of the updates.

Trivia

This project builds upon my past experience of building Web-Apps/APIs/Boilerplates on top of Node.js like Attic and Embrace

About

Learn Fastify step-by-step, by building a Recipe App. Follow the outline below/commits to see what's new at each level. Create a issue if something doesn't work for you.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published