Project: fastify-react
Task (easy): 1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3
2) Add libs/setup.sql to create tables for products (id, name, price, image, description, quantity)
3) Create route POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})
4) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully
5) Create route GET /api/products to fetch all products
6) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully
7) Create Fastify Product Plugin in plugins/product.ts to register these apis