Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
donghao2008 committed Nov 26, 2024
1 parent bc48847 commit bcc57d5
Show file tree
Hide file tree
Showing 550 changed files with 78,457 additions and 0 deletions.
59 changes: 59 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
pipeline {
agent any
stages {
stage('Install Dependencies') {
parallel {
stage('Backend Dependencies') {
steps {
dir('backend') {
sh 'npm install'
}
}
}
stage('Frontend Dependencies') {
steps {
dir('frontend') {
sh 'npm install'
}
}
}
}
}
stage('Run Tests') {
parallel {
stage('Backend Tests') {
steps {
dir('backend') {
sh 'npm test'
}
}
}
stage('Frontend Tests') {
steps {
dir('frontend') {
sh 'npm test'
}
}
}
}
}
stage('Build and Deploy') {
parallel {
stage('Build Frontend') {
steps {
dir('frontend') {
sh 'npm run build'
}
}
}
stage('Deploy Backend') {
steps {
dir('backend') {
sh 'npm run deploy' // Customize this with your deploy command
}
}
}
}
}
}
}
19 changes: 19 additions & 0 deletions backend/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const express = require('express');
const cors = require('cors');
const app = express();
const port = 3000;

// Enable CORS for all requests
app.use(cors());

// Middleware for parsing JSON
app.use(express.json());

// Import routes
const routes = require('./routes');
app.use('/api', routes);

// Start the server
app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});
3 changes: 3 additions & 0 deletions backend/controllers/greetController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exports.greet = (req, res) => {
res.send('Greetings from the REST API!');
};
3 changes: 3 additions & 0 deletions backend/controllers/helloController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exports.sayHello = (req, res) => {
res.send('Hello World!');
};
7 changes: 7 additions & 0 deletions backend/routes/greetRoutes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const express = require('express');
const router = express.Router();
const greetController = require('../controllers/greetController');

router.get('/', greetController.greet);

module.exports = router;
7 changes: 7 additions & 0 deletions backend/routes/helloRoutes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const express = require('express');
const router = express.Router();
const helloController = require('../controllers/helloController');

router.get('/', helloController.sayHello);

module.exports = router;
12 changes: 12 additions & 0 deletions backend/routes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const express = require('express');
const router = express.Router();

// Import route modules
const helloRoutes = require('./helloRoutes');
const greetRoutes = require('./greetRoutes');

// Use routes
router.use('/hello', helloRoutes);
router.use('/greet', greetRoutes);

module.exports = router;
24 changes: 24 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
node_modules
24 changes: 24 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frontend

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
5 changes: 5 additions & 0 deletions frontend/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
19 changes: 19 additions & 0 deletions frontend/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}
Loading

0 comments on commit bcc57d5

Please sign in to comment.