# Web 2.0 Frontend

This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

* **[React](https://facebook.github.io/react/)** (17.x)
* **[Typescript](https://www.typescriptlang.org/)** (4.x)
* **[Next.js](https://nextjs.org/)** (12.x)
* **[Testcafe](https://devexpress.github.io/testcafe/)** - E2E Testing framework

## Installation


Install node v16 with **[Node Version Manager](https://github.com/nvm-sh/nvm#installing-and-updating)**.

Set up your SSH key authentication in GitLab Profile Settings. Then clone the repository and checkout the master branch:
```bash
git clone git@gitlab.com:sahkoinsinoorikilta/vtmk/web2.0-frontend.git
cd web2.0-frontend
git checkout master
```

Create local env file for development and install dependencies:
```bash
cp .env.local.example .env.local
npm install
```

## Getting Started

### Development

Run the dev-server:

```bash
npm start
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the website by modifying source files. The page auto-updates as you edit the file.

### Production

```bash
npm run build
npm run start-prod
```

* Build app once (HMR disabled)
* App served @ `http://localhost:80`

---

### All commands

Command | Description
--- | ---
`npm run dev` | Build app continously (HMR enabled) and serve @ `http://localhost:3000`
`npm run start` | (alias of `npm run dev`)
`npm run build` | Build app to `/.next/`
`npm run start-prod` | Serve built app (HMR disabled) @ `http://localhost:80`
`npm run test` | Run e2e tests verbose with Chrome
`npm run test:e2e` | Run end-to-end tests with Headless Chrome
`npm run lint` | Run Typescript and CSS linter
`npm run lint:es` | Run Typescript linter (ESLint)
`npm run lint:css` | Run Stylelint (CSS linter)

## Learn More

To learn more about Next.js, take a look at the following resources:

* [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
* [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Copyright

Aalto-yliopiston Sähköinsinöörikilta ry
