Skip to content
Snippets Groups Projects
Commit 80901d10 authored by Mehdi Mohamed Mahmoud's avatar Mehdi Mohamed Mahmoud
Browse files

Merge branch 'master' into 'main'

Push existing project to GitLab

See merge request !1
parents 04577841 2e5247f3
No related branches found
No related tags found
1 merge request!1Push existing project to GitLab
Showing with 8262 additions and 72 deletions
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-prettier/skip-formatting'
],
overrides: [
{
files: [
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}',
'cypress/support/**/*.{js,ts,jsx,tsx}'
],
'extends': [
'plugin:cypress/recommended'
]
}
],
parserOptions: {
ecmaVersion: 'latest'
}
}
# 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
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
\ No newline at end of file
{
"recommendations": [
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
# frontend5
# vue-project
This template should help get you started developing with Vue 3 in Vite.
## Recommended IDE Setup
## Getting started
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
## Customize configuration
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
See [Vite Configuration Reference](https://vitejs.dev/config/).
## Add your files
## Project Setup
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.stud.idi.ntnu.no/mehdimm/frontend5.git
git branch -M main
git push -uf origin main
```sh
npm install
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.stud.idi.ntnu.no/mehdimm/frontend5/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
### Compile and Hot-Reload for Development
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
```sh
npm run dev
```
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
### Compile and Minify for Production
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
```sh
npm run build
```
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
### Run Unit Tests with [Vitest](https://vitest.dev/)
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
```sh
npm run test:unit
```
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
```sh
npm run test:e2e:dev
```
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
This runs the end-to-end tests against the Vite development server.
It is much faster than the production build.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments):
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
```sh
npm run build
npm run test:e2e
```
## License
For open source projects, say how it is licensed.
### Lint with [ESLint](https://eslint.org/)
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
```sh
npm run lint
```
import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
baseUrl: 'http://localhost:4173'
}
})
describe('Form Validation', () => {
beforeEach(() => {
cy.visit('/Contact-form');
});
it('should deactivate submit button if form content is invalid', () => {
// Type invalid input into the form fields
cy.get('input[name="name"]').type('mehdi');
cy.get('input[name="email"]').type('invalidemail'); // Insert invalid emai
// Assert that the submit button is disabled
cy.get('input[type="submit"]').should('be.disabled');
});
});
describe('Successful Submission', () => {
beforeEach(() => {
cy.visit('/Contact-form'); // Replace '/your-form-page' with the actual URL of your form page
});
it('should show correct response from server on successful submission', () => {
// Type valid input into the form fields
cy.get('input[name="name"]').type('John Doe');
cy.get('input[name="email"]').type('john@example.com');
cy.get('textarea[name="message"]').type('Test message');
// Submit the form
cy.get('input[type="submit"]').click();
cy.on('window:alert', (str) => {
expect(str).to.equal('Your form has been submitted 201')
})
});
});
\ No newline at end of file
// https://on.cypress.io/api
describe('My First Test', () => {
it('visits the app root url', () => {
cy.visit('/')
cy.contains('h1', 'You did it!')
})
})
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"]
},
"include": ["./**/*", "../support/**/*"]
}
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')
{
"forms": [
{
"name": "John",
"email": "john@um.edu",
"message": "This this",
"id": "69ad"
},
{
"name": "MeeMaw",
"email": "atle@ntnu.no",
"message": "Test test",
"id": "1518"
},
{
"id": "2520",
"name": "John meyer",
"email": "meemaaw@outlook.com",
"message": "hei"
},
{
"id": "bbdf",
"name": "John meyer",
"email": "ree@outlook.com",
"message": "hei"
},
{
"id": "421a",
"name": "John meyer",
"email": "ree@outlook.com",
"message": "hei"
},
{
"id": "0d3d",
"name": "John meyer",
"email": "ree@outlook.com",
"message": "hei"
},
{
"id": "735f",
"name": "John meyer",
"email": "ree@outlook.com",
"message": "hei"
},
{
"id": "bdcb",
"name": "John meyer",
"email": "ree@outlook.com",
"message": "hei"
},
{
"id": "7e56",
"name": "John meyer",
"email": "ree@outlook.com",
"message": "hei"
},
{
"id": "66d4",
"name": "John meyer",
"email": "ree@outlook.com",
"message": "hei"
},
{
"id": "ba32",
"name": "John meyer",
"email": "ree@outlook.com",
"message": "hei"
},
{
"id": "deac",
"name": "jane doe",
"email": "jane@doe.com",
"message": "test"
},
{
"id": "5b6c",
"name": "John Doe",
"email": "john@example.com",
"message": "Test message"
},
{
"id": "bc28",
"name": "John meyer",
"email": "ree@outlook.c",
"message": "meh"
},
{
"id": "1d70",
"name": "John Doe",
"email": "john@example.com",
"message": "Test message"
},
{
"id": "9744",
"name": "John meyer",
"email": "ree@outlook.c",
"message": "ihihibn"
},
{
"id": "1cc5",
"name": "John meyer",
"email": "ree@outl",
"message": "wetwg"
},
{
"id": "a501",
"name": "John meye",
"email": "ree@outl",
"message": "4"
},
{
"id": "97e5",
"name": "jane doe",
"email": "jane@doe.com",
"message": "test"
},
{
"id": "226f",
"name": "John Doe",
"email": "john@example.com",
"message": "Test message"
}
]
}
\ No newline at end of file
<!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.js"></script>
</body>
</html>
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist"]
}
This diff is collapsed.
{
"name": "vue-project",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"test:unit": "vitest",
"test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'",
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",
"format": "prettier --write src/",
"mockapi": "json-server -w data/dummydata.json"
},
"dependencies": {
"@vueuse/core": "^10.7.2",
"axios": "^1.6.7",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1",
"vue": "^3.3.11",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.3.3",
"@vitejs/plugin-vue": "^4.5.2",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/test-utils": "^2.4.3",
"cypress": "^13.6.1",
"eslint": "^8.49.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-vue": "^9.17.0",
"jsdom": "^23.0.1",
"json-server": "^1.0.0-alpha.23",
"prettier": "^3.0.3",
"start-server-and-test": "^2.0.3",
"vite": "^5.0.10",
"vitest": "^1.2.2"
}
}
public/favicon.ico

4.19 KiB

<script setup>
import { RouterView } from 'vue-router'
</script>
<template>
<RouterView />
</template>
/* color palette from <https://github.com/vuejs/theme> */
:root {
--vt-c-white: #ffffff;
--vt-c-white-soft: #f8f8f8;
--vt-c-white-mute: #f2f2f2;
--vt-c-black: #181818;
--vt-c-black-soft: #222222;
--vt-c-black-mute: #282828;
--vt-c-indigo: #2c3e50;
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
--vt-c-text-light-1: var(--vt-c-indigo);
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
--vt-c-text-dark-1: var(--vt-c-white);
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
}
/* semantic color variables for this project */
:root {
--color-background: var(--vt-c-white);
--color-background-soft: var(--vt-c-white-soft);
--color-background-mute: var(--vt-c-white-mute);
--color-border: var(--vt-c-divider-light-2);
--color-border-hover: var(--vt-c-divider-light-1);
--color-heading: var(--vt-c-text-light-1);
--color-text: var(--vt-c-text-light-1);
--section-gap: 160px;
}
@media (prefers-color-scheme: dark) {
:root {
--color-background: var(--vt-c-black);
--color-background-soft: var(--vt-c-black-soft);
--color-background-mute: var(--vt-c-black-mute);
--color-border: var(--vt-c-divider-dark-2);
--color-border-hover: var(--vt-c-divider-dark-1);
--color-heading: var(--vt-c-text-dark-1);
--color-text: var(--vt-c-text-dark-2);
}
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
font-weight: normal;
}
body {
min-height: 100vh;
color: var(--color-text);
background: var(--color-background);
transition:
color 0.5s,
background-color 0.5s;
line-height: 1.6;
font-family:
Inter,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Fira Sans',
'Droid Sans',
'Helvetica Neue',
sans-serif;
font-size: 15px;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment