-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded and removed vulnerabilities
- Loading branch information
tsoganov
committed
Dec 17, 2024
1 parent
ff4ac36
commit 43303de
Showing
148 changed files
with
10,550 additions
and
31,591 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,46 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
.idea | ||
/node_modules | ||
# Dependencies | ||
node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
# Build outputs | ||
/dist | ||
/dist-ssr | ||
/server/dist | ||
*.local | ||
|
||
# Testing | ||
/coverage | ||
/cypress/screenshots | ||
/cypress/videos | ||
|
||
# production | ||
/build | ||
|
||
# server | ||
/server/build | ||
|
||
# logs | ||
/logs/* | ||
# Logs | ||
/logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
# misc | ||
.DS_Store | ||
# Environment variables | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# Linting and formatting | ||
.eslintignore | ||
.prettierignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,61 @@ | ||
# EESTI INTERNETI SA - Registrant center | ||
# EESTI INTERNETI SA - Registrant Center | ||
|
||
### Kasutatud 📦 | ||
- Node.js: [node 14](https://nodejs.org/en/) | ||
- Core: [React v16](https://www.npmjs.com/package/react), [Redux](https://www.npmjs.com/package/redux), [React Router v4](https://www.npmjs.com/package/react-router), [React Intl](https://github.com/yahoo/react-intl) | ||
- Code: ES2017+ standard modern javascript | ||
- Server: [express v4](https://www.npmjs.com/package/express) | ||
- Logging: [winston](https://www.npmjs.com/package/winston) | ||
- Bundler: [CRA](https://github.com/facebook/create-react-app) | ||
## Tech Stack 🛠 | ||
|
||
### Tests and linting | ||
- Syntax checking (aka linting) with [eslint](https://www.npmjs.com/package/eslint) | ||
- Unit testing with [jest](http://facebook.github.io/jest/) | ||
- End to end/integration testing with [cypress](https://www.cypress.io/) | ||
### Core Technologies | ||
- Node.js: [Node 22](https://nodejs.org/en/) | ||
- Frontend: | ||
- [React v18](https://www.npmjs.com/package/react) | ||
- [Redux](https://www.npmjs.com/package/redux) | ||
- [React Router v7](https://www.npmjs.com/package/react-router) | ||
- [React Intl](https://github.com/yahoo/react-intl) | ||
- Backend: [Express v4](https://www.npmjs.com/package/express) | ||
- Logging: [Winston v3](https://www.npmjs.com/package/winston) | ||
|
||
## Setup | ||
- Create .env file from .env.example | ||
### Development Tools | ||
- Bundler: [Vite v6](https://github.com/vitejs/vite) | ||
- Language: Modern JavaScript (ES2020+) | ||
- Full ESM support (import/export) | ||
- Latest ECMAScript features | ||
- TypeScript and JSX support | ||
|
||
### Quality Assurance | ||
- Linting: [ESLint](https://www.npmjs.com/package/eslint) | ||
- Unit Testing: [Jest](http://facebook.github.io/jest/) | ||
- E2E Testing: [Cypress](https://www.cypress.io/) | ||
|
||
``` | ||
npm i | ||
npm run deploy | ||
## Getting Started 🚀 | ||
|
||
### Prerequisites | ||
- Node.js 22 or higher | ||
- npm 10 or higher | ||
|
||
### Setup | ||
1. Clone the repository | ||
2. Create `.env` file: | ||
```bash | ||
cp .env.example .env | ||
``` | ||
3. Install dependencies and deploy: | ||
```bash | ||
npm i | ||
npm run deploy | ||
``` | ||
|
||
## Available Scripts 📜 | ||
|
||
### Development | ||
```bash | ||
npm start # Start development environment | ||
``` | ||
|
||
## Scripts | ||
### Production | ||
```bash | ||
npm run serve # Start production environment | ||
``` | ||
|
||
##### Start development environment | ||
```npm start``` | ||
##### Start production environment | ||
```npm run serve``` | ||
##### Run tests | ||
```npm run test``` | ||
```npm run test:e2e``` - edit cypress.json baseUrl before use | ||
### Testing | ||
```bash | ||
npm run test # Run unit tests | ||
npm run test:e2e # Run end-to-end tests (update cypress.json baseUrl first) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,53 @@ | ||
const fs = require('fs'); | ||
const fse = require('fs-extra'); | ||
const childProcess = require('child_process'); | ||
import fs from 'node:fs'; | ||
import fse from 'fs-extra'; | ||
import { exec } from 'node:child_process'; | ||
import path from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
import { promisify } from 'node:util'; | ||
|
||
if (fs.existsSync('./build')) { | ||
fse.removeSync('./build'); | ||
} | ||
const execAsync = promisify(exec); | ||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
|
||
async function build() { | ||
// Clean up existing directories | ||
const clientDist = path.join(__dirname, 'dist'); | ||
const serverDist = path.join(__dirname, 'server', 'dist'); | ||
|
||
if (fs.existsSync(clientDist)) { | ||
console.log('Cleaning client dist directory...'); | ||
fse.removeSync(clientDist); | ||
} | ||
|
||
if (fs.existsSync(serverDist)) { | ||
console.log('Cleaning server dist directory...'); | ||
fse.removeSync(serverDist); | ||
} | ||
|
||
try { | ||
// Build client | ||
console.log('Building client...'); | ||
await execAsync('vite build', { stdio: 'inherit' }); | ||
|
||
// Run 'react-scripts build' script | ||
childProcess.execSync('react-scripts build', { stdio: 'inherit' }); | ||
// Ensure client dist was created | ||
if (!fs.existsSync(clientDist)) { | ||
throw new Error('Client build failed - dist directory not created'); | ||
} | ||
|
||
// Create server dist directory | ||
console.log('Creating server dist directory...'); | ||
fse.ensureDirSync(serverDist); | ||
|
||
// Copy client build to server | ||
console.log('Copying client build to server...'); | ||
fse.copySync(clientDist, serverDist); | ||
|
||
console.log('Build completed successfully!'); | ||
console.log(`Client build: ${clientDist}`); | ||
console.log(`Server build: ${serverDist}`); | ||
} catch (error) { | ||
console.error('Build failed:', error); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
// Move app build to server/build directory | ||
console.log('Moving ./build to /server/build'); | ||
fse.moveSync('./build', './server/build', { overwrite: true }); | ||
build(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import js from '@eslint/js' | ||
import globals from 'globals' | ||
import react from 'eslint-plugin-react' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import reactRefresh from 'eslint-plugin-react-refresh' | ||
import prettier from 'eslint-plugin-prettier' | ||
import airbnb from 'eslint-config-airbnb' | ||
|
||
export default [ | ||
{ ignores: ['dist'] }, | ||
{ | ||
files: ['**/*.{js,jsx}'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: globals.browser, | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
ecmaFeatures: { jsx: true }, | ||
sourceType: 'module', | ||
}, | ||
}, | ||
settings: { react: { version: 'detect' } }, | ||
plugins: { | ||
react, | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
prettier | ||
}, | ||
rules: { | ||
...js.configs.recommended.rules, | ||
...react.configs.recommended.rules, | ||
...react.configs['jsx-runtime'].rules, | ||
...reactHooks.configs.recommended.rules, | ||
...airbnb.rules, | ||
'camelcase': 0, | ||
'react/style-prop-object': 0, | ||
'global-require': 0, | ||
'import/newline-after-import': 0, | ||
'import/no-dynamic-require': 0, | ||
'import/no-extraneous-dependencies': 0, | ||
'jsx-a11y/anchor-is-valid': ['error'], | ||
'no-console': 0, | ||
'no-duplicate-imports': 0, | ||
'one-var': 0, | ||
'prettier/prettier': ['error'], | ||
'react/forbid-prop-types': [0, { checkChildContextTypes: false }], | ||
'react/jsx-filename-extension': [1, { extensions: ['.jsx'] }], | ||
'react/jsx-props-no-spreading': 0, | ||
'react/jsx-sort-props': ['error'], | ||
'react/prop-types': 0, | ||
'react/sort-comp': ['error'], | ||
'object-literal-sort-keys': 0, | ||
'react/jsx-no-target-blank': 'off', | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<link rel="apple-touch-icon" href="/logo192.png" /> | ||
<link rel="manifest" href="/manifest.json" /> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.jsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.