Skip to content

Commit

Permalink
chore: Add prettier and basic CI checks for code quality (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJustChew authored Aug 13, 2024
2 parents fed7536 + 3d98120 commit 3a9e680
Show file tree
Hide file tree
Showing 344 changed files with 65,036 additions and 15,555 deletions.
7 changes: 6 additions & 1 deletion .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ CALENDAR_API_KEY=<google calendar api key>
NTHU_HEADLESS_AIS_SIGNING_KEY=<generate a 32-byte key>
GITHUB_APP_PRIVATE_KEY=YOUR_GITHUB_APP_PRIVATE_KEY
NTHU_HEADLESS_AIS_ENCRYPTION_KEY=<generate a 32-byte key>
CLOUDFLARE_KV_API_TOKEN=YOUR_CLOUDFLARE_KV_API_TOKEN
CLOUDFLARE_KV_API_TOKEN=YOUR_CLOUDFLARE_KV_API_TOKEN
DONER_STUDENTID=YOUR_DONER_STUDENTID
DONER_PASSWORD=YOUR_DONER_PASSWORD
FIREBASE_SERVICE_ACCOUNT=YOUR_FIREBASE_SERVICE_ACCOUNT
CRON_SECRET=YOUR_CRON_SECRET
ALGOLIA_API_KEY=YOUR_ALGOLIA_INSTANCE
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["next/core-web-vitals", "prettier"],
"plugins": ["unused-imports"],
"globals": {
"JSX": "readonly"
}
}
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- main
- main
jobs:
check_todo:
name: check for TODO and create issues
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
2 changes: 1 addition & 1 deletion .idx/integrations.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"gemini_api": {}
}
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"discord.enabled": true,
"IDX.aI.enableInlineCompletion": true,
"IDX.aI.enableCodebaseIndexing": true
}
"discord.enabled": true,
"IDX.aI.enableInlineCompletion": true,
"IDX.aI.enableCodebaseIndexing": true
}
42 changes: 0 additions & 42 deletions CHANGE_LOG.md

This file was deleted.

24 changes: 12 additions & 12 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand All @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
nthumods@googlegroups.com.
nthumods@gmail.com.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
98 changes: 85 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,112 @@
![Frame 3](https://github.com/nthumodifications/courseweb/assets/74640729/c810b72f-e428-47bc-8f5b-22a49c4eb1a0)

國立清華大學非公式的開源預排,選課,課表網站.
# 國立清華大學非公式的開源預排,選課,課表網站.

The unofficial open-source course preselection, timetable builder, and course catalog website!

We are a passionate team of students dedicated to improving the technological standards of NTHU through students. We hope that with our efforts and yours, we'll make NTHU great again!

Since its inception, NTHUMods has been continuously enhanced with features like:

- 📚 Course Selector
- 📅 Timetable Builder
- 📝 Course Reviews
- 🚍 Bus Schedule
- ⛓️‍💥 NTHU CCXP Linking
- 📱 Mobile Support
- 🌐 Multi-Language Support

The platform has gained significant traction, now boasting over 1,500 users. It is proudly supported under NTHU IDEAL, CLC, and CLL projects.
Follow more updates on [Instagram](https://www.instagram.com/nthumods/)

## Technologies Used

- React
- Next.js
- Node.js
- Supabase
- Firebase
- DigitalOcean

> **Note**
> This Repository is under heavy development, expect to have breaking changes!
## Usage

Currently, everyone can access the website at [NTHUMods](https://nthumods.com). If theres any issues/features you would like to see, feel free to open an issue [here](https://github.com/nthumodifications/courseweb/issues/new/choose).

## Development

You can clone the repository and start the development server via `npm run dev`

If you wish to participate in this development, feel free to email [nthumods@gmail.com](mailto:nthumods@gmail.com) in the meantime while we figure out the system for contributing.

## Contributing

We welcome contributions from everyone, regardless of experience level. Here’s how you can get started:

1. **Fork the Repository**: Click the fork button on this repository to create a copy under your GitHub account.

2. **Clone Your Fork**:

```bash
git clone https://github.com/your-username/courseweb.git
cd courseweb
npm install
npm run dev-turbo
```

3. **Create a Branch**:

```bash
git checkout -b my-feature/bugfix

```

4. **Make Changes**:

- Add your changes to the codebase.
- Make sure to test your changes locally by running `npm run dev-turbo`.

5. **Commit Your Changes**:

```bash
git add .
git commit -m "Your message here"
```

> We recommend that you use a present-tense commit message that describes what the commit does. And follow [Commit Message Convention](https://www.conventionalcommits.org/en/v1.0.0/)
6. **Push Your Changes**:

```bash
git push origin my-feature/bugfix
```

7. **Open a Pull Request**:
- Open a pull request to the `main` branch of this repository.
- Make sure to give a descriptive title and description for your pull request, following a similar format with commit messages.
- If your pull request fixes an issue, make sure to link the issue in the pull request description.
- Wait for the maintainers to review your pull request.

## Deployment
Deployment is currently hosted on DigitalOcean, and tested with Vercel. If you wish to deploy your version, you can do so by forking this repository and deploying it on Vercel. You will need to set up the following environment variables:

.env.local
```
CWA_API_KEY=
NEXTAUTH_SECRET=
SUPABASE_SERVICE_ROLE_KEY=
NTHU_OAUTH_SECRET_KEY=
STUDENT_ID_PRIVATE_KEY=
STUDENT_ID_PUBLIC_KEY=
GOOGLE_SERVICE_KEY=<base64 of google service account file>
```

Deployment is currently hosted on DigitalOcean, and tested with Vercel. If you wish to deploy your version, you can do so by forking this repository and deploying it on Vercel. `.env.local` must be populated according to `.env.local.example`

## License

We are LICENSED under the GNU General Public License v3.0. You can view the license [here](https://github.com/nthumodifications/courseweb/blob/eff77192c989cf277be1e94660f8e0cf0304b492/LICENSE). Learn more about it [here](https://gist.github.com/kn9ts/cbe95340d29fc1aaeaa5dd5c059d2e60)

## Authors

- [Chew Tzi Hwee](@ImJustChew)
- [Joshua Lean](@Joshimello)
- [Huang Shi Jie](@SJieNg123)

## Acknowledgements

[National Tsing Hua University Interdisciplinary Program](https://ipth.site.nthu.edu.tw/p/406-1462-267815,r9940.php) - Acknowledging and supporting the project

## Inspiration

[NUSMods](https://nusmods.com) - The National University of Singapore's Website. The obvious lack of spirit in NTHU's website is what inspired us to create this project.
13 changes: 6 additions & 7 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { CapacitorConfig } from '@capacitor/cli';
import { CapacitorConfig } from "@capacitor/cli";

const config: CapacitorConfig = {
appId: 'com.nthumods.courseweb',
appName: 'NTHUMods',
webDir: 'fakeout',
appId: "com.nthumods.courseweb",
appName: "NTHUMods",
webDir: "fakeout",
server: {
url: 'https://nthumods.com',
androidScheme: 'https',
url: "https://nthumods.com",
androidScheme: "https",
},

};

export default config;
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"components": "@/components",
"utils": "@/lib/utils"
}
}
}
34,808 changes: 34,807 additions & 1 deletion courses.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ionic.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"capacitor": {}
},
"type": "custom"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"author": "xcode",
"version": 1
}
}
}
8 changes: 4 additions & 4 deletions ios/App/App/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"info": {
"version": 1,
"author": "xcode"
}
}
}
2 changes: 1 addition & 1 deletion ios/App/App/Assets.xcassets/Splash.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
"version": 1,
"author": "xcode"
}
}
}
Loading

0 comments on commit 3a9e680

Please sign in to comment.