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

init: Repo for Codecharacter Frontend 2024 #1

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
<h1 align="center">CodeCharacter Web 2023</h1>
<p align="center">Monorepo for the web app, renderer and map designer of CodeCharacter 2023</p>
<h1 align="center">CodeCharacter Web 2024</h1>
<p align="center">Monorepo for the web app, renderer and map designer of CodeCharacter 2024</p>

<p align="center">
<a href="https://github.com/delta/codecharacter-web-2023/actions/workflows/ci.yml">
<img src="https://github.com/delta/codecharacter-web-2023/actions/workflows/ci.yml/badge.svg"/>
<a href="https://github.com/delta/codecharacter-frontend/actions/workflows/ci.yml">
<img src="https://github.com/delta/codecharacter-frontend/actions/workflows/ci.yml/badge.svg"/>
</a>
<a href="https://github.com/delta/codecharacter-web-2023/actions/workflows/docs.yml">
<img src="https://github.com/delta/codecharacter-web-2023/actions/workflows/docs.yml/badge.svg"/>
<a href="https://github.com/delta/codecharacter-frontend/actions/workflows/docs.yml">
<img src="https://github.com/delta/codecharacter-frontend/actions/workflows/docs.yml/badge.svg"/>
</a>
<a href="https://codecov.io/gh/delta/codecharacter-web-2023">
<img src="https://codecov.io/gh/delta/codecharacter-web-2023/branch/main/graph/badge.svg?token=T4A45WWCWM"/>
<a href="https://codecov.io/gh/delta/codecharacter-frontend">
<img src="https://codecov.io/gh/delta/codecharacter-frontend/branch/main/graph/badge.svg?token=T4A45WWCWM"/>
</a>
<br>
<img src=https://img.shields.io/github/deployments/delta/codecharacter-web-2023/Production?label=vercel&logo=vercel">
<img src=https://img.shields.io/github/deployments/delta/codecharacter-frontend/Production?label=vercel&logo=vercel">
</p>

## Setup

1. Configurations

```
cp config/config.example.ts config/config.ts
```

3. Default codes

```
git submodule update --init
```

## Scripts

(To be run with `yarn` prefix)
Expand All @@ -27,6 +41,14 @@
- `lint` runs the linter for the project
- `format` runs the formatter for the project

## Docker

```
docker compose up
```

Container will be running on port **3000**

## Documentation and preview deployments

Check out [here](https://delta.github.io/codecharacter-web-2023/).
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.8'
version: '3.9'

services:
web:
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CodeCharacter Web 2023
# CodeCharacter Web 2024

### Code Generation Process

Expand Down
2 changes: 1 addition & 1 deletion docs/spec/generator-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ typescriptThreePlus: true
useSingleRequestParameter: false
withInterfaces: true
withoutRuntimeChecks: true
npmName: '@codecharacter-2023/client'
npmName: '@codecharacter-2024/client'
npmVersion: '2023.0.0'
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codecharacter-2023/web",
"description": "The web frontend of CodeCharacter 2023",
"name": "@codecharacter-2024/web",
"description": "The web frontend of CodeCharacter 2024",
"license": "MIT",
"author": "Delta Force",
"version": "2023.0.0",
Expand All @@ -10,21 +10,21 @@
"scripts": {
"lint": "eslint --ext .ts,.tsx . --ignore-path .gitignore && prettier \"**/*.{ts,tsx,js,json,yml,md}\" --check --ignore-path .gitignore",
"format": "eslint --ext .ts,.tsx . --fix --ignore-path .gitignore && prettier \"**/*.{ts,tsx,js,json,yml,md}\" --write --ignore-path .gitignore",
"compile": "yarn workspace @codecharacter-2023/client run tsc && yarn workspace @codecharacter-2023/renderer run tsc && yarn workspace @codecharacter-2023/map-designer run tsc && tsc",
"compile": "yarn workspace @codecharacter-2024/client run tsc && yarn workspace @codecharacter-2024/renderer run tsc && yarn workspace @codecharacter-2024/map-designer run tsc && tsc",
"test": "jest --coverage",
"dev": "concurrently -k -r \"yarn workspace @codecharacter-2023/client build:watch\" \"yarn workspace @codecharacter-2023/renderer build:watch\" \"yarn workspace @codecharacter-2023/map-designer build:watch\" \"sleep 10 && vite --config vite.dev.config.ts\"",
"build": "yarn workspace @codecharacter-2023/client run build && yarn workspace @codecharacter-2023/renderer run build && yarn workspace @codecharacter-2023/map-designer run build && vite build --config vite.prod.config.ts --emptyOutDir",
"prod": "concurrently -k -r \"sleep 5 && vite build --watch --config vite.prod.config.ts --emptyOutDir\" \"sleep 10 && live-server --host=0.0.0.0 --middleware=spa-ignore-assets dist/\" \"yarn workspace @codecharacter-2023/client build:watch\" \"yarn workspace @codecharacter-2023/renderer build:watch\" \"yarn workspace @codecharacter-2023/map-designer build:watch\"",
"renderer:demo": "yarn workspace @codecharacter-2023/renderer run dev",
"map-designer:demo": "yarn workspace @codecharacter-2023/map-designer run dev",
"dev": "concurrently -k -r \"yarn workspace @codecharacter-2024/client build:watch\" \"yarn workspace @codecharacter-2024/renderer build:watch\" \"yarn workspace @codecharacter-2024/map-designer build:watch\" \"sleep 10 && vite --config vite.dev.config.ts\"",
"build": "yarn workspace @codecharacter-2024/client run build && yarn workspace @codecharacter-2024/renderer run build && yarn workspace @codecharacter-2024/map-designer run build && vite build --config vite.prod.config.ts --emptyOutDir",
"prod": "concurrently -k -r \"sleep 5 && vite build --watch --config vite.prod.config.ts --emptyOutDir\" \"sleep 10 && live-server --host=0.0.0.0 --middleware=spa-ignore-assets dist/\" \"yarn workspace @codecharacter-2024/client build:watch\" \"yarn workspace @codecharacter-2024/renderer build:watch\" \"yarn workspace @codecharacter-2024/map-designer build:watch\"",
"renderer:demo": "yarn workspace @codecharacter-2024/renderer run dev",
"map-designer:demo": "yarn workspace @codecharacter-2024/map-designer run dev",
"storybook": "start-storybook -p 6006",
"storybook:build": "build-storybook",
"postinstall": "husky install"
},
"dependencies": {
"@codecharacter-2023/client": "workspace:packages/client",
"@codecharacter-2023/map-designer": "workspace:packages/map-designer",
"@codecharacter-2023/renderer": "workspace:packages/renderer",
"@codecharacter-2024/client": "workspace:packages/client",
"@codecharacter-2024/map-designer": "workspace:packages/map-designer",
"@codecharacter-2024/renderer": "workspace:packages/renderer",
"@custom-elements-manifest/analyzer": "^0.6.6",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@codecharacter-2023/client",
"name": "@codecharacter-2024/client",
"version": "2023.0.0",
"description": "OpenAPI client for CodeCharacter 2023",
"description": "OpenAPI client for CodeCharacter 2024",
"author": "Delta Force",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
Expand Down
10 changes: 5 additions & 5 deletions packages/map-designer/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@codecharacter-2023/map-designer",
"description": "Webcomponent for CodeCharacter Map Designer 2023",
"name": "@codecharacter-2024/map-designer",
"description": "Webcomponent for CodeCharacter Map Designer 2024",
"license": "MIT",
"author": "Delta Force",
"version": "2023.0.0",
"main": "./dist/codecharacter-map-designer-2023.es.js",
"module": "./dist/codecharacter-map-designer-2023.es.js",
"main": "./dist/codecharacter-map-designer-2024.es.js",
"module": "./dist/codecharacter-map-designer-2024.es.js",
"types": "./dist/src/index.d.ts",
"files": [
"dist"
],
"exports": {
".": {
"import": "./dist/codecharacter-map-designer-2023.es.js"
"import": "./dist/codecharacter-map-designer-2024.es.js"
}
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/map-designer/vite.dev.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export default defineConfig({
},
build: {
lib: {
name: 'codecharacter-map-designer-2023',
name: 'codecharacter-map-designer-2024',
entry: path.resolve(__dirname, 'src/index.ts'),
fileName: 'codecharacter-map-designer-2023',
fileName: 'codecharacter-map-designer-2024',
},
rollupOptions: {
external: ['phaser', 'lit'],
Expand Down
4 changes: 2 additions & 2 deletions packages/map-designer/vite.prod.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export default defineConfig({
build: {
lib: {
formats: ['es'],
name: 'codecharacter-map-designer-2023',
name: 'codecharacter-map-designer-2024',
entry: path.resolve(__dirname, 'src/index.ts'),
fileName: 'codecharacter-map-designer-2023',
fileName: 'codecharacter-map-designer-2024',
},
rollupOptions: {
external: ['phaser', 'lit', 'react'],
Expand Down
10 changes: 5 additions & 5 deletions packages/renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@codecharacter-2023/renderer",
"description": "Webcomponent for CodeCharacter Renderer 2023",
"name": "@codecharacter-2024/renderer",
"description": "Webcomponent for CodeCharacter Renderer 2024",
"license": "MIT",
"author": "Delta Force",
"version": "2023.0.0",
"main": "./dist/codecharacter-renderer-2023.es.js",
"module": "./dist/codecharacter-renderer-2023.es.js",
"main": "./dist/codecharacter-renderer-2024.es.js",
"module": "./dist/codecharacter-renderer-2024.es.js",
"types": "./dist/src/index.d.ts",
"files": [
"dist"
],
"exports": {
".": {
"import": "./dist/codecharacter-renderer-2023.es.js"
"import": "./dist/codecharacter-renderer-2024.es.js"
}
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/renderer/vite.dev.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export default defineConfig({
},
build: {
lib: {
name: 'codecharacter-renderer-2023',
name: 'codecharacter-renderer-2024',
entry: path.resolve(__dirname, 'src/index.ts'),
fileName: 'codecharacter-renderer-2023',
fileName: 'codecharacter-renderer-2024',
},
rollupOptions: {
external: ['phaser', 'lit', 'react'],
Expand Down
4 changes: 2 additions & 2 deletions packages/renderer/vite.prod.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export default defineConfig({
build: {
lib: {
formats: ['es'],
name: 'codecharacter-renderer-2023',
name: 'codecharacter-renderer-2024',
entry: path.resolve(__dirname, 'src/index.ts'),
fileName: 'codecharacter-renderer-2023',
fileName: 'codecharacter-renderer-2024',
},
rollupOptions: {
external: ['phaser', 'lit', 'react'],
Expand Down
2 changes: 1 addition & 1 deletion src/api/ApiConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AuthApi, Configuration } from '@codecharacter-2023/client';
import { AuthApi, Configuration } from '@codecharacter-2024/client';
import { BASE_PATH, PREFER_DEV_OVERRIDE, homeUrl } from '../config/config';
export class ApiError extends Error {
status: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import styles from './forgetpassword.module.css';
import { AuthApi } from '@codecharacter-2023/client';
import { AuthApi } from '@codecharacter-2024/client';
import { ApiError, authConfig } from '../../../../../api/ApiConfig';
import { toast } from 'react-hot-toast';
import { Modal } from 'react-bootstrap';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import styles from '../../auth.module.css';
import { ApiError, authConfig } from '../../../../../api/ApiConfig';
import { AuthApi } from '@codecharacter-2023/client';
import { AuthApi } from '@codecharacter-2024/client';
import { useNavigate, useLocation } from 'react-router-dom';
import Toast, { toast } from 'react-hot-toast';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IconProp } from '@fortawesome/fontawesome-svg-core';
import styles from '../../../Auth/Login/IncompleteProfile/incompleteProfile.module.css';
import OtherDetails from '../../Register/FormDetails/OtherDetails';
import { useState } from 'react';
import { CurrentUserApi } from '@codecharacter-2023/client';
import { CurrentUserApi } from '@codecharacter-2024/client';
import { apiConfig, ApiError } from '../../../../../api/ApiConfig';
import { useNavigate } from 'react-router-dom';
import { useAppDispatch } from '../../../../../store/hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserApi } from '@codecharacter-2023/client';
import { UserApi } from '@codecharacter-2024/client';
import { Card } from 'react-bootstrap';
import { useLocation, useNavigate } from 'react-router-dom';
import { useState, useEffect } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/components/BattleTV/BattleTV.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
Match,
MatchMode,
Verdict,
} from '@codecharacter-2023/client';
} from '@codecharacter-2024/client';
import { User, user } from '../../store/User/UserSlice';
import {
changePageState,
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommitHistory/CodeMapViewbox/CodeView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodeRevision } from '@codecharacter-2023/client';
import { CodeRevision } from '@codecharacter-2024/client';
import { CodeBlock, irBlack } from 'react-code-blocks';
type PropsType = {
code: CodeRevision['code'];
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommitHistory/CodeMapViewbox/MapView.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
MapDesignerComponent,
MapDesignerUtils,
} from '@codecharacter-2023/map-designer';
} from '@codecharacter-2024/map-designer';

interface MapViewBoxProps {
mapCoordinates: Array<Array<number>>;
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommitHistory/CommitTree/CommitHistroy.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodeRevision, GameMapRevision } from '@codecharacter-2023/client';
import { CodeRevision, GameMapRevision } from '@codecharacter-2024/client';
import { useState } from 'react';
import {
VerticalTimeline,
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommitHistory/HistoryMain/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
CurrentUserApi,
GameMapRevision,
MapApi,
} from '@codecharacter-2023/client';
} from '@codecharacter-2024/client';
import {
MapObj,
changeHistoryEditorMap,
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommitModal/CommitModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodeApi, Language } from '@codecharacter-2023/client';
import { CodeApi, Language } from '@codecharacter-2024/client';
import React, { useState } from 'react';
import { Button, Form, Modal, Row } from 'react-bootstrap';
import { apiConfig, ApiError } from '../../api/ApiConfig';
Expand Down
2 changes: 1 addition & 1 deletion src/components/DashboardOptions/DashboardOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styles from './DashboardOptions.module.css';
import DropdownToggle from 'react-bootstrap/esm/DropdownToggle';
import { ButtonGroup } from 'react-bootstrap';
import { apiConfig, ApiError } from '../../api/ApiConfig';
import { CurrentUserApi } from '@codecharacter-2023/client';
import { CurrentUserApi } from '@codecharacter-2024/client';
import Toast from 'react-hot-toast';
import { useAppDispatch } from '../../store/hooks';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Leaderboard/DailyLeaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getAvatarByID } from '../Avatar/Avatar';
import {
DailyChallengeLeaderBoardResponse,
DailyChallengesApi,
} from '@codecharacter-2023/client';
} from '@codecharacter-2024/client';
import { apiConfig, ApiError } from '../../api/ApiConfig';
import Loader from '../Loader/Loader';
import Toast from 'react-hot-toast';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Leaderboard/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
LeaderboardEntry,
MatchMode,
TierType,
} from '@codecharacter-2023/client';
} from '@codecharacter-2024/client';
import { apiConfig, ApiError } from '../../api/ApiConfig';
import Loader from '../Loader/Loader';
import swordImage from '../../assets/sword.png';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Leaderboard/MainLeaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
import DailyChallengeLeaderboard from './DailyLeaderboard';
import Leaderboard from './Leaderboard';
import styles from './Leaderboard.module.css';
import { CurrentUserApi } from '@codecharacter-2023/client';
import { CurrentUserApi } from '@codecharacter-2024/client';
import { useTour } from '@reactour/tour';
import { apiConfig } from '../../api/ApiConfig';
import { dcEnable } from '../../config/config';
Expand Down
4 changes: 2 additions & 2 deletions src/components/MapDesigner/MapDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { useEffect, useState } from 'react';
import {
MapDesignerComponent,
MapDesignerUtils,
} from '@codecharacter-2023/map-designer';
} from '@codecharacter-2024/map-designer';
import {
MapApi,
DailyChallengesApi,
CurrentUserApi,
} from '@codecharacter-2023/client';
} from '@codecharacter-2024/client';
import Toast from 'react-hot-toast';
import styles from './MapDesigner.module.css';
import { apiConfig, ApiError } from '../../api/ApiConfig';
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
loading,
} from '../../store/User/UserSlice';
import { useAppDispatch, useAppSelector } from '../../store/hooks';
import { AuthApi } from '@codecharacter-2023/client';
import { AuthApi } from '@codecharacter-2024/client';
import { apiConfig, ApiError } from '../../api/ApiConfig';
import Toast from 'react-hot-toast';
import DashboardOptions from '../DashboardOptions/DashboardOptions';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Notifs/Notifs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useRef } from 'react';
import { useAppDispatch, useAppSelector } from '../../store/hooks';
import { Notification } from '@codecharacter-2023/client';
import { Notification } from '@codecharacter-2024/client';
import styles from './Notifs.module.css';
import notifIcon from '../../assets/notification.svg';

Expand Down
2 changes: 1 addition & 1 deletion src/components/RatingChart/RatingChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
CurrentUserApi,
RatingHistory,
UserApi,
} from '@codecharacter-2023/client';
} from '@codecharacter-2024/client';
import { apiConfig, ApiError } from '../../api/ApiConfig';
import Toast from 'react-hot-toast';

Expand Down
2 changes: 1 addition & 1 deletion src/components/SelfMatchMakingModal/SelfMatchMakeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
MapApi,
MatchApi,
MatchMode,
} from '@codecharacter-2023/client';
} from '@codecharacter-2024/client';
import Toast from 'react-hot-toast';

const selfMatchModal = (): JSX.Element => {
Expand Down
Loading
Loading