Fundi is an application scaffold for REST API backend based on Fastify.
NB: This project should be considered WIP and it doesn't aim to reflect the best way Fastify should be used, but it's rather an experiment to help driving into Fastify best practices.
Fundi comes from Swahili and means technician, artisan, craftsman.
Fundi is intended to be a scaffold to build business web application using Fasify.
Because Fastify is an interesting and fast-growing framework to build server-side web applications focused on performance.
Even if this project is not indeed to be "fast", the Fastify framework is chosen for its service/plugin/middleware architecture approach, which could be a key feature to build flexible and extensible software in a business application context.
There are plenty of "batteries-included" "opinionated" frameworks that can solve this problem, most of them are based on Express.js, this would be a scaffold built from scratch using Fastify.
This project is a prototype open to everyone who wants to contribute to defining what could be the best approach for a better developer experience. Feel free to open a pull request or open an issue.
- Clone repository and run
npm install
$ git clone [email protected]:etino/fundi.git
$ cd fundi
$ npm install-
Copy
.env.templatein.envand set your environment variables -
Database initialization (default engine
sqlite3in/datafolder - need to be created)
$ mkdir data
$ npm run db:migrate:latest
$ npm run db:seed:run // load data with defaults- Run the server and open http://localhost:3000/documentation
$ npm run start Implemented services are located in service directory. Actually only users service is implemented.
Every service has the following architecture
index.jsfor routes and handler functionsservice.jsfor business logicmodelsdirectory for ORM (Objection.js) models.
- define a standard (automatic) CRUD implementation
- evaluate ORM alternatives (for example Prisma.io)
- convert to Typescript(?)
- implement a test strategy
- fastify-cli
- fastify-autoload
- fastify-env
- fastify-jwt
- fastify-objectionjs based on knex.js and Objection.js
- fastify-swagger based on Swagger.io with OpenAPI 3.0 Specification
Fundi is build starting from this examples projects