No description
  • TypeScript 57.9%
  • Vue 37.4%
  • CSS 4%
  • Dockerfile 0.5%
  • HTML 0.2%
Find a file
2025-11-23 12:27:21 +00:00
.vscode init 2025-11-22 18:14:25 +03:00
i18n feat: more responsive interface 2025-11-23 14:35:49 +03:00
openapi/api feat: auth dialog 2025-11-23 11:58:59 +03:00
public feat: heyapi, cards for pickup points and confetti 2025-11-23 06:03:09 +03:00
src fix: update buttonVariants to include cursor-pointer class for better UX 2025-11-23 14:49:13 +03:00
.dockerignore feat: add Dockerfile and .gitlab-ci.yml for CI/CD setup; include .dockerignore 2025-11-23 12:06:36 +03:00
.editorconfig init 2025-11-22 18:14:25 +03:00
.env feat: heyapi, cards for pickup points and confetti 2025-11-23 06:03:09 +03:00
.gitattributes init 2025-11-22 18:14:25 +03:00
.gitignore init 2025-11-22 18:14:25 +03:00
.gitlab-ci.yml fix: correct stage name from 'build-e2e-push' to 'build-and-push' in CI configuration 2025-11-23 14:28:37 +03:00
.prettierrc.json init 2025-11-22 18:14:25 +03:00
bun.lock feat: more responsive interface 2025-11-23 14:35:49 +03:00
components.json init 2025-11-22 18:14:25 +03:00
docker-compose.yml feat: update CI/CD pipeline stages and add docker-compose.yml for frontend service 2025-11-23 13:08:06 +03:00
Dockerfile feat: add Dockerfile and .gitlab-ci.yml for CI/CD setup; include .dockerignore 2025-11-23 12:06:36 +03:00
env.d.ts feat: add TypeScript declaration for Vue components 2025-11-23 12:24:03 +03:00
eslint.config.ts init 2025-11-22 18:14:25 +03:00
index.html Edit index.html 2025-11-23 12:27:21 +00:00
openapi-ts.config.ts feat: heyapi, cards for pickup points and confetti 2025-11-23 06:03:09 +03:00
package.json feat: more responsive interface 2025-11-23 14:35:49 +03:00
README.md feat: more responsive interface 2025-11-23 14:35:49 +03:00
tsconfig.app.json init 2025-11-22 18:14:25 +03:00
tsconfig.json init 2025-11-22 18:14:25 +03:00
tsconfig.node.json init 2025-11-22 18:14:25 +03:00
vite.config.ts feat: add preview configuration with allowed hosts in Vite config 2025-11-23 13:28:00 +03:00

ymap-frontend

A Vue 3 + Vite frontend scaffold tailored for fast development using Bun as the runtime/package manager. This README expands on the minimal template instructions with detailed guidance for installation, development, build, testing, environment variables, deployment, and common troubleshooting.

I wrote this to help you get started quickly and to document conventions I recommend for this project.


Table of contents

  • Project overview
  • Prerequisites
  • Installation
  • Development
  • Available scripts
  • Environment variables
  • Project structure
  • Linting, formatting & type checking
  • Testing
  • Building & previewing production bundles
  • Deployment recommendations
  • Debugging & troubleshooting
  • Contributing
  • License & contact

Project overview You have a modern Vue 3 single page application built with Vite. It uses the speed of Bun for install and scripts. The repo follows a typical Vite + Vue layout: src/ contains application code, public/ static assets, and index.html is the app entry.

This README assumes:

  • Vue 3 (Composition API)
  • Vite as the bundler/dev server
  • Bun as package manager / script runner (commands like bun install, bun dev, bun run build)

If you need the project to run with npm/yarn instead of bun, substitute commands accordingly.

Prerequisites

  • Bun (v1.x or higher recommended). Install from https://bun.sh
  • Node-compatible tooling if you plan to use other package managers
  • A modern browser (Chrome/Edge/Firefox) for development with Vue devtools

Installation

  1. Clone the repo:
git clone <repository-url>
cd ymap-frontend
  1. Install dependencies with Bun:
bun install

Development Start the dev server (Vite):

bun dev
  • The dev server supports hot module replacement (HMR).
  • Open the URL printed by Vite (usually http://localhost:5173) in your browser.
  • Use Vue Devtools in Chrome/Firefox for component inspection.

Available scripts These are the standard commands included in the template. Run them with bun (e.g., bun run build) or adapt to npm/yarn as needed.

  • bun dev — Start the Vite dev server with HMR.
  • bun run build — Produce an optimized production build in dist/.
  • bun run preview — (If configured) serve built output locally for testing.
  • bun lint — Run ESLint checks (if ESLint is configured).
  • bun test — Run tests (if a test runner is configured, e.g. Vitest or Jest).

Example usage:

# Start dev server
bun dev

# Build for production
bun run build

# Lint code
bun lint

Environment variables Use a .env file for local environment variables. Vite supports import.meta.env for access at runtime. Keep these rules:

  • Prefix any variable that should be exposed to the client with VITE_ (e.g. VITE_API_BASE_URL).
  • Do not commit secrets (.env.local or .env should be in .gitignore).

Example .env (do not commit):

VITE_API_BASE_URL=https://api.example.com
VITE_MAP_API_KEY=your_map_service_key_here

Accessing in code:

  • Use import.meta.env.VITE_API_BASE_URL inside your Vue components or other client code.

Project structure A recommended structure for the repo:

  • index.html - Vite entry HTML
  • public/ - Static assets
  • src/
    • main.ts - App bootstrap
    • App.vue - Root component
    • components/ - Reusable Vue components
    • views/ - Page-level components
    • router/ - Vue Router configuration
    • store/ or composables/ - State management or composables (Pinia / Vuex)
    • assets/ - Images/CSS
    • types/ - Global TypeScript types
  • vite.config.ts - Vite configuration
  • tsconfig.json - TypeScript configuration
  • .eslintrc / .prettierrc - Lint/format config

Example paths youll commonly edit:

  • src/main.ts
  • src/App.vue
  • src/components/YourComponent.vue

Linting, formatting & type checking

  • ESLint and Prettier are recommended to keep code consistent.
  • The template uses vue-tsc to provide type checking for .vue files when using TypeScript.
  • Recommended editor setup:
    • VS Code with the Volar extension (disable Vetur)
    • Prettier and ESLint extensions

Type-checking:

# Run TypeScript type checks (via vue-tsc if configured)
bun run typecheck

Testing If tests are set up (Vitest is a common choice in Vite projects), run:

bun run test

If tests are not yet configured, consider adding Vitest for fast unit testing with Vite compatibility.

Building & previewing production bundles Build:

bun run build

The production bundle will be written to dist/ by default.

Preview:

bun run preview

Preview runs a local static server to verify the production bundle before deployment (this may require a preview script in package.json that uses vite preview).

Deployment recommendations You can deploy the dist/ output to most static hosting services:

  • Vercel: automatic deployment from Git with a Vite build step.
  • Netlify: set build command to bun run build and publish directory to dist.
  • GitHub Pages: push dist/ to gh-pages branch or leverage GH Actions.
  • Docker: You can create a small static server image to serve dist/ (example below).

Example Dockerfile (simple static server using nginx):

# Build stage
FROM node:18-alpine AS builder
WORKDIR /app
COPY . .
# If using Bun, you might need a Bun-enabled builder image. Using npm/yarn is more portable here:
RUN npm ci
RUN npm run build

# Serve stage
FROM nginx:stable-alpine
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

CI/CD tips

  • Cache Bun or node_modules between runs for faster CI.
  • Run bun lint and bun run test in CI before building.
  • Publish artifacts (e.g., dist/) or deploy directly from CI to your hosting provider.

Debugging & troubleshooting

  • If HMR doesn't reflect changes: clear the browser cache and restart bun dev.
  • If environment variables aren't available: ensure they are prefixed with VITE_ and restart the dev server after changing .env.
  • Type errors in .vue files: make sure vue-tsc is configured and your IDE uses Volar.

Common debugging commands:

# Install dependencies
bun install

# Development
bun dev

# Build production
bun run build

# Preview production build (if configured)
bun run preview

# Lint
bun lint

# Test
bun run test