Skip to content

Commit

Permalink
Release 3.3.0 (#202)
Browse files Browse the repository at this point in the history
Co-authored-by: PartMan <[email protected]>
Co-authored-by: NP <[email protected]>
Co-authored-by: KarmaAkaB <[email protected]>
Co-authored-by: Symbiot01 <[email protected]>
Co-authored-by: Ankan <[email protected]>
Co-authored-by: Baron105 <[email protected]>
Co-authored-by: Chaitanya-Srinivas <[email protected]>
Co-authored-by: SachdevJai <[email protected]>
Co-authored-by: SachdevJai <[email protected]>
Co-authored-by: Ankan <[email protected]>
Co-authored-by: _Horizon <[email protected]>
Co-authored-by: Symbiot01 <[email protected]>
  • Loading branch information
13 people authored Jun 30, 2023
1 parent 75e7779 commit 779aa82
Show file tree
Hide file tree
Showing 122 changed files with 2,963 additions and 1,313 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
"prefer-const": ["error", {
"ignoreReadBeforeAssign": true
}],
"quotes": ["error", "single", {
"allowTemplateLiterals": true,
"avoidEscape": true
}],
"semi": ["error", "always"],
"semi-spacing": ["error", {
"before": false,
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
paths-ignore:
- 'LICENSE'
- 'README.md'
- 'docs'
pull_request:
branches: [ main, dev ]
paths-ignore:
- 'LICENSE'
- 'README.md'
- 'docs'

jobs:
test:
Expand Down
166 changes: 120 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# MASK
The website for the Manga & Anime Society Kharagpur

## Contributing
The website for the Manga and Anime Society Kharagpur (currently running in [kgpmask.club](https://kgpmask.club))

The owner of this repository is @PartMan7, who also runs the server. He's also running the server cost (at the time of writing he's in his final year, but it'll carry on even after graduation).

All non-trivial changes are done through PULL REQUESTS ONLY. The WebDev Team Head (currently @Goose-Of-War) is responsible for testing and merging all PRs. Feel free to pester them to look at the changes you've prepared.

To create a pull request, navigate to the `dev` branch (clicking on the GitHub client, or `git checkout dev` on the CLI) and create a new branch based on it (`New Branch` button (based on the `dev` branch, again!) on the GitHub client's branches page, or `git checkout -b [branch-name]` on the CLI). Pull requests will _never_ be merged directly to `main`; they will be first merged to `dev` and batches of changes and/or patches will be merged from `dev` to `main` alongside version increments.

To work on templates which require access to credentials using `dev userless` (`du`) mode, check out [this page](/TESTING.md) for some info.
## Tech Stack

Changes to the `dev` server are automatically deployed to [https://test.kgpmask.club]. This does not extend to environment configuration changes (eg: docker changes).
- VPS provider: OVH
- Backend reverse proxy for port-forwarding: NGINX
- Containerized deployments: Docker (we aren't using dockerized containers right now)
- Application language: Node.js
- App routing: Express.js
- Page templates: Nunjucks
- Page styling: SASS
- Database: MongoDB
- Database ORM: mongoose
- Linting: ESLint
- Testing suite: Mocha

Ensure that pull requests pass tests (`npm test` for both lint and mocha tests).
---

## Running the Server

Expand All @@ -22,7 +26,7 @@ This server requires Node.js v16.0+ to run, and all tests are performed on v16.
There are multiple ways to run the server. The vast majority of the time, you will be running it in dev mode - the command for this is `npm run dev`. If you wish to run in regular mode, the command is `npm start`. Note that the server run in both cases will be identical - the only difference is that dev mode will automatically refresh changes made to the server code and/or pages, while regular mode will not. In addition, you can add flags to customize the operation of the server. These are:

- `dev` (d): An internal flag that does the same as `npm run dev`, except you lose access to nodemon. Just use `npm run dev` instead.
- <strike>`jsonuser` (t): Runs the server with the user details being defined in `/src/user.json`.</strike> **This is in progress.**
- ~~`jsonuser` (t): Runs the server with the user details being defined in `/src/user.json`.~~ **This is in progress.**
- `local` (l): Uses a local database (mongodb://127.0.0.1/mask) instead of the designated test database. Overwrites all other DB flags.
- `mongoless` (m): Runs the server without a database connection. All database-based pages cannot be loaded. This is a superset of the `userless` flag (ie; a `mongoless` server will also always be `userless`).
- `prod` (p): Connects directly to the production database. Do NOT use this flag lightly; it can break many, many things if you mess up and the testing database should serve your purposes. Cannot be used in conjuction with dev mode, for security reasons.
Expand Down Expand Up @@ -50,23 +54,7 @@ Furthermore, for those with access to multiple sets of credentials (the three ex

Note (edited): You can now connect to the database even while on WiFi/LAN without a VPN. The domain name has been whitelisted. The IP address has NOT been whitelisted for direct http/https connections.

## Guidelines

Tabs for indentation, basic JS style guidelines (check `./eslintrc.json` for the full list). If you have any questions, post 'em in the WebDev channel. If you aren't a member of the society but have queries/reports/suggestions, feel free to use the Issues / Discussions pages on the repository.

## Tech Stack

- VPS provider: OVH
- Backend reverse proxy for port-forwarding: NGINX
- Containerized deployments: Docker
- Application language: Node.js
- App routing: Express.js
- Page templates: Nunjucks
- Page styling: SASS
- Database: MongoDB
- Database ORM: mongoose
- Linting: ESLint
- Testing suite: Mocha
---

## Templates

Expand All @@ -86,7 +74,8 @@ Additionally, the following blocks may be set:

The default page template is:

```nunjucks

```jinja
{% extends "_base.njk" %}
{% set thispage = 'navref' %}
Expand All @@ -100,7 +89,8 @@ The default page template is:

The default newsletter template is:

```nunjucks

```jinja
{% extends "_newsletter.njk" %}
{% set pagetitle = 'Month - Issue num' %}
Expand All @@ -117,19 +107,103 @@ The default newsletter template is:

Take a look at existing articles for the various classes and where they're used.

## Credits:

- <a href="https://github.com/PartMan7" target="_blank">Parth Mane</a> (Lead)<br />
- <a href="https://github.com/Goose-Of-War" target="_blank">Vidunram A R </a> (Contributor)<br />
- <a href="https://github.com/nishkalprakash" target="_blank">Nishkal Prakash</a> (Contributor) <br />
- <a href="https://github.com/MokshithPV" target="_blank">Venkatsai Mokshith</a> (Contributor)<br />
- <a href="https://github.com/SachdevJai" target="_blank">Jai Sachdev</a> (Contributor)<br />
- <a href="https://github.com/ItsAnkan" target="_blank">Ankan Saha</a> (Contributor)<br />
- <a href="https://github.com/Symbiot01" target="_blank">Sahil Patel</a> (Contributor)<br />
- <a href="https://github.com/KarmaAkaB" target="_blank">Soumil Maiti</a> (Contributor)<br />
- <a href="https://github.com/anjaniit23" target="_blank">Anjani Kumar</a> (Contributor)<br />
- <a href="https://github.com/lurkingryuu" target="_blank">Karthikeya Y M</a> (Contributor)<br />
- <a href="https://github.com/Yureien" target="_blank">Soham Sen</a> (Contributor)<br />
- <a href="https://github.com/ayush4ise" target="_blank">Ayush Parmar</a> (Contributor)<br />
- <a href="https://github.com/Pagol1" target="_blank">Saumyadip Nandy</a> (Contributor)<br />
- <a href="https://github.com/shiroyasha263" target="_blank">Vishesh Gupta</a> (Contributor)<br />
---

## Routers
<!-- Note. This will be subject to change once the fs readdir router system is implemented. -->

The Express app's router is set up by `/src/route.js`. The file route.js imports routers from the `/routes` folder. Each router file has the following format:

```js
const router = require('express').Router();
// This router is used to configure the app for a specific route

// GET requests
app.get('/path', (req, res, next) => {
// some code
return res.renderFile(template, ctx);
});

// POST requests
app.post('/path', (req, res, next) => {
// some code
return res.status(statusCode).send;
});

/*
Notes:
The next argument is optional in most cases.
The functions in the requests can be asynchronous too.
You can use other routers as well if needed.
*/

module.exports = {
route: '/path'
router;
}
```

All routers are imported and used in `route.js` in the `src` folder.

```js
const routerModules = (await fs.readdir(path.join(__dirname, '../routes'))).filter(file => file.endsWith('.js'));
routerModules.forEach(module => {
const { route, router } = require(`../routes/${module}`);
app.use(route, router);
});
```

---

## Contributing

The owner of this repository is @PartMan7, who also runs the server. He's also running the server cost (at the time of writing he's in his final year, but it'll carry on even after graduation).

All non-trivial changes are done through PULL REQUESTS ONLY. The WebDev Team Head (currently @Goose-Of-War) is responsible for testing and merging all PRs. Feel free to pester them to look at the changes you've prepared.

To create a pull request, navigate to the `dev` branch (clicking on the GitHub client, or `git checkout dev` on the CLI) and create a new branch based on it (`New Branch` button (based on the `dev` branch, again!) on the GitHub client's branches page, or `git checkout -b [branch-name]` on the CLI). Pull requests will _never_ be merged directly to `main`; they will be first merged to `dev` and batches of changes and/or patches will be merged from `dev` to `main` alongside version increments.

To work on templates which require access to credentials using `dev userless` (`du`) mode, check out [this page](/docs/TESTING.md) for some info.

Changes to the `dev` server are automatically deployed to [test.kgpmask.club](https://test.kgpmask.club). This does not extend to environment configuration changes (eg: docker changes).

Ensure that pull requests pass tests (`npm test` for both lint and mocha tests).

---

## Guidelines

- For any new route, make sure to use a new router file instead of adding to `route.js`
- Make sure to extend your template from either `_base.njk` or another template (in case of similar pages, like events or newsletters).
- Make sure the code passes the lint and mocha tests. You can check that by running `npm run test`. The ESLint configuration can be seen in `.eslintrc.json` and tests can be seen in the `test` folder.
- If you have any questions, post 'em in the WebDev channel.
- If you aren't a member of the society but have queries/reports/suggestions, feel free to use the [Issues](https://github.com/kgpmask/MASK/issues)/[Discussions](https://github.com/kgpmask/MASK/discussions) pages.

---

## Credits

### Current Contributors

- <a href="https://github.com/Goose-Of-War" target="_blank">Vidunram A R </a> (Lead)
- <a href="https://github.com/nishkalprakash" target="_blank">Nishkal Prakash</a>
- <a href="https://github.com/SachdevJai" target="_blank">Jai Sachdev</a>
- <a href="https://github.com/ItsAnkan" target="_blank">Ankan Saha</a>
- <a href="https://github.com/Symbiot01" target="_blank">Sahil Patel</a>
- <a href="https://github.com/KarmaAkaB" target="_blank">Soumil Maiti</a>
- <a href="https://github.com/DishantB0411" target="_blank">Dishant Bothra</a>

### Former Contributors

- <a href="https://github.com/PartMan7" target="_blank">Parth Mane</a>
- <a href="https://github.com/anjaniit23" target="_blank">Anjani Kumar</a>
- <a href="https://github.com/Yureien" target="_blank">Soham Sen</a>
- <a href="https://github.com/shiroyasha263" target="_blank">Vishesh Gupta</a>
- <a href="https://github.com/Pagol1" target="_blank">Saumyadip Nandy</a>
- <a href="https://github.com/MokshithPV" target="_blank">Venkatsai Mokshith</a>
- <a href="https://github.com/lurkingryuu" target="_blank">Karthikeya Y M</a>
- <a href="https://github.com/ayush4ise" target="_blank">Ayush Parmar</a>

### Open Source Contributors

- <a href="https://github.com/Baron105" target="_blank">Barun Parua</a>
2 changes: 2 additions & 0 deletions assets/icons/amv.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/amv_2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions assets/icons/amv_3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/icons/design.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions assets/icons/design_2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 779aa82

Please sign in to comment.