Skip to content
Snippets Groups Projects
Commit 9218c8f2 authored by Victor Löfgren's avatar Victor Löfgren
Browse files

config: Initial commit

parents
Branches master
No related tags found
No related merge requests found
Showing
with 409 additions and 0 deletions
__pycache__
*.db
*/env
*.coverage
\ No newline at end of file
{
"recommendations": [
"ms-python.python",
"ms-python.vscode-pylance",
"pranaygp.vscode-css-peek",
"dbaeumer.vscode-eslint",
"ms-vsliveshare.vsliveshare",
"cssho.vscode-svgviewer"
]
}
\ No newline at end of file
{
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
"editor.tabCompletion": "on",
"python.venvPath": "${workspaceFolder}\\server",
"python.analysis.extraPaths": ["server"],
"python.terminal.activateEnvironment": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": "server\\env\\Scripts\\black.exe",
"python.formatting.blackArgs": [
"--line-length",
"119"
],
"git.ignoreLimitWarning": true
}
\ No newline at end of file
{
"version": "2.0.0",
"tasks": [
{
"label": "Client",
"type": "npm",
"script": "start",
"path": "client/",
"group": "build",
"problemMatcher": [],
"presentation": {
"group": "Client/Server"
}
},
{
"label": "Server",
"type": "shell",
"group": "build",
"command": "${workspaceFolder}/server/env/Scripts/python main.py",
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/server"
},
"presentation": {
"group": "Client/Server"
}
},
{
"label": "Test Server",
"type": "shell",
"group": "build",
"command": "${workspaceFolder}/server/env/Scripts/python test.py",
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/server"
},
"presentation": {
"group": "Client/Server"
}
},
{
"label": "Client + Server",
"group": "build",
"dependsOn": [
"Server",
"Client"
],
"problemMatcher": []
}
]
}
\ No newline at end of file
# Scoring system for Teknikåttan
This is the scoring system for Teknikåttan!
## Installing
To install the client and server needed to run the application, look in their respective READMEs for intstructions.
## Using
After installing both the client and the server, you are ready to run the application.
This is done in VSCode by pressing `ctrl+shift+b` and running the `Client + Server` task.
The terminals for the client and server will now be seen on the right and left, respectively.
After making a change to either the client or the server while they are running, they will auto reload and you will see the changes immediately.
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Client
This documents describes how to install and run the client.
## Installing
You will need to do the following things to install the client:
1. Install [Visual Studio Code](https://code.visualstudio.com/) (VSCode).
2. Install [Node (LTS)](https://nodejs.org/en/).
3. Clone this repository if you haven't done so already.
4. Open the project folder in VSCode.
5. Open the integrated terminal by pressing `ctrl+ö`.
6. Type the following commands (or simply paste them) into your terminal:
```bash
# Go into the client directory.
cd client
# Install all dependencies.
npm install
```
## Using
After you have done every step described in setup, you are ready to start the client.
You can either start the client using tasks (recommended) or start it directly in the terminal.
### Tasks
You can run the client using Visual Studio Code tasks.
This is done by pressing `ctrl+shift+b` and running the `Client` task.
### Terminal
You can also run the client directly from the terminal.
All of the following snippets assume you are in the `client` folder.
Running the client:
```bash
npm run start
```
Installing new modules:
```bash
npm install new_module
```
Whenever a new module is installed, commited and pushed to git, everyone else needs to run `npm install` after pulling to install it as well.
Author: Victor Löfgren
Last updated: 11 February 2020
This diff is collapsed.
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.6.3",
"@types/jest": "^26.0.20",
"@types/node": "^12.19.16",
"@types/react": "^17.0.1",
"@types/react-dom": "^17.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.2",
"typescript": "^4.1.3",
"axios": "^0.21.1",
"web-vitals": "^1.1.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://localhost:5000/api/"
}
client/public/favicon.ico

3.78 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
client/public/logo192.png

5.22 KiB

client/public/logo512.png

9.44 KiB

{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
import React from 'react';
import logo from './logo.svg';
import './App.css';
import { useState, useEffect } from "react";
import axios from "axios";
interface Message {
message: string;
}
function App() {
const [currentMessage, setCurrentMessage] = useState<Message>();
useEffect(() => {
axios.get<Message>("users/test").then(response=> {
setCurrentMessage(response.data);
});
}, []);
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
<p>Current message is {currentMessage?.message}</p>
</header>
</div>
);
}
export default App;
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment