Skip to content

Commit

Permalink
Feat: project init
Browse files Browse the repository at this point in the history
  • Loading branch information
Akalanka47000 committed Aug 6, 2023
1 parent fe51f3e commit 5272815
Show file tree
Hide file tree
Showing 66 changed files with 4,511 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"env": {
"browser": true,
"es2022": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"settings": {
"react": {
"version": "18.2"
}
},
"plugins": ["react-refresh"],
"rules": {
"react-hooks/exhaustive-deps": "off",
"react-refresh/only-export-components": "off",
"react/prop-types": "off"
},
"overrides": [
{
"files": ["*.mdx"],
"rules": {
"react/no-unescaped-entities": "off"
}
}
]
}
23 changes: 23 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: build
description: Base build action for the project
runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.0.0

- name: Install Node.js 18 and setup dependency caching
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --ignore-scripts --fix-lockfile
shell: bash

- name: Build changes
run: pnpm build
shell: bash
26 changes: 26 additions & 0 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build PR preview

on:
pull_request:
types:
- opened
- reopened
- synchronize

concurrency:
group: preview-${{ github.ref }}
cancel-in-progress: true

jobs:
build-preview:
name: Build preview
runs-on: ubuntu-latest
steps:
- name: Checkout repository 🛎️
uses: actions/checkout@v3

- name: Build 🏗️
uses: ./.github/actions/build

- name: Upload build files 📤
uses: sliit-foss/actions/preview-deployments/postbuild@main
21 changes: 21 additions & 0 deletions .github/workflows/preview-clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Clean PR preview

on:
workflow_run:
workflows: ['Close PR']
types:
- completed

jobs:
close-preview:
name: Close PR preview
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout repository 🛎️
uses: actions/checkout@v3

- name: Clean preview 🧹
uses: sliit-foss/actions/preview-deployments/clean@main
14 changes: 14 additions & 0 deletions .github/workflows/preview-close-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Close PR

on:
pull_request:
types:
- closed

jobs:
send-pr-number-to-clean:
name: Record PR number to clean
runs-on: ubuntu-latest
steps:
- name: Upload PR number 📤
uses: sliit-foss/actions/preview-deployments/upload-pr-number@main
24 changes: 24 additions & 0 deletions .github/workflows/preview-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy PR preview

on:
workflow_run:
workflows:
- Build PR preview
types:
- completed

jobs:
deploy-preview:
name: Deploy preview
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout repository 🛎️
uses: actions/checkout@v3

- name: Deploy preview 🚀
uses: sliit-foss/actions/preview-deployments/deploy@main
with:
site_domain: fcsc.sliitfoss.org
26 changes: 26 additions & 0 deletions .github/workflows/prod-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI deploy

on:
push:
branches:
- main
jobs:
deploy-production:
name: Deploy to production
runs-on: ubuntu-latest
steps:
- name: Checkout repository 🛎️
uses: actions/checkout@v3

- name: Build 🏗️
uses: ./.github/actions/build

- name: Fix 404 on page reload 🚧
uses: sliit-foss/actions/preview-deployments/404@main

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./dist/
branch: gh-pages
clean-exclude: preview
41 changes: 41 additions & 0 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Quality Checks

on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize

jobs:
commitlint:
name: Commitlint
runs-on: ubuntu-latest
steps:
- name: Checkout repository 🛎️
uses: actions/checkout@v3

- name: Run commitlint 🟩
uses: sliit-foss/actions/quality-checks/commitlint@main

lint:
name: Enforce ESLint rules
runs-on: ubuntu-latest
steps:
- name: Checkout repository 🛎️
uses: actions/checkout@v3

- name: Run linter 📢
uses: sliit-foss/actions/quality-checks/linter@main

format:
name: Format code
runs-on: ubuntu-latest
steps:
- name: Checkout repository 🛎️
uses: actions/checkout@v3

- name: Run formatter 🧹
uses: sliit-foss/actions/quality-checks/formatter@main
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# npm and yarn lock files
package-lock.json
yarn.lock

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*azurite*

.eslintcache
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
out
26 changes: 26 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"printWidth": 120,
"trailingComma": "none",
"quoteProps": "consistent",
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrder": [
"^(react/(.*)$)|^(react$)",
"^(.*react-*(.*)$)",
"^(.*redux-*(.*)$)",
"^(aos$)|^(framer-motion$)|^(lodash$)",
"^(@mdx-js$)|^(moment$)",
"^(tailwind*)",
"<THIRD_PARTY_MODULES>",
"^assets/(.*)$",
"^components/(.*)$",
"^config/(.*)$",
"^icons/(.*)$",
"^pages/(.*)$",
"^store/(.*)$",
"^styles/(.*)$",
"^utils/(.*)$",
"^[./]"
],
"importOrderSeparation": false,
"importOrderSortSpecifiers": true
}
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<br/>

<p align="center">
<img src="https://github.com/sliit-foss/fcsc-web-remastered/assets/73662613/84c97721-1300-4934-95df-b4eb693da1f9" width="244" height="97" alt="FCSC Logo"/>

</p>

<div id="user-content-toc" align="center">
<ul>
<summary><h1 style="display: inline-block;">SLIIT FCSC</h1></summary>
</ul>
</div>

<p align="center">
<a aria-label="SLIIT FOSS logo" href="https://sliitfoss.org">
<img src="https://img.shields.io/badge/Made_by_the_SLIIT_FOSS_Community-blue">
</a>
<a aria-label="License" href="https://github.com/sliit-foss/fcsc-web-remastered/blob/main/LICENSE">
<img alt="" src="https://img.shields.io/badge/License-MIT-yellow.svg">
</a>
<a aria-label="CI Deploy" href="https://github.com/sliit-foss/fcsc-web-remastered/actions/workflows/prod-deploy.yml">
<img alt="" src="https://github.com/sliit-foss/fcsc-web-remastered/actions/workflows/prod-deploy.yml/badge.svg">
</a>
</p>

<br/>

The official website of the Faculty of Computing Student Community also known as the FCSC which is the largest student body of the Faculty of Computing in SLIIT.

## Contributing

## [Figma](https://www.figma.com/proto/kQIZ5VQGf8DfOIXpDWSg3Z/FCSC-Web---New?node-id=93-392&scaling=min-zoom&page-id=0%3A1)

## Getting started

- Run `pnpm install` to install all dependencies
- Run `pnpm dev` to start the development server

## Commit messages

- We follow conventional commits during our development workflow as a good practice. More information can be found at their official [documentation](https://www.conventionalcommits.org/en/v1.0.0-beta.4/#examples)
- Refer the [commitlint.config.js](https://github.com/sliit-foss/fcsc-web-remastered/blob/main/commitlint.config.cjs) file for a full list of supported commit message prefixes

## Additional tools

- This project is bootstrapped with [Lefthook](https://evilmartians.com/opensource/lefthook), [Eslint](https://eslint.org/) and [Prettier](https://prettier.io/). Please make good use of them.

<br/>
13 changes: 13 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [
2,
"always",
["Feat!", "Feat", "Fix", "Patch", "Chore", "Build", "Debug", "Refactor", "Revert", "CI", "Test", "Docs", "WIP"]
],
"type-case": [0],
"subject-case": [0],
"footer-max-line-length": [0],
}
};
31 changes: 31 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="./public/assets/icons/favicon.png"/>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" as="style" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="The official website of the Faculty of Computing Student Community also known as the FCSC which is the largest student body of the Faculty of Computing in SLIIT" />
<meta property="og:title" content="SLIIT FCSC" />
<meta property="og:description" content="The official website of the Faculty of Computing Student Community also known as the FCSC which is the largest student body of the Faculty of Computing in SLIIT" />
<meta property="og:image" content="https://fcsc.sliitfoss.org/assets/icons/favicon.svg" />
<meta property="og:image:width" content="64" />
<meta property="og:image:height" content="64" />
<meta property="og:image:alt" content="FCSC Logo" />
<meta property="og:url" content="https://fcsc.sliitfoss.org" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="SLIIT FCSC" />
<meta property="og:locale" content="en_US" />
<title>SLIIT FCSC</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>

</html>
8 changes: 8 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"baseUrl": "./src",
"paths": {
"@/*": ["*"]
}
}
}
Loading

0 comments on commit 5272815

Please sign in to comment.