Frontend of the URL Shortener application. Built with:
- Vue 3
- Pinia (state management)
- Tailwind (CSS framework)
- Vitest + Vue Test Utils (Unit / Component testing)
- Cypress (E2E testing)
This project relies on environment variables defined in .env
files, such as the API base URI. As the project uses Vite, only variables prefixed with VITE_ can be used. Confirm that the values are correct for your setup, or change them to the correct values for your use case before continuing.
- .env.development - used in development mode
- .env.production - used in production builds
- .env.test - used in Vitest tests
- Navigate to the project's
client
folder using your terminal of choice. - Install the client's dependencies:
npm install
- Compile and hot-reload in development mode:
npm run dev
npm install
npm run dev
npm run build
Run Unit Tests with Vitest
npm run test:unit
Run End-to-End Tests with Cypress
Note: A production build (folder dist
) must be available before running this command. You can create a production build with the npm run build
command.
Both the client and the server must also be running in order for this command to execute correctly.
npm run test:e2e
Both the client and the server have to be running in order for the E2E tests to work.
npm run test:e2e:dev
npm run coverage
Lint with ESLint
npm run lint
├── ...
├── cypress
│ ├── e2e # E2E test files
│ ├── fixtures # External pieces of the data can be used by the test files
│ └── support # Support files to add things like re-usable methods to use in the test files
└── ...
├── ...
├── src
│ ├── assets # Public assets to use (e.g., CSS files)
│ ├── classes # JS classes to re-use across the application
│ ├── components # Vue components to use in the views
| │ ├── __tests__ # Test files for components
| | ├── ...
│ ├── router # Vue router files, where the application's routes are defined
| ├── stores # Pinia data stores
| | ├── __tests__ # Test files for stores
| | ├── ...
| ├── tests # Test configuration files
| | ├── mocks # Mock data for tests
| | ├── ...
| ├── utils # Utility classes / methods to re-use across the client source files
| ├── views # Views loaded into routes in the router configuration file
└── ...