Skip to content

Commit

Permalink
Merge pull request #1 from SELab-2/skeleton
Browse files Browse the repository at this point in the history
Add skeleton code
  • Loading branch information
reyniersbram authored Feb 23, 2024
2 parents 9059994 + df7d165 commit 575f21c
Show file tree
Hide file tree
Showing 41 changed files with 5,576 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
- name: Run Frontend linters
working-directory: frontend
run: |
npm run dev lint
npm run dev format:check
npm run lint
npm run format:check
- name: Run Backend linter
run: autopep8 -rd --exit-code backend
Expand Down
3 changes: 3 additions & 0 deletions backend/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
extend-ignore = E203
exclude = .git,__pycache__,venv
2 changes: 2 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
*venv*
43 changes: 43 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Run the backend api

### Setup

#### In this directy execute the following command to create a python environment:

```sh
python -m venv venv
```

#### Activate the environment:

```sh
source venv/bin/activate
```

#### Install the dependencies:

```sh
pip install -r requirements.txt
```

### Usage

#### Activate the environment:

```sh
source venv/bin/activate
```

#### Run the web server:

```sh
./run.sh
```

It will start a local development server on port `8000`

#### To format the python code in place to conform to PEP 8 style:

```sh
autopep8 -ri .
```
8 changes: 8 additions & 0 deletions backend/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from fastapi import FastAPI

app = FastAPI()


@app.get("/api")
async def root():
return {"message": "Hello World"}
20 changes: 20 additions & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
annotated-types==0.6.0
anyio==4.3.0
autopep8==2.0.4
click==8.1.7
fastapi==0.109.2
h11==0.14.0
httptools==0.6.1
idna==3.6
pycodestyle==2.11.1
pydantic==2.6.1
pydantic_core==2.16.2
python-dotenv==1.0.1
PyYAML==6.0.1
sniffio==1.3.0
starlette==0.36.3
typing_extensions==4.9.0
uvicorn==0.27.1
uvloop==0.19.0
watchfiles==0.21.0
websockets==12.0
3 changes: 3 additions & 0 deletions backend/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

uvicorn app:app --reload
15 changes: 15 additions & 0 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
parserOptions: {
ecmaVersion: 'latest'
}
}
30 changes: 30 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*.tsbuildinfo
8 changes: 8 additions & 0 deletions frontend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
8 changes: 8 additions & 0 deletions frontend/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
35 changes: 35 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Setup the frontend

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Type-Check, Compile and Minify for Production

```sh
npm run build
```

### Run Unit Tests with [Vitest](https://vitest.dev/)

```sh
npm run test:unit
```

### Lint with [ESLint](https://eslint.org/)

```sh
npm run lint
```

### Format with prettier

```sh
npm run format
```
1 change: 1 addition & 0 deletions frontend/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
13 changes: 13 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!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">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading

0 comments on commit 575f21c

Please sign in to comment.