Elevate your web development experience with our Fastify MVC Template. Crafted for developers who seek efficiency without compromising on elegance.
- Fastify-Powered: Enjoy the performance and speed of Fastify.
- MVC Structure: Organized, scalable, and maintainable codebase.
- Sequelize ORM: Simplify database operations and ensure type safety.
- Ready-to-Use Scripts: Jumpstart your development with our predefined npm scripts.
-
Clone & Install:
git clone https://github.com/flyyuan/fastify-mvc-template.git cd fastify-mvc-template npm install
-
Configure & Run:
Update
config/config.json
with your database details and:npm start
-
Develop & Enjoy:
Visit
http://localhost:3000
and start building!
npm start
: ๐ Launch your app.npm run dev
: ๐ง Dev mode with nodemon.npm run migrate
: ๐ฆ Apply database migrations.npm run seed
: ๐ฑ Seed your database with initial data.
- Efficiency: Spend more time coding and less time setting up.
- Community: Join a growing community of passionate developers.
- Support: Regular updates and prompt support.
If your database setup involves an older version of MySQL that isn't compatible with the mysql2
driver, don't fret! Here's a guide to ensure everything runs smoothly:
-
Downgrade Sequelize:
- Newer Sequelize versions lean heavily on the
mysql2
driver. For compatibility with themysql
driver, you'll need to roll back to Sequelize version 3. - Command to run:
npm install sequelize@3 mysql --save
- Newer Sequelize versions lean heavily on the
-
Tweak Your Configuration:
- Make sure your Sequelize configuration is set to use the
mysql
dialect.{ "development": { "dialect": "mysql", ... } }
- Make sure your Sequelize configuration is set to use the
-
Documentation Dive:
- With Sequelize v3 in your toolkit, it's crucial to stick to the Sequelize v3 documentation. Remember, this version has its own set of APIs and features.
-
Lock It In:
- Consistency is key. Ensure you're using a
package-lock.json
oryarn.lock
to keep dependency versions consistent across all setups.
- Consistency is key. Ensure you're using a
While using an older Sequelize version might seem like stepping back, it's essential to weigh the benefits against the drawbacks. Newer features and fixes might be tempting, but always prioritize what's best for your project setup.
Your contributions are always welcome! Feel free to improve the template and send us a pull request.