Skip to content

Commit

Permalink
Initial commit version of FE Web App
Browse files Browse the repository at this point in the history
  • Loading branch information
antoninkriz committed Aug 24, 2023
1 parent 67a9cb0 commit 917fef0
Show file tree
Hide file tree
Showing 18 changed files with 4,392 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci-python
name: CI for Python

on:
push:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/ci-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI for Web

on:
push:
branches:
- main
pull_request:
branches:
- "**"

jobs:
lint:
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 'lts/latest'
cache: 'yarn'

- name: Install packages
working-directory: ctu-timetable-generator
run: |
yarn install --pure-lockfile
- name: Lint
working-directory: ctu-timetable-generator
run: |
yarn run lint
43 changes: 43 additions & 0 deletions .github/workflows/deploy-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy to Github Pages

on:
push:
branches:
- 'main'

jobs:
deployment:
runs-on: ubuntu-22.04
strategy:
fail-fast: true

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 'lts/latest'
cache: 'yarn'

- name: Install packages
working-directory: ctu-timetable-generator
run: |
yarn install --pure-lockfile
- name: Lint
working-directory: ctu-timetable-generator
run: |
yarn run lint
- name: Build
working-directory: ctu-timetable-generator
run: |
yarn run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./ctu-timetable-generator/out
11 changes: 8 additions & 3 deletions .github/workflows/fetch-data.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: fetch-data
name: Data downloader

on:
workflow_dispatch:
schedule:
- cron: '0 7 * * *'
- cron: '0 9 * * *'
- cron: '0 11 * * *'
- cron: '30 14 * * *'
- cron: '0 18 * * *'
- cron: '0 13 * * *'
- cron: '0 15 * * *'
- cron: '0 17 * * *'
- cron: '0 19 * * *'
- cron: '0 21 * * *'

jobs:
fetch-data:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ __pycache__/
.mypy_cache
.venv
.env
node_modules/
.idea
.vscode
out/
1 change: 1 addition & 0 deletions ctu-timetable-generator/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
last 2 major versions and last 1 years and >0.1% and not dead and not op_mini all
5 changes: 5 additions & 0 deletions ctu-timetable-generator/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea/
node_modules/
coverage/
.next/
out/
46 changes: 46 additions & 0 deletions ctu-timetable-generator/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"extends": [
"next/core-web-vitals",
"prettier",
"airbnb",
"airbnb/hooks",
"airbnb-typescript"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@next/next/no-img-element": "off",
"@typescript-eslint/no-loss-of-precision": "off",
"max-len": [
"error",
160,
2,
{
"ignoreUrls": true,
"ignoreComments": false,
"ignoreRegExpLiterals": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}
],
"no-nested-ternary": "off",
"no-bitwise": "off",
"no-plusplus": "off",
"no-restricted-syntax": [
"error",
"ForInStatement",
"LabeledStatement",
"WithStatement"
],
"react/jsx-no-useless-fragment": "off",
"react/jsx-props-no-spreading": "off",
"react/react-in-jsx-scope": "off",
"react/require-default-props": "off",
"react/jsx-one-expression-per-line": "off"
}
}
35 changes: 35 additions & 0 deletions ctu-timetable-generator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
5 changes: 5 additions & 0 deletions ctu-timetable-generator/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea/
node_modules/
coverage/
.next/
out/
20 changes: 20 additions & 0 deletions ctu-timetable-generator/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": false,
"embeddedLanguageFormatting": "auto",
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 160,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
34 changes: 34 additions & 0 deletions ctu-timetable-generator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

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

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## 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!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
34 changes: 34 additions & 0 deletions ctu-timetable-generator/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// @ts-check

import { PHASE_DEVELOPMENT_SERVER, PHASE_TEST } from 'next/constants.js';
import bundleAnalyzer from '@next/bundle-analyzer';

export default (/** @type {string} */ phase) => {
const isDev = phase === PHASE_DEVELOPMENT_SERVER || phase === PHASE_TEST;

// eslint-disable-next-line import/no-extraneous-dependencies
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});

/** @type {import('next').NextConfig} */
return withBundleAnalyzer({
images: {
unoptimized: true,
},
compiler: {
styledComponents: {
displayName: isDev,
ssr: true,
fileName: isDev,
minify: true,
transpileTemplateLiterals: true,
pure: true,
cssProp: false,
},
},
output: 'export',
reactStrictMode: true,
swcMinify: !isDev,
});
};
45 changes: 45 additions & 0 deletions ctu-timetable-generator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "ctu-timetable-generator",
"version": "0.1.0",
"private": true,
"author": "Antonin Kriz (antoninkriz.eu)",
"homepage": "https://github.com/antoninkriz/CTU-TimeTable-Generator",
"description": "CTU TimeTable Generator Web App",
"keywords": [
"timetable",
"schedule",
"university",
"website",
"CVUT",
"CTU"
],
"scripts": {
"dev": "rm -rf .next && next dev",
"build-analyze": "ANALYZE=true yarn build",
"build": "NODE_ENV=production next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "13.4.19",
"react": "18.2.0",
"react-dom": "18.2.0",
"styled-components": "^6.0.7"
},
"devDependencies": {
"@next/bundle-analyzer": "^13.4.12",
"@types/node": "20.5.4",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"eslint": "8.47.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-next": "13.4.19",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.1",
"typescript": "^5.1.6"
}
}
18 changes: 18 additions & 0 deletions ctu-timetable-generator/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: 'CTU TimeTable Generator',
description: 'Najdi svůj optimální rozvrh bez složitého hledání vhodných paralelek, přednášek, cvičení a předmětů.',
};

export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="cs">
<body>{children}</body>
</html>
);
}
8 changes: 8 additions & 0 deletions ctu-timetable-generator/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default function Home() {
return (
<main>
<h1>CTU TimeTable Generator</h1>
<p>Ve vývoji - sleduj na GitHubu <a href="https://github.com/antoninkriz/CTU-TimeTable-Generator">antoninkriz/CTU-TimeTable-Generator</a></p>
</main>
);
}
Loading

0 comments on commit 917fef0

Please sign in to comment.