Running Project
Overview
Card-Factory is a card game library developed using Vite. This documentation will guide you through setting up and running the project locally.
Prerequisites
- Node.js (v14 or higher)
- npm (v6 or higher)
- Git
Installation
- Clone the repository:
git clone https://github.com/Daver067/cards-npm-package.git
cd cards-npm-package- Install dependencies:
npm installDevelopment
Running the Dev Server
Start the development server with hot-reload:
npm run devThe main application will be accessible at http://localhost:5173. Additionally, a VitePress documentation server will run as a subprocess on port 5174, but you'll still access the documentation through the main application at port 5173.
Building for Production
Create a production-ready build:
npm run buildThis will generate optimized static files in the dist directory.
Previewing Production Build
To preview the production build locally:
npm run previewThis serves the contents of the dist directory at http://localhost:4173.
For a quick build and preview in one command:
npm run build && npm run previewProject Structure
cards-npm-package/
├── .github/ # GitHub configuration files
├── .husky/ # Git hooks configuration
├── dist/ # Production build output
├── docs/ # Documentation files
├── node_modules/ # Project dependencies
├── pages/ # Page components
├── public/ # Static assets
├── src/ # Source files
│ ├── assets/ # Project assets
│ ├── components/ # Reusable Card components
│ ├── legacy/ # Legacy code
│ ├── styles/ # Stylesheets
│ ├── types/ # TypeScript type definitions
│ ├── main.ts # Main entry point
├── tests/ # Test files
├── .gitignore # Git ignore configuration
├── .prettierrc.js # Prettier configuration
├── index.html # Main HTML file
├── commitlint.config.js # Commit message linting configuration
├── eslint.config.js # ESLint configuration
├── vite.config.js # Vite configuration
├── package-lock.json # NPM lock file
├── package.json # Project configuration and dependencies
├── tsconfig.json # TypeScript configuration
└── vitest.config.ts # Vitest configurationTroubleshooting
If you encounter any issues:
- Ensure all prerequisites are installed
- Try removing
node_modulesand runningnpm installagain - Check the GitHub issues page
Contributing
Please read our contributing guidelines before submitting pull requests.