Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO-ISSUE] updated all packages, fixed configs, updated documentation #575

Merged
merged 3 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# new variables in here, make sure that they're copied into the
# `.env.test`, with a sensible default.

BACKEND_BASE_URL=
BACKEND_BASE_URL=https://lbgg-backend-dev.fly.dev
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ sw.*
*.swp

# For buffet :)
ignore.*
ignore.*
8 changes: 6 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
/public
/.output

# file types
*.svg
*.md

# files
pnpm-lock.yaml
.gitkeep
*.svg
.gitignore
.npmrc
.nvmrc
.pnpmrc
.prettierignore
COPYING
COPYING
components.d.ts
12 changes: 10 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

We appreciate your help!

## Discord

- If you have any questions, comments, concerns that don't fit in GitHub please [direct them here!](https://discord.com/invite/TZvfau25Vb)

## Before filing an issue

If you are unsure whether you have found a bug, please consider asking in [our discord](https://discord.gg/TZvfau25Vb) first.
Expand Down Expand Up @@ -36,18 +40,22 @@ Filing issues is as simple as going to [the issue tracker](https://github.com/le

- Be inclusive, this is a project for everyone.
- Be descriptive, it can be hard to understand abbreviations or short-hand.
- prefer `catch(error)` over `catch(e)`
- Make sure that your components are _responsive_.
- Two major philosphies we adhere to are KISS (keep it super simple) and DRY (don't repeat yourself)
- In general try not to make your code too "clever" if it's possible to do it in a less "clever" way so that it's easily read by other contributors.

### Nuxt/Vue

- Comments should be full sentences, starting with a capital letter and ending with punctuation.
- Comments above a function should start with the name of the thing being described.
- Make sure any data and prop names are as descriptive as possible.
- Try to move any repetitive elements into child components to reduce clutter in parent components.
- Use `async await` for any asynchronous functions.
- Prefer usage of `async/await` for asynchronous functions.
- only use Promise syntax for needed more advanced Async programminng that either can't be done or is harder to be done with `async/await`
zysim marked this conversation as resolved.
Show resolved Hide resolved

- Include proper error handling for any `async` functions.
- Make all components compatible with server side rendering when possible.
- Make all components compatible with server side rendering where possible.

### Git

Expand Down
67 changes: 67 additions & 0 deletions FILESTRUCTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Vue File Structure
zysim marked this conversation as resolved.
Show resolved Hide resolved

You'll find our Vue files in `components` and `pages`. The files are structured in the order: template, script, and style. One thing to note; we want to keep any and all styling in `<style>`. This means that we try not to use Tailwind's classes directly in a file's `<template>`. Rather, we make a class name, and in the file's `<style>`, call `@apply` on top of any extra styling.

## Special Directories

You can create the following extra directories, some of which have special behaviors. Only `pages` is required; you can delete them if you don't want to use their functionality.

### `assets`

The assets directory contains your uncompiled assets such as Stylus or Sass files, images, or fonts.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/assets).

### `components`

The components directory contains your Vue.js components. Components make up the different parts of your page and can be reused and imported into your pages, layouts and even other components.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/components).

### `composables`

The composables directory contains your [Vue.js composables](https://vuejs.org/guide/reusability/composables.html).

More information about the usage of this directory in [the documentation](https://v3.nuxtjs.org/guide/directory-structure/composables).

### `i18n`

`i18n` (short for internationalizaion), is where we'll be storing our locales for translating this site into different languages.
zysim marked this conversation as resolved.
Show resolved Hide resolved

### `layouts`

Layouts are a great help when you want to change the look and feel of your Nuxt app, whether you want to include a sidebar or have distinct layouts for mobile and desktop.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/layouts).

### `lib`

This directory contains common files and utilities for the project. The subfolder `api` is extra special as the containing files are auto-generated with the `scripts/generate-api` script and `generate:api` package command (which calls that script).

### `pages`

This directory contains your application views and routes. Nuxt will read all the `*.vue` files inside this directory and setup Vue Router automatically.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/get-started/routing).

### `plugins`

The plugins directory contains JavaScript plugins that you want to run before instantiating the root Vue.js Application. This is the place to add Vue plugins and to inject functions or constants. Every time you need to use `Vue.use()`, you should create a file in `plugins/` and add its path to plugins in `nuxt.config.js`.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/plugins).

### `public`

This directory contains your static files. Each file inside this directory is mapped to `/`.

Example: `/public/robots.txt` is mapped as `/robots.txt`.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/static).

### `scripts`

This directory contains helpful scripts for the development of the project.

### `types`

This directory contains all the custom types for our use with Typescript.
96 changes: 20 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ User Profiles
Run Uploads (or external linking)
Board Customization and good management tools.

## Discord

- If you have any questions, comments, concerns that don't fit in GitHub please [direct them here!](https://discord.com/invite/TZvfau25Vb)

## Contributing

If you'd like to start contributing to the project please check [`CONTRIBUTING.md`](https://github.com/leaderboardsgg/leaderboard-site/blob/main/CONTRIBUTING.md) first to make sure things go as smoothly as possible!
Expand All @@ -25,104 +29,44 @@ If you'd like to start contributing to the project please check [`CONTRIBUTING.m
## Build Setup

- set node version with nvm
$ `nvm use`
- $ `nvm use`
(You may need to run `nvm install` first)

- install pnpm (Performant NPM)
$ `npm install -g pnpm`
- $ `npm install -g pnpm`

- install dependencies
$ `pnpm install`
- $ `pnpm install`

- run `nuxt generate`
$ `pnpm generate`
- $ `pnpm generate`

- run and connect to backend
$ Create a copy of `.env.example` named `.env` file with the `BACKEND_BASE_URL` set to the address of your backend.
$ You can download the backend project and run it locally [here](https://github.com/leaderboardsgg/leaderboard-backend)

- Create a copy of `.env.example` named `.env` file with the `BACKEND_BASE_URL` set to the address of the backend.
1. you can use `https://lbgg-backend-dev.fly.dev` as is in the `.env.example` file if you don't want to run the backend locally
2. You can download the backend project and run it locally [here](https://github.com/leaderboardsgg/leaderboard-backend)

- serve with hot reload at `localhost:3000`
$ `pnpm dev`
- $ `pnpm dev`

Look at the [nuxt 3 documentation](https://v3.nuxtjs.org) to learn more.

### Other commands you can use

- build for production and launch server
$ `pnpm build`
$ `pnpm preview`
- $ `pnpm build`
- $ `pnpm preview`

- generate static project
$ `pnpm generate`
- $ `pnpm generate`

Checkout the [deployment documentation](https://v3.nuxtjs.org/guide/deploy/presets) for more information.

## Development Environment

If you're using VSCode (which we highly reccomend) please install the 6 extensions that we have in our `extensions.json` file. This in the extensions section then shows you ESLint, Prettier, Vetur, NPM Intellisense, TailwindCSS IntelliSense, and PostCSS Language Support. This will allow you to have proper automatic Linting and Formatting with no extra setup!
If you're using VSCode (which we highly reccomend) please install the 6 extensions that we have in our `extensions.json` file. This in the extensions section then shows you ESLint, Prettier, Vetur, NPM Intellisense, TailwindCSS IntelliSense, PostCSS Language Support, etc. This will allow you to have proper automatic Linting, Formatting, and more with no extra setup!
zysim marked this conversation as resolved.
Show resolved Hide resolved

## Vue File Structure

You'll find our Vue files in `components` and `pages`. The files are structured in the order: template, script, and style. One thing to note; we want to keep any and all styling in `<style>`. This means that we try not to use Tailwind's classes directly in a file's `<template>`. Rather, we make a class name, and in the file's `<style>`, call `@apply` on top of any extra styling.

### Special Directories

You can create the following extra directories, some of which have special behaviors. Only `pages` is required; you can delete them if you don't want to use their functionality.

#### `assets`

The assets directory contains your uncompiled assets such as Stylus or Sass files, images, or fonts.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/assets).

#### `components`

The components directory contains your Vue.js components. Components make up the different parts of your page and can be reused and imported into your pages, layouts and even other components.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/components).

#### `composables`

The composables directory contains your [Vue.js composables](https://vuejs.org/guide/reusability/composables.html).

More information about the usage of this directory in [the documentation](https://v3.nuxtjs.org/guide/directory-structure/composables).

#### `i18n`

`i18n` (short for internationalizaion), is where we'll be storing our locales for translating this site into different languages.

#### `layouts`

Layouts are a great help when you want to change the look and feel of your Nuxt app, whether you want to include a sidebar or have distinct layouts for mobile and desktop.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/layouts).

#### `lib`

This directory contains common files and utilities for the project. The subfolder `api` is extra special as the containing files are auto-generated with the `scripts/generate-api` script and `generate:api` package command (which calls that script).

#### `pages`

This directory contains your application views and routes. Nuxt will read all the `*.vue` files inside this directory and setup Vue Router automatically.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/get-started/routing).

#### `plugins`

The plugins directory contains JavaScript plugins that you want to run before instantiating the root Vue.js Application. This is the place to add Vue plugins and to inject functions or constants. Every time you need to use `Vue.use()`, you should create a file in `plugins/` and add its path to plugins in `nuxt.config.js`.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/plugins).

#### `public`

This directory contains your static files. Each file inside this directory is mapped to `/`.

Example: `/public/robots.txt` is mapped as `/robots.txt`.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/static).

#### `scripts`

This directory contains helpful scripts for the development of the project.

#### `types`

This directory contains all the custom types for our use with Typescript.
Check out `FILESTRUCTURE.md` if you are unsure how things are laid out in this repository.
6 changes: 1 addition & 5 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'

export {}

declare module '@vue/runtime-core' {
declare module 'vue' {
export interface GlobalComponents {
ISvgClock: typeof import('~icons/svg/clock')['default']
ISvgClose: typeof import('~icons/svg/close')['default']
ISvgEyeHidden: typeof import('~icons/svg/eye-hidden')['default']
ISvgEyeVisible: typeof import('~icons/svg/eye-visible')['default']
ISvgGithub: typeof import('~icons/svg/github')['default']
ISvgGoogle: typeof import('~icons/svg/google')['default']
ISvgMenu: typeof import('~icons/svg/menu')['default']
ISvgSearch: typeof import('~icons/svg/search')['default']
RouterLink: typeof import('vue-router')['RouterLink']
Expand Down
22 changes: 22 additions & 0 deletions lib/api/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,26 @@ export class Account<
format: 'json',
...params,
})
/**
* No description
*
* @tags Account
* @name ConfirmCreate
* @summary Resends the account confirmation link.
* @request POST:/Account/confirm
* @secure
* @response `200` `void` A new confirmation link was generated.
* @response `400` `ProblemDetails` The request was malformed.
* @response `401` `ProblemDetails` The request doesn't contain a valid session token.
* @response `409` `ProblemDetails` The `User`'s account has already been confirmed.
* @response `429` `ProblemDetails` Too Many Requests
* @response `500` `void` The account recovery email failed to be created.
*/
confirmCreate = (params: RequestParams = {}) =>
this.request<void, ProblemDetails | void>({
path: `/Account/confirm`,
method: 'POST',
secure: true,
...params,
})
}
22 changes: 22 additions & 0 deletions lib/api/AccountRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,26 @@ export namespace Account {
export type RequestHeaders = {}
export type ResponseBody = LoginResponse
}

/**
* No description
* @tags Account
* @name ConfirmCreate
* @summary Resends the account confirmation link.
* @request POST:/Account/confirm
* @secure
* @response `200` `void` A new confirmation link was generated.
* @response `400` `ProblemDetails` The request was malformed.
* @response `401` `ProblemDetails` The request doesn't contain a valid session token.
* @response `409` `ProblemDetails` The `User`'s account has already been confirmed.
* @response `429` `ProblemDetails` Too Many Requests
* @response `500` `void` The account recovery email failed to be created.
*/
export namespace ConfirmCreate {
export type RequestParams = {}
export type RequestQuery = {}
export type RequestBody = never
export type RequestHeaders = {}
export type ResponseBody = void
}
}
4 changes: 2 additions & 2 deletions lib/api/RunsRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export namespace Runs {
/**
* The ID of the `Run` which should be retrieved.<br />
* It must be possible to parse this to `long` for this request to complete.
* @format uuid
* @pattern ^[a-zA-Z0-9-_]{22}$
*/
id: string
}
Expand Down Expand Up @@ -80,7 +80,7 @@ export namespace Runs {
*/
export namespace RunsCategoryDetail {
export type RequestParams = {
/** @format uuid */
/** @pattern ^[a-zA-Z0-9-_]{22}$ */
id: string
}
export type RequestQuery = {}
Expand Down
2 changes: 1 addition & 1 deletion lib/api/UsersRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export namespace Users {
export type RequestParams = {
/**
* The ID of the `User` which should be retrieved.
* @format uuid
* @pattern ^[a-zA-Z0-9-_]{22}$
*/
id: string
}
Expand Down
4 changes: 2 additions & 2 deletions lib/api/data-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export interface RunViewModel {
/**
* The unique identifier of the `Run`.<br />
* Generated on creation.
* @format uuid
* @pattern ^[a-zA-Z0-9-_]{22}$
*/
id: string
submittedAt: Instant
Expand All @@ -229,7 +229,7 @@ export interface UserViewModel {
/**
* The unique identifier of the `User`.<br />
* Generated on creation.
* @format uuid
* @pattern ^[a-zA-Z0-9-_]{22}$
*/
id: string
/**
Expand Down
Loading