Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: updated code quality definitions #99

Merged
merged 4 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PORT=4000

MAIL_HOST=
MAIL_USER=
MAIL_PASSWORD=

SESSION_SECRET=
PRIV_KEY=

DB_CONNECTION_STRING=

FIREBASE_SERVICE_ACCOUNT=
FIREBASE_STORAGE_BUCKET=
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": [
"@sliit-foss/eslint-config-internal"
],
"env": {
"browser": false,
"node": true,
"jest": true,
"es6": true
},
"rules": {
"no-sparse-arrays": "off",
"no-nested-ternary": "off",
"newline-per-chained-call": "off"
}
}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ build
logs
.idea/

.env*
.env
env/

npm-debug.log

yarn.lock

env/
.eslintignore
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
save-exact=true
enable-pre-post-scripts=true
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
out/**
dist/**
logs/**
coverage/**
node_modules/**
18 changes: 18 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"printWidth": 120,
"bracketSameLine": true,
"bracketSpacing": true,
"singleQuote": true,
"quoteProps": "consistent",
"trailingComma": "none",
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrder": [
"^(.*express*(.*)$)",
"^(.*@sliit-foss*(.*)$)",
"<THIRD_PARTY_MODULES>",
"^(.*@/*(.*)$)",
"^[./]"
],
"importOrderSeparation": false,
"importOrderSortSpecifiers": true
}
3 changes: 0 additions & 3 deletions .prettierrc.json

This file was deleted.

3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:14.15.4-alpine as builder
WORKDIR /usr/src/app

COPY package* ./
RUN npm install
RUN npm install --ignore-scripts

COPY . .

Expand All @@ -14,7 +14,6 @@ FROM node:14.15.4-alpine
WORKDIR /usr/src/app

COPY package* ./
RUN npm install

COPY --from=builder /usr/src/app/build ./

Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,39 @@
[Postman API Documentation](https://documenter.getpostman.com/view/16352758/Tzeak76G)

## Contribution Guide

1. Fork the repository

2. Clone the repository

```
git clone https://github.com/sliit-foss/rsvp.git
```

3. Create Feature branch and checkout
_Replace <BRANCH_NAME> with meaningful name. For an example navbar. See the guide for the more details [Link](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow)_
_Replace <BRANCH_NAME> with meaningful name. For an example navbar. See the guide for the more details [Link](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow)_

```
git checkout -b feature/<BRANCH_NAME>
```

4. Do your modifications

5. Stage Changes and commit

```
git add .
git commit -m "<Commit message>"
```
6. Push Changes

6. Push Changes

```
git push --set-upstream origin feature/<BRANCH_NAME>
```
7. Make a Pull Request.
_See the guide for more details [Link](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)_

7. Make a Pull Request.
_See the guide for more details [Link](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)_

[Read More](https://github.com/sliit-foss/zero2hero/blob/master/docs/git/git.md)

Expand All @@ -36,7 +45,7 @@ _See the guide for more details [Link](https://docs.github.com/en/free-pro-team@
2. Write documentation ([jsdocs](https://jsdoc.app/))
3. Write unit and integration tests for everything you write.

# Contributors
# Contributors

<a href="https://github.com/sliit-foss/rsvp/graphs/contributors">
<img src="https://contrib.rocks/image?repo=sliit-foss/rsvp" />
Expand Down
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],
}
};
20 changes: 10 additions & 10 deletions docs/endpoints/endpoints.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Attendees

GET {{domain}}/user?perpage=2&page=6 - Get list of attendees
GET {{domain}}/user/:id - Get a attendee by id
POST {{domain}}/user - Create a attendee
GET {{domain}}/user?perpage=2&page=6 - Get list of attendees
GET {{domain}}/user/:id - Get a attendee by id
POST {{domain}}/user - Create a attendee

# Auth

POST {{domain}}/user/login - Admin login
POST {{domain}}/user/signup - Create a admin account
POST {{domain}}/user/login - Admin login
POST {{domain}}/user/signup - Create a admin account

# Event

GET {{domain}}/event - Get list of events
GET {{domain}}/event/:id - Get a event by id
POST {{domain}}/event/:id - Create a event
GET {{domain}}/event - Get list of events
GET {{domain}}/event/:id - Get a event by id
POST {{domain}}/event/:id - Create a event

# Mail

POST {{domain}}/mail - Send mail/mails to attendee/attendees
POST {{domain}}/mail - Send mail/mails to attendee/attendees

# Health

GET {{domain}}/health - Get health of the service
GET {{domain}}/health - Get health of the service
11 changes: 9 additions & 2 deletions docs/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
## Purpose

<!--- Describe the problems, issues, or needs driving this feature/fix and include links to related issues -->

The purpose of this PR is to fix #<issue-number>

## Goals

<!--- Describe the solutions that this feature/fix will introduce to resolve the problems described above -->

## Approach

<!--- Describe how you are implementing the solutions. Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here. -->

## Checklist
## Checklist

- [x] This PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
- [ ] I have performed a self-review of my own code
- [ ] Bug fix (non-breaking change which fixes an issue)
Expand All @@ -17,7 +22,9 @@ The purpose of this PR is to fix #<issue-number>
- [ ] This change requires a documentation update

## Related PRs
<!--- List any other related PRs -->

<!--- List any other related PRs -->

## Learning

<!--- Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem. -->
14 changes: 14 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pre-commit:
parallel: true
commands:
format:
glob: "*.{js,ts,jsx,tsx}"
run: npm run format && git add .
lint:
glob: "*.{js,ts,jsx,tsx}"
run: npm run lint && git add .

commit-msg:
commands:
commitlint:
run: npx commitlint --edit --color
5 changes: 2 additions & 3 deletions md-seed-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import { default as mongoConnect } from './src/utils/database';
* order is important
* @type {Object}
*/
export const seedersList = {
};
export const seedersList = {};
/**
* Connect to mongodb implementation
* @return {Promise}
*/
export const connect = async () => mongoConnect()
export const connect = async () => mongoConnect();
/**
* Drop/Clear the database implementation
* @return {Promise}
Expand Down
Loading
Loading