Skip to content

Commit e33db07

Browse files
committed
Initial commit.
0 parents  commit e33db07

37 files changed

+6503
-0
lines changed

.eslintrc.cjs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* eslint-env node */
2+
module.exports = {
3+
root: true,
4+
parser: "@typescript-eslint/parser",
5+
plugins: ["@typescript-eslint"],
6+
extends: [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/eslint-recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
],
11+
parserOptions: {
12+
ecmaVersion: "latest",
13+
},
14+
ignorePatterns: ["dist", "node_modules"],
15+
overrides: [
16+
{
17+
files: ["**/*.{ts,vue}"],
18+
},
19+
],
20+
};

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# yarn
2+
.yarn/*
3+
!.yarn/releases
4+
!.yarn/plugins
5+
.pnp.*
6+
7+
# Logs
8+
logs
9+
*.log
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
lerna-debug.log*
15+
16+
node_modules
17+
.DS_Store
18+
dist
19+
dist-ssr
20+
coverage
21+
*.local
22+
23+
# Editor directories and files
24+
.vscode/*
25+
!.vscode/extensions.json
26+
.idea
27+
*.suo
28+
*.ntvs*
29+
*.njsproj
30+
*.sln
31+
*.sw?
32+
33+
test-results/
34+
playwright-report/

.prettierrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 120,
3+
"tabWidth": 2
4+
}

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

+28
Large diffs are not rendered by default.

.yarn/releases/yarn-3.3.1.cjs

+823
Large diffs are not rendered by default.

.yarnrc.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
nodeLinker: node-modules
2+
3+
plugins:
4+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
5+
spec: "@yarnpkg/plugin-workspace-tools"
6+
7+
yarnPath: .yarn/releases/yarn-3.3.1.cjs

apps/backend/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# backend

apps/backend/package.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "hotel-management-backend",
3+
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
6+
"packageManager": "[email protected]",
7+
"scripts": {
8+
"build": "tsc",
9+
"dev": "run-p dev:tsc dev:node",
10+
"dev:node": "node --watch-path=./src ./dist/main.js",
11+
"dev:tsc": "tsc --watch --preserveWatchOutput"
12+
},
13+
"dependencies": {
14+
"@types/express": "^4.17.16",
15+
"express": "^4.18.2"
16+
}
17+
}

apps/backend/src/main.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import * as fs from "node:fs/promises";
2+
import express from "express";
3+
4+
const packageJson = JSON.parse(await fs.readFile("./package.json", "utf-8"));
5+
6+
const APP_NAME = packageJson.name;
7+
const PORT = 3000;
8+
9+
const app = express();
10+
11+
const hotels = ["City Centre", "Messe", "Westend"];
12+
13+
app.get("/hotels", (request, response) => {
14+
response.send(JSON.stringify(hotels));
15+
});
16+
17+
app.listen(PORT, () => {
18+
console.info(`${APP_NAME} Listening on port ${PORT}...`);
19+
});

apps/backend/tsconfig.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"module": "node16",
5+
"outDir": "./dist"
6+
}
7+
}

apps/frontend/.eslintrc.cjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* eslint-env node */
2+
require("@rushstack/eslint-patch/modern-module-resolution");
3+
4+
module.exports = {
5+
extends: ["plugin:vue/vue3-essential", "@vue/eslint-config-typescript", "@vue/eslint-config-prettier"],
6+
parserOptions: {
7+
ecmaVersion: "latest",
8+
},
9+
};

apps/frontend/.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3+
}

apps/frontend/e2e/tsconfig.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "@vue/tsconfig/tsconfig.node.json",
3+
"include": ["./**/*"]
4+
}

apps/frontend/e2e/vue.spec.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { test, expect } from "@playwright/test";
2+
3+
// See here how to get started:
4+
// https://playwright.dev/docs/intro
5+
test("visits the app root url", async ({ page }) => {
6+
await page.goto("/");
7+
await expect(page.locator("div.greetings > h1")).toHaveText("You did it!");
8+
});

apps/frontend/env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

apps/frontend/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

apps/frontend/package.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "hotel-management-frontend",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "run-p type-check build-only",
8+
"preview": "vite preview",
9+
"test:unit": "vitest --environment jsdom --root src/",
10+
"test:e2e": "playwright test",
11+
"build-only": "vite build",
12+
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
13+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
14+
},
15+
"dependencies": {
16+
"pinia": "2.0.28",
17+
"vue": "3.2.45",
18+
"vue-router": "4.1.6"
19+
},
20+
"devDependencies": {
21+
"@playwright/test": "1.28.1",
22+
"@rushstack/eslint-patch": "1.1.4",
23+
"@types/jsdom": "20.0.1",
24+
"@vitejs/plugin-vue": "4.0.0",
25+
"@vue/eslint-config-prettier": "7.0.0",
26+
"@vue/eslint-config-typescript": "11.0.0",
27+
"@vue/test-utils": "2.2.6",
28+
"@vue/tsconfig": "0.1.3",
29+
"eslint-plugin-vue": "9.3.0",
30+
"jsdom": "20.0.3",
31+
"vite": "4.0.0",
32+
"vitest": "0.25.6",
33+
"vue-tsc": "1.0.12"
34+
}
35+
}

apps/frontend/playwright.config.ts

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
import type { PlaywrightTestConfig } from "@playwright/test";
2+
import { devices } from "@playwright/test";
3+
4+
/**
5+
* Read environment variables from file.
6+
* https://github.com/motdotla/dotenv
7+
*/
8+
// require('dotenv').config();
9+
10+
/**
11+
* See https://playwright.dev/docs/test-configuration.
12+
*/
13+
const config: PlaywrightTestConfig = {
14+
testDir: "./e2e",
15+
/* Maximum time one test can run for. */
16+
timeout: 30 * 1000,
17+
expect: {
18+
/**
19+
* Maximum time expect() should wait for the condition to be met.
20+
* For example in `await expect(locator).toHaveText();`
21+
*/
22+
timeout: 5000,
23+
},
24+
/* Fail the build on CI if you accidentally left test.only in the source code. */
25+
forbidOnly: !!process.env.CI,
26+
/* Retry on CI only */
27+
retries: process.env.CI ? 2 : 0,
28+
/* Opt out of parallel tests on CI. */
29+
workers: process.env.CI ? 1 : undefined,
30+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
31+
reporter: "html",
32+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
33+
use: {
34+
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
35+
actionTimeout: 0,
36+
/* Base URL to use in actions like `await page.goto('/')`. */
37+
baseURL: "http://localhost:5173",
38+
39+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
40+
trace: "on-first-retry",
41+
42+
/* Only on CI systems run the tests headless */
43+
headless: !!process.env.CI,
44+
},
45+
46+
/* Configure projects for major browsers */
47+
projects: [
48+
{
49+
name: "chromium",
50+
use: {
51+
...devices["Desktop Chrome"],
52+
},
53+
},
54+
{
55+
name: "firefox",
56+
use: {
57+
...devices["Desktop Firefox"],
58+
},
59+
},
60+
{
61+
name: "webkit",
62+
use: {
63+
...devices["Desktop Safari"],
64+
},
65+
},
66+
67+
/* Test against mobile viewports. */
68+
// {
69+
// name: 'Mobile Chrome',
70+
// use: {
71+
// ...devices['Pixel 5'],
72+
// },
73+
// },
74+
// {
75+
// name: 'Mobile Safari',
76+
// use: {
77+
// ...devices['iPhone 12'],
78+
// },
79+
// },
80+
81+
/* Test against branded browsers. */
82+
// {
83+
// name: 'Microsoft Edge',
84+
// use: {
85+
// channel: 'msedge',
86+
// },
87+
// },
88+
// {
89+
// name: 'Google Chrome',
90+
// use: {
91+
// channel: 'chrome',
92+
// },
93+
// },
94+
],
95+
96+
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
97+
// outputDir: 'test-results/',
98+
99+
/* Run your local dev server before starting the tests */
100+
webServer: {
101+
/**
102+
* Use the dev server by default for faster feedback loop.
103+
* Use the preview server on CI for more realistic testing.
104+
Playwright will re-use the local server if there is already a dev-server running.
105+
*/
106+
command: process.env.CI ? "vite preview --port 5173" : "vite dev",
107+
port: 5173,
108+
reuseExistingServer: !process.env.CI,
109+
},
110+
};
111+
112+
export default config;

apps/frontend/public/favicon.ico

4.19 KB
Binary file not shown.

apps/frontend/src/App.vue

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script setup lang="ts">
2+
import { RouterLink, RouterView } from "vue-router";
3+
</script>
4+
5+
<template>
6+
<header>
7+
<nav>
8+
<RouterLink to="/">Home</RouterLink>
9+
</nav>
10+
</header>
11+
12+
<RouterView />
13+
</template>
14+
15+
<style scoped></style>

0 commit comments

Comments
 (0)