Skip to content

Commit

Permalink
Merge pull request #144 from ms-club-sliit/feature/email-queue
Browse files Browse the repository at this point in the history
Feature/email queue
  • Loading branch information
rusiruavb authored Jan 6, 2022
2 parents 18d4cc4 + f414405 commit 92d940d
Show file tree
Hide file tree
Showing 78 changed files with 9,484 additions and 21,332 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build
dist/*
.idea/*
.vscode
node_modules/*
24 changes: 24 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"indent": ["error", "tab"],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"@typescript-eslint/no-explicit-any": "off",
"no-const-assign": "error",
"max-len": ["error", { "code": 180, "ignoreUrls": true, "ignoreRegExpLiterals": true }],
"no-unused-vars": "error",
"no-console": "error",
"no-duplicate-imports": ["error", { "includeExports": true }],
"default-case": "error"
}
}
5 changes: 3 additions & 2 deletions .github/templates/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Issue/ Feature Request :bricks:
⚠️ *You must fill all the required fields to place you issue correctly.*

⚠️ _You must fill all the required fields to place you issue correctly._
| Fields | Description | Requirement |
| ------ | ----------- | ------------------ |
| Name | Name of the feature/ issue. | ✔️ |
Expand All @@ -9,4 +10,4 @@
| Project | Appropriate project that feature or issue belongs to | ✔️ |

**Required** - ✔️ <br>
**Optional** - ❌
**Optional** - ❌
6 changes: 3 additions & 3 deletions .github/templates/PR_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Pull Request(PR) Template :octocat:

**Check following steps are fulfilled before creating the PR** <br>
📝 Explain what are the changes that you have done to the codebase in the PR description<br>
✔️ Assign more than 2 reviewers to the PR. <br>
✔️ Add relevent labes to the PR <br>
✔️ Add relevant labels to the PR <br>
(⚠️ Must to have one of the these labels. **high-priority**, **medium-priority**, **low-priority**)<br>
✔️ Select the project. **(MS Club Web Server)** <br>
✔️ If there is any issue created that related to the PR, please link link it to the PR.

✔️ If there is any issue created that related to the PR, please link it to the PR.
28 changes: 14 additions & 14 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# This workflow will build the Docker image of the MS Club Web Server and push it
# This workflow will build the Docker image of the MS Club Web Server and push it
# to the GitHub Container Registry (GHCR)

name: Docker Image CI

on:
push:
branches: [ master ]
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
name: Check out code
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & Push Docker image
with:
image: msclubwebserver
tags: v1.0.0, latest
registry: ghcr.io
dockerfile: Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/checkout@v2
name: Check out code

- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & Push Docker image
with:
image: msclubwebserver
tags: v1.0.0, latest
registry: ghcr.io
dockerfile: Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
28 changes: 14 additions & 14 deletions .github/workflows/node-build.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# This workflow will do a clean install of node dependencies,
# cache/restore them, build the source code and run tests across
# This workflow will do a clean install of node dependencies,
# cache/restore them, build the source code and run tests across
# different versions of node

name: Node Build CI

on:
push:
branches: [ master, development ]
branches: [master, development]
pull_request:
branches: [ master, development ]
branches: [master, development]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm ci
- run: npm run build
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install
- run: npm ci
- run: npm run build
38 changes: 38 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

echo '🏗️👷 Hi, my name is Bob. I am responsible for styling, testing and building your project before commit'

# Check Prettier standards
npm run check-format ||
(
echo '🤢🤮 Prettier Check Failed. Your code styling not looking good. 🤢🤮 Run npm run format, add changes and try commit again.';
false;
)

# Check ESLint Standards
npm run check-lint ||
(
echo '😤🏀 ESLint Check Failed. Your code may have some linting issues. 👋😤 Make the required changes listed above, add changes and try to commit again.'
false;
)

# Check tsconfig standards
npm run check-types ||
(
echo '❌❌ Failed Type check. ❌❌ Are you seriously trying to write that? Make the changes required above.'
false;
)

# If everything passes... Now we can commit
echo '🤔🤔 Alright.... Code looks good to me... Trying to build now. 🤔🤔'

npm run build ||
(
echo '🔨❌ Better call Bob... Because your build failed 🔨❌ Next build failed: View the errors above to see why.'
false;
)

# If everything passes... Now we can commit
echo '✅✅ You win this time... I am committing this now. ✅✅'

5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build
dist/*
.idea/*
.vscode
node_modules/*
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"useTabs": true,
"semi": true,
"singleQuote": false,
"printWidth": 120,
"arrowParens": "always"
}
59 changes: 43 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# MS Club Web Server

Backend API application for MS Club of SLIIT 🌀<br>
Read further to know how **you** can start contributing to MS Club!
Read further to know how **you** can start contributing to MS Club!

## Quick Links

- [Tech Stack](#tech-stack)
- [How to contribute](#how-to-contribute)
- [Learning Resources](#how-can-i-get-start)
Expand All @@ -13,76 +15,101 @@ Read further to know how **you** can start contributing to MS Club!
![banner-whitegb-spacing-10x(2)](https://firebasestorage.googleapis.com/v0/b/msclubofsliit-v2.appspot.com/o/tech_stack_logo.png?alt=media&token=74635794-1141-411c-8b82-5e90f6113aae)

## [How to contribute](#how-to)

1. Fork the repo on GitHub :octocat:.
2. Clone the project to your own machine. <br>

```
git clone https://github.com/<YOUR_USERNAME>/msclubwebsite.git
```

3. Create a branch using the git checkout command. Branch name prefix should be one of these. <br>
`feature/<branch_name>` <br>
`fix/<branch_name>` <br>
`feature/<branch_name>` <br>
`fix/<branch_name>` <br>

```
git checkout -b <your-new-branch-name>
```

4. Stage your changes and commit with a meaningful commit message. **First letter of the commit should be capital** <br>

```
git add .
```
```
git commit -m "<initial commit>"

```
git commit -m "<initial commit>"
```

5. Push your work back up to your fork. <br>

```
git push origin <add-your-branch-name>
```

6. Submit a Pull request so that we can review your changes. [Learn about creating a pull request.](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)

## [How can I get start](#resources)

We got your back. Here are some **FREE** resources for you to strengthen your web development skills and start firing some commits.

**TypeScript**

- [Official Documentation](https://www.typescriptlang.org/docs/)
- [TypeScript For JS Developers](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)
- [TypeScript Basics by freeCodeCamp](https://www.freecodecamp.org/news/learn-typescript-basics/)

**Node JS / Express**

- [Node JS 14.x Official Documentaion](https://nodejs.org/docs/latest-v14.x/api/)
- [Express Official Documentation](https://expressjs.com/)

## [About Docker Image](#about-docker-image)
## [About Docker Image](#about-docker-image)

We use Docker :whale: image to deploy this API application to the server. You can build and run the docker container in your local machine. Follow below steps to build and run the Docker container. <br>
:memo: In order to build and run the Docker container, you must have Docker install on you computer. <br>

1. Build the Docker image. :building_construction:
1. Build the Docker image. :building_construction:

```
docker build -t ghcr.io/ms-club-sliit/msclubwebserver:v1.0.0 .
```
2. Check the build Docker images. :heavy_check_mark:

2. Check the build Docker images. :heavy_check_mark:

```
docker image ls
```
3. Run the Docker container. After run this command the container will start running. :package: <br>
`docker run -p <expose_port>:<application_port> -d --name "<name_for_the_container>":<tag>` <br>
**`-d`** - Run in ditach mode <br>
**`-p`** - Port mapping between Docker container and application

3. Run the Docker container. After run this command the container will start running. :package: <br>
`docker run -p <expose_port>:<application_port> -d --name "<name_for_the_container>":<tag>` <br>
**`-d`** - Run in ditach mode <br>
**`-p`** - Port mapping between Docker container and application

```
docker run -p 9096:8078 -d --name "mswebserver" ghcr.io/ms-club-sliit/msclubwebserver:v1.0.0
```
4. Open your web browser and paste below URL :earth_asia:

4. Open your web browser and paste below URL :earth_asia:

```
http://localhost:9096
```
5. View the running container :eyes:

5. View the running container :eyes:

```
docker ps
```
6. Stop the running container :stop_sign:

6. Stop the running container :stop_sign:

```
docker stop mswebserver
```

7. Remove the Docker container :coffin:

```
docker rm mswebserver
```
```
Loading

0 comments on commit 92d940d

Please sign in to comment.