Merge package.json files into one (#160)
Co-authored-by: Chris Veleris <chrisveleris@gmail.com>
This commit is contained in:
parent
4878c71618
commit
c7c859f666
7 changed files with 2914 additions and 10471 deletions
18
Dockerfile
18
Dockerfile
|
|
@ -11,15 +11,19 @@ RUN apk add --no-cache --virtual .build-deps \
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Install all dependencies (frontend and backend)
|
||||
RUN npm install --no-audit --no-fund
|
||||
|
||||
# Copy source code
|
||||
COPY . ./
|
||||
|
||||
# Build frontend
|
||||
RUN npm install --no-audit --no-fund
|
||||
RUN NODE_ENV=production npm run build
|
||||
# Install backend dependencies
|
||||
RUN cd backend && npm install --no-audit --no-fund
|
||||
RUN NODE_ENV=production npm run frontend:build
|
||||
|
||||
# Run backend tests
|
||||
RUN cd backend && DOCKER_BUILD=1 npm test
|
||||
RUN DOCKER_BUILD=1 npm run backend:test
|
||||
# Cleanup
|
||||
RUN npm cache clean --force && \
|
||||
rm -rf ~/.npm /tmp/* && \
|
||||
|
|
@ -59,8 +63,8 @@ RUN rm -rf /app/backend/dist
|
|||
COPY --from=builder --chown=app:app /app/dist ./backend/dist
|
||||
COPY --from=builder --chown=app:app /app/public/locales ./backend/dist/locales
|
||||
|
||||
# Copy backend dependencies
|
||||
COPY --from=builder --chown=app:app /app/backend/node_modules ./backend/node_modules
|
||||
# Copy all dependencies (now in root)
|
||||
COPY --from=builder --chown=app:app /app/node_modules ./node_modules
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p /app/backend/db /app/backend/certs && \
|
||||
|
|
|
|||
30
README.md
30
README.md
|
|
@ -258,13 +258,8 @@ To install `tududi`, follow these steps:
|
|||
```
|
||||
3. Install the required dependencies:
|
||||
```bash
|
||||
# Install frontend dependencies
|
||||
# Install all dependencies (frontend and backend)
|
||||
npm install
|
||||
|
||||
# Install backend dependencies
|
||||
cd backend
|
||||
npm install
|
||||
cd ..
|
||||
```
|
||||
|
||||
### 🔒 SSL Setup (Optional)
|
||||
|
|
@ -288,8 +283,6 @@ For HTTPS support, create SSL certificates:
|
|||
The database will be automatically initialized when you start the Express backend. For manual database operations:
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
|
||||
# Initialize database (creates tables, drops existing data)
|
||||
npm run db:init
|
||||
|
||||
|
|
@ -304,8 +297,6 @@ npm run db:reset
|
|||
|
||||
# Check database status and connection
|
||||
npm run db:status
|
||||
|
||||
cd ..
|
||||
```
|
||||
|
||||
### 🔄 Database Migrations
|
||||
|
|
@ -313,8 +304,6 @@ cd ..
|
|||
For schema changes, use Sequelize migrations (similar to Rails/Ruby migrations):
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
|
||||
# Create a new migration
|
||||
npm run migration:create add-description-to-tasks
|
||||
|
||||
|
|
@ -329,8 +318,6 @@ npm run migration:undo
|
|||
|
||||
# Rollback all migrations
|
||||
npm run migration:undo:all
|
||||
|
||||
cd ..
|
||||
```
|
||||
|
||||
#### Creating a New Migration Example:
|
||||
|
|
@ -360,9 +347,7 @@ export TUDUDI_SESSION_SECRET=$(openssl rand -hex 64)
|
|||
|
||||
Or create a user manually:
|
||||
```bash
|
||||
cd backend
|
||||
npm run user:create dev@example.com password123
|
||||
cd ..
|
||||
```
|
||||
|
||||
#### Default Development Credentials
|
||||
|
|
@ -377,15 +362,14 @@ To start the application for development:
|
|||
|
||||
1. **Start the Express backend** (in one terminal):
|
||||
```bash
|
||||
cd backend
|
||||
npm run dev # Development mode with auto-reload
|
||||
# Or: npm start # Production mode
|
||||
npm run backend:dev # Development mode with auto-reload
|
||||
# Or: npm run backend:start # Production mode
|
||||
```
|
||||
The backend will run on `http://localhost:3001`
|
||||
|
||||
2. **Start the frontend development server** (in another terminal):
|
||||
```bash
|
||||
npm run dev
|
||||
npm run frontend:dev
|
||||
```
|
||||
The frontend will run on `http://localhost:8080`
|
||||
|
||||
|
|
@ -405,12 +389,10 @@ To run tests:
|
|||
|
||||
```bash
|
||||
# Backend tests
|
||||
cd backend
|
||||
npm test
|
||||
npm run backend:test
|
||||
|
||||
# Frontend tests
|
||||
cd ..
|
||||
npm test
|
||||
npm run frontend:test
|
||||
```
|
||||
|
||||
#### Test Coverage
|
||||
|
|
|
|||
10202
backend/package-lock.json
generated
10202
backend/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,66 +0,0 @@
|
|||
{
|
||||
"name": "backend",
|
||||
"version": "v0.70.3",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "./cmd/start.sh",
|
||||
"start:dev": "nodemon app.js",
|
||||
"test": "cross-env NODE_ENV=test jest",
|
||||
"test:watch": "cross-env NODE_ENV=test jest --watch",
|
||||
"test:coverage": "cross-env NODE_ENV=test jest --coverage",
|
||||
"test:unit": "cross-env NODE_ENV=test jest tests/unit",
|
||||
"test:integration": "cross-env NODE_ENV=test jest tests/integration",
|
||||
"test:telegram-duplicates": "node scripts/test-telegram-duplicates.js",
|
||||
"db:init": "node scripts/db-init.js",
|
||||
"db:sync": "node scripts/db-sync.js",
|
||||
"db:migrate": "node scripts/db-migrate.js",
|
||||
"db:reset": "node scripts/db-reset.js",
|
||||
"db:status": "node scripts/db-status.js",
|
||||
"user:create": "node scripts/user-create.js",
|
||||
"migration:create": "node scripts/migration-create.js",
|
||||
"migration:run": "npx sequelize-cli db:migrate",
|
||||
"migration:undo": "npx sequelize-cli db:migrate:undo",
|
||||
"migration:undo:all": "npx sequelize-cli db:migrate:undo:all",
|
||||
"migration:status": "npx sequelize-cli db:migrate:status",
|
||||
"seed:dev": "node scripts/seed-dev-data.js",
|
||||
"lint": "eslint .",
|
||||
"lint-fix": "eslint . --fix",
|
||||
"format": "prettier --write ."
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"bcrypt": "~6.0.0",
|
||||
"compression": "~1.8.0",
|
||||
"compromise": "^14.14.4",
|
||||
"connect-session-sequelize": "~7.1.7",
|
||||
"cors": "~2.8.5",
|
||||
"dotenv": "~16.5.0",
|
||||
"eslint": "^8.0.0",
|
||||
"express": "^4.21.2",
|
||||
"express-session": "~1.18.1",
|
||||
"googleapis": "~144.0.0",
|
||||
"helmet": "~8.1.0",
|
||||
"js-yaml": "~4.1.0",
|
||||
"moment-timezone": "~0.6.0",
|
||||
"morgan": "~1.10.0",
|
||||
"multer": "~2.0.1",
|
||||
"node-cron": "~4.1.0",
|
||||
"recharts": "~2.15.4",
|
||||
"sequelize": "~6.37.7",
|
||||
"sqlite3": "~5.1.7",
|
||||
"uuid": "~11.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "~7.0.3",
|
||||
"eslint-plugin-jest": "^29.0.1",
|
||||
"eslint-plugin-prettier": "^5.5.1",
|
||||
"jest": "~30.0.0",
|
||||
"nodemon": "~3.0.1",
|
||||
"prettier": "~3.6.2",
|
||||
"sequelize-cli": "~6.6.2",
|
||||
"supertest": "~7.1.1"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
const express = require('express');
|
||||
const { User } = require('../models');
|
||||
const packageJson = require('../package.json');
|
||||
const packageJson = require('../../package.json');
|
||||
const router = express.Router();
|
||||
|
||||
// Get version
|
||||
|
|
|
|||
2982
package-lock.json
generated
2982
package-lock.json
generated
File diff suppressed because it is too large
Load diff
85
package.json
85
package.json
|
|
@ -2,27 +2,64 @@
|
|||
"name": "tududi",
|
||||
"version": "v0.70.3",
|
||||
"description": "Self-hosted task management with hierarchical organization (Areas > Projects > Tasks), multi-language support, and Telegram integration. Built with React/TypeScript frontend and functional programming Express.js backend.",
|
||||
"main": "index.js",
|
||||
"main": "backend/app.js",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:coverage": "jest --coverage",
|
||||
"clean": "rimraf dist",
|
||||
"build": "npm run clean && tsc --noEmit && webpack --config webpack.config.js",
|
||||
"start": "tsc --noEmit && webpack serve --config webpack.config.js",
|
||||
"dev": "webpack serve --config webpack.config.js --hot",
|
||||
"lint": "eslint 'frontend/**/*.{js,jsx,ts,tsx}'",
|
||||
"lint-fix": "eslint --fix 'frontend/**/*.{js,jsx,ts,tsx}'",
|
||||
"docker:test-build": "bash scripts/test-docker-build.sh",
|
||||
"format": "prettier --write 'frontend/**/*.{js,jsx,ts,tsx}'",
|
||||
"start": "npm run backend:start",
|
||||
"dev": "npm run frontend:dev",
|
||||
"build": "npm run frontend:build",
|
||||
"test": "npm run frontend:test && npm run backend:test",
|
||||
"test:watch": "npm run frontend:test:watch",
|
||||
"test:coverage": "npm run frontend:test:coverage && npm run backend:test:coverage",
|
||||
|
||||
"frontend:dev": "webpack serve --config webpack.config.js --hot",
|
||||
"frontend:start": "tsc --noEmit && webpack serve --config webpack.config.js",
|
||||
"frontend:build": "npm run clean && tsc --noEmit && webpack --config webpack.config.js",
|
||||
"frontend:test": "jest",
|
||||
"frontend:test:watch": "jest --watch",
|
||||
"frontend:test:coverage": "jest --coverage",
|
||||
"frontend:lint": "eslint 'frontend/**/*.{js,jsx,ts,tsx}'",
|
||||
"frontend:lint-fix": "eslint --fix 'frontend/**/*.{js,jsx,ts,tsx}'",
|
||||
"frontend:format": "prettier --write 'frontend/**/*.{js,jsx,ts,tsx}'",
|
||||
|
||||
"backend:start": "cd backend && ./cmd/start.sh",
|
||||
"backend:dev": "cd backend && nodemon app.js",
|
||||
"backend:test": "cd backend && cross-env NODE_ENV=test jest",
|
||||
"backend:test:watch": "cd backend && cross-env NODE_ENV=test jest --watch",
|
||||
"backend:test:coverage": "cd backend && cross-env NODE_ENV=test jest --coverage",
|
||||
"backend:test:unit": "cd backend && cross-env NODE_ENV=test jest tests/unit",
|
||||
"backend:test:integration": "cd backend && cross-env NODE_ENV=test jest tests/integration",
|
||||
"backend:lint": "cd backend && eslint .",
|
||||
"backend:lint-fix": "cd backend && eslint . --fix",
|
||||
"backend:format": "cd backend && prettier --write .",
|
||||
|
||||
"db:init": "cd backend && node scripts/db-init.js",
|
||||
"db:sync": "cd backend && node scripts/db-sync.js",
|
||||
"db:migrate": "cd backend && node scripts/db-migrate.js",
|
||||
"db:reset": "cd backend && node scripts/db-reset.js",
|
||||
"db:status": "cd backend && node scripts/db-status.js",
|
||||
"db:seed": "cd backend && node scripts/seed-dev-data.js",
|
||||
|
||||
"user:create": "cd backend && node scripts/user-create.js",
|
||||
"migration:create": "cd backend && node scripts/migration-create.js",
|
||||
"migration:run": "cd backend && npx sequelize-cli db:migrate",
|
||||
"migration:undo": "cd backend && npx sequelize-cli db:migrate:undo",
|
||||
"migration:undo:all": "cd backend && npx sequelize-cli db:migrate:undo:all",
|
||||
"migration:status": "cd backend && npx sequelize-cli db:migrate:status",
|
||||
|
||||
"translations:sync": "cd scripts && ./sync-translations.js",
|
||||
"translations:sync-all": "cd scripts && ./sync-translations.js --all",
|
||||
"translations:dry-run": "cd scripts && ./sync-translations.js --all --dry-run",
|
||||
"translations:check": "cd scripts && ./sync-translations.js --all --dry-run --verbose",
|
||||
"translations:export": "cd scripts && ./sync-translations.js --all --dry-run --output missing-translations.json"
|
||||
"translations:export": "cd scripts && ./sync-translations.js --all --dry-run --output missing-translations.json",
|
||||
|
||||
"clean": "rimraf dist",
|
||||
"lint": "npm run frontend:lint && npm run backend:lint",
|
||||
"lint-fix": "npm run frontend:lint-fix && npm run backend:lint-fix",
|
||||
"format": "npm run frontend:format && npm run backend:format",
|
||||
"docker:test-build": "bash scripts/test-docker-build.sh"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
|
@ -44,6 +81,7 @@
|
|||
"autoprefixer": "^10.4.20",
|
||||
"babel-jest": "^29.0.0",
|
||||
"babel-loader": "^9.2.1",
|
||||
"cross-env": "~7.0.3",
|
||||
"css-loader": "^7.1.2",
|
||||
"eslint": "^8.0.0",
|
||||
"eslint-plugin-jest": "^29.0.1",
|
||||
|
|
@ -53,11 +91,14 @@
|
|||
"identity-obj-proxy": "^3.0.0",
|
||||
"jest": "^29.0.0",
|
||||
"jest-environment-jsdom": "^29.0.0",
|
||||
"nodemon": "~3.0.1",
|
||||
"postcss": "^8.4.47",
|
||||
"postcss-loader": "^8.1.1",
|
||||
"react-refresh": "^0.14.2",
|
||||
"rimraf": "^6.0.1",
|
||||
"sequelize-cli": "~6.6.2",
|
||||
"style-loader": "^4.0.0",
|
||||
"supertest": "~7.1.1",
|
||||
"tailwindcss": "^3.4.13",
|
||||
"ts-jest": "^29.0.0",
|
||||
"ts-loader": "^9.5.1",
|
||||
|
|
@ -69,12 +110,27 @@
|
|||
"dependencies": {
|
||||
"@heroicons/react": "^2.1.5",
|
||||
"@yaireo/tagify": "^4.31.3",
|
||||
"bcrypt": "~6.0.0",
|
||||
"compression": "~1.8.0",
|
||||
"compromise": "^14.14.4",
|
||||
"connect-session-sequelize": "~7.1.7",
|
||||
"cors": "~2.8.5",
|
||||
"date-fns": "^4.1.0",
|
||||
"dotenv": "~16.5.0",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"express": "^4.21.2",
|
||||
"express-session": "~1.18.1",
|
||||
"googleapis": "~144.0.0",
|
||||
"helmet": "~8.1.0",
|
||||
"highlight.js": "^11.11.1",
|
||||
"i18next": "^24.2.3",
|
||||
"i18next-browser-languagedetector": "^8.0.4",
|
||||
"i18next-http-backend": "^3.0.2",
|
||||
"js-yaml": "~4.1.0",
|
||||
"moment-timezone": "~0.6.0",
|
||||
"morgan": "~1.10.0",
|
||||
"multer": "~2.0.1",
|
||||
"node-cron": "~4.1.0",
|
||||
"prettier": "^3.6.2",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
|
@ -85,9 +141,12 @@
|
|||
"recharts": "^2.15.4",
|
||||
"rehype-highlight": "^7.0.2",
|
||||
"remark-gfm": "^4.0.1",
|
||||
"sequelize": "~6.37.7",
|
||||
"sqlite3": "~5.1.7",
|
||||
"swr": "^2.2.5",
|
||||
"tagify": "^0.1.1",
|
||||
"typescript-eslint": "^8.36.0",
|
||||
"uuid": "~11.1.0",
|
||||
"zustand": "^5.0.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue