Commit graph

3 commits

Author SHA1 Message Date
11104dbf29
Improves boolean parsing for 'purchased' field
Updates the StoreItemSchema to handle various input formats for the 'purchased' field, including strings and numbers.

This ensures that the application can correctly interpret boolean values from different sources, preventing data validation errors and improving the user experience.

Adds a preprocess function to the schema to convert string values like "on", "true", "1", "off", "false", and "0", and number values of 1 and 0 to their respective boolean equivalents before validation.
2025-08-21 15:46:00 +08:00
31801d0991
Updates application port to 3004
WHAT: Updates the application's default port from 8080 to 3004 across various Docker configurations and scripts. This includes changes to Dockerfiles, docker-compose files, and startup scripts. Also updates the vite config.
WHY: Standardizes the port used by the application to 3004 for consistency and to avoid potential conflicts with other services that might be using port 8080.
HOW: Modifies the `EXPOSE` directives in the Dockerfiles, the port mappings in the docker-compose files, the default port in the main application server file, the port in the vite config and the scripts that display the API URL.
2025-08-21 14:55:16 +08:00
4557728932
Adds Docker setup and basic API endpoints
WHAT: Introduces Dockerfiles for development and production, Docker Compose configurations, a Makefile for common tasks, shell scripts for environment setup/teardown, a basic Express API with SQLite integration.
WHY: Enables easy setup and deployment of the application using Docker. Provides basic API endpoints for managing purchase items.
HOW:
- Creates `docker-compose.dev.yml` and `docker-compose.prod.yml` to define services and volumes.
- Introduces `Dockerfile.dev` and `Dockerfile.prod` to build container images with necessary dependencies.
- Adds `Makefile` with commands for building, running, and managing the application.
- Implements shell scripts for simplified Docker environment management.
- Sets up Express API with endpoints for CRUD operations on purchase items, using SQLite as the database.
- Uses `better-sqlite3` to connect and interact with the SQLite database.
2025-08-21 14:46:11 +08:00