Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charlesread/fastify-scaffold
fastify-based webapps in seconds
https://github.com/charlesread/fastify-scaffold
Last synced: 21 days ago
JSON representation
fastify-based webapps in seconds
- Host: GitHub
- URL: https://github.com/charlesread/fastify-scaffold
- Owner: charlesread
- Created: 2018-02-09T21:59:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T05:56:37.000Z (almost 2 years ago)
- Last Synced: 2024-10-05T05:01:42.688Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 464 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fastify-scaffold
I write a fair number of web apps that use `fastify` (as a web server), `marko` (for templating), and `lasso` (for asset bundling).
I got sick of manually rigging all of those things together, so I wrote this simple CLI that will scaffold together a project with `fastify`, `marko`, and `lasso`, all configured to play nicely.
It's really just for me, but if you like it, cool.
## What it does
`fastify-scaffold` makes a few folders:
### `/plugins`
If you're new to `fastify` I'd suggest becoming more familiar with it, particularly it's plugin-centric architecture.
`fastify-scaffold` will `fastify.register(require())` every file that it finds in the `/plugins` directory. So you can really do anything in this folder, I tend to put a lot of routes in here.
### `/pages`
`fastify-scaffold` doesn't do anything magical with this folder, but I put all of my `marko` templates and resources for specific pages here.
### `/components`
A home for `marko` components.
### `/public/assets`
The entire `/public` folder is served at, you guessed it, `/public`. `/public/assets` is a great place for things like images or static JS libraries (jQuery, perhaps).
### `/public/static`
^ `/public/static` is where `lasso` outputs bundled resources, so this is a pretty important place.
## Usage
First, you'll need to install the CLI.
```bash
git clone [email protected]:charlesread/fastify-scaffold.git
cd fastify-scaffold
npm i
npm link # you may need to `sudo npm link` depending on how you've installed node
```Now you're ready to make a project.
```bash
mkdir myProject
cd myProject
fastify-scaffold -r # --runImmediately, optional
```
More to come.