Overview This GitHub repository hosts a sleek and efficient product inventory system built using Vite and Svelte. Manage your inventory effortlessly with a user-friendly interface, featuring a dynamic home page and an intuitive "Add Product" section.
Getting Started Make sure you have Node.js installed on your machine.
Clone the repository:
```bash https://github.com/Arthraj/inventory-via-svelte.git
cd inventory-via-svelte
npm install
npm run dev
Discover a well-organized project structure designed for simplicity and clarity:
The project structure is organized as follows:
src/
ProductList.svelte: Component for displaying the list of productsProductForm.svelte: Component for the "Add Product" formProduct.svelte: Component of a single product.Home.svelte: Home page displaying a list of productsAddProduct.svelte: Page with the "Add Product" formproductsStore.js: Store file for managing inventory stateApi.js: Fetches JSON data.App.svelte: Main application componentmain.js: Entry point for the applicationpublic/: Static assets and mock data for our API.
tests/: Jest test files
ProductList.test.js: Test file for the ProductList componentAddProductForm.test.js: Test file for the AddProductForm componentHome Page Explore the inventory effortlessly on the dynamic home page.
Path: /
Add Product Efficiently add new products to your inventory with a user-friendly form.
Path: /addProduct
Development Server Script: "dev": "vite"
Action: Start the Vite development server for seamless local development.
Build Script: "build": "vite build"
Action: Build the project for production with Vite.
Preview Script: "preview": "vite preview"
Action: Preview the production build locally with Vite.
Test Script: "test": "jest"
Action: Run Jest for comprehensive testing of your Svelte components.
Jest Preset Configuration: "preset": "./jest-preset.json"
Action: Utilize a Jest preset configuration for efficient testing.
Vite and Svelte Packages: vite, @sveltejs/vite-plugin-svelte, svelte
Action: Leverage Vite as the build tool with Svelte support for a seamless development experience.
Testing Packages: jest, @testing-library/jest-dom, @testing-library/svelte, svelte-jester
Action: Integrate Jest for robust testing of Svelte components.
Type Definitions Packages: @types/jest
Action: Enhance your development experience with Jest type definitions.
Autoprefixer and PostCSS Packages: autoprefixer, postcss
Action: Configure Autoprefixer and PostCSS for stylish and responsive design.
Tailwind CSS Package: tailwindcss
Action: Integrate Tailwind CSS for a modern and visually appealing UI.
Babel for Jest Packages: @babel/preset-env, babel-jest
Action: Configure Babel for Jest to handle JavaScript transformations efficiently.
Svelte Preprocess and Svelte Routing Packages: svelte-preprocess, svelte-routing
Action: Utilize Svelte preprocess for seamless component preprocessing and Svelte Routing for effective navigation in your application.
TypeScript Jest Package: ts-jest
Action: Seamlessly integrate TypeScript with Jest for comprehensive testing and enhanced code quality.