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.
This commit is contained in:
parent
3b638a9509
commit
4557728932
20 changed files with 1955 additions and 20 deletions
36
server/package.json
Normal file
36
server/package.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"name": "dm-purchase-server",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "nodemon --watch src --exec ts-node src/index.ts",
|
||||
"build": "tsc -b",
|
||||
"start": "node dist/index.js",
|
||||
"migrate": "ts-node src/migrate.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"better-sqlite3": "^11.8.1",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.21.2",
|
||||
"zod": "^3.24.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cors": "^2.8.17",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/node": "^22.14.1",
|
||||
"nodemon": "^3.1.9",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "~5.7.2"
|
||||
},
|
||||
"pnpm": {
|
||||
"allowedScripts": {
|
||||
"better-sqlite3": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue