# amiv Website This is the home of the amiv website. ## 🚀 Quick start 1. **Development** Navigate into the project directory, install all dependencies and run the development server using the following commands: ```shell yarn global add gatsby-cli yarn install gatsby develop ``` You can visit the website now at http://localhost:8000 2. **Development with Devcontainer (VSCode)** You can run the prepared development environment with docker and VSCode without the need to install anything project-specific on your system. Requirements: * *(Windows only)* [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/) * [Docker Engine](https://docs.docker.com/engine/install/) * [Visual Studio Code](https://code.visualstudio.com/)(VSCode) * [Remote Development Extension Pack for VSCode](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) Open the project directory with the prepared devcontainer by clicking the green button in the left button corner of the VSCode window and select `Remote-Containers: Open Folder in Container...`. On startup, `yarn install` is run automatically. You can start the gatsby development process with `gatsby develop`. You can visit the website now at http://localhost:8000 **IMPORTANT:** You also have to run the backend project on your machine! It is not possible to use an externally hosted backend. 3. **Linting & Formatting** We use `eslint` and `prettier` for linting and formatting of the javascript code. You can use the following commands: ```shell yarn run eslint yarn run format ``` 4. **Production Build** You can prepare a production build manually and serve it using gatsby's built-in webserver. This will run the server-side rendering part. It is very possible, that some things do not work correctly when ssr is used, so you should definitively test this one before deploying a new version! ```shell gatsby build gatsby serve ``` For more information about deployment, read the section about deployment below. ## 🧐 What's inside? A quick look at the most important files and directories of the project. ```ascii . ├── gatsby-browser.js ├── gatsby-config.js ├── gatsby-node.js ├── gatsby-ssr.js ├── config.development.js ├── config.production.js └── src ├── components ├── content ├── context ├── hooks ├── images ├── intl ├── pages ├── store ├── utils └── theme.js ``` 1. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://www.gatsbyjs.org/docs/browser-apis/). These allow customization/extension of default Gatsby settings affecting the browser. 2. **`gatsby-config.js`**: This is the main configuration file for the Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the [config docs](https://www.gatsbyjs.org/docs/gatsby-config/) for more detail). 3. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby Node APIs](https://www.gatsbyjs.org/docs/node-apis/). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. 4. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://www.gatsbyjs.org/docs/ssr-apis/). These allow customization of default Gatsby settings affecting server-side rendering. 5. **`config.development.js` / `config.production.js`**: This file contains configuration values used with our custom components and pages. 6. **`/src`**: This directory contains all source code. 1. **`/src/components`**: Contains all components used somewhere on the website. 2. **`/src/content`**: All content only files (e.g. board or teams portraits or static texts) 3. **`/src/context`**: Custom [React Context](https://reactjs.org/docs/context.html) 4. **`/src/hooks`**: Custom React hooks. 5. **`/src/images`**: Static images. 6. **`/src/intl`**: Translation files used by `react-intl`. 7. **`/src/pages`**: Every `js` file represents a page which path is exactly like the folder structure and filename. **Note**: Every file starting with an underscore (`_`) in the pages directory is ignored. Those pages are mostly being used for client-only routes. Therefore no page route is created and no server-side rendering performed. _Example: The file `/src/pages/amiv/about.js` will serve the component defined in that file as a page at the path `/amiv/about`._ 8. **`/src/store`**: This directory contains all files related to data handling using `react-redux`. 9. **`/src/utils`**: Collection of utility functions. 10. **`/src/theme.js`**: Theme definition for light/dark mode (dimensions, colors, etc.) ## 💫 Deployment TODO: Add information about the deployment process of the project. ## ⚙ Technologies ### Frontend Frameworks & Libraries - [Gatsby](https://www.gatsbyjs.org) - [React](https://reactjs.org/) - [react-intl](https://github.com/formatjs/react-intl) - [React-Redux](https://react-redux.js.org/) ### Backend - [AMIV API](https://github.com/amiv-eth/amivapi) ### Build Tools - [yarn](https://yarnpkg.com/) - [gatsby-cli](https://yarnpkg.com/package/gatsby-cli) ### Development Tools - [ESlint](https://github.com/eslint/eslint) - [Prettier](https://github.com/prettier/prettier) Most IDEs have plugins for those tools. VS Code is the recommended IDE.