generated from trywilco/Anythink-Market-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
WilcoApp
committed
Jan 23, 2024
1 parent
db9c84d
commit 7103c08
Showing
241 changed files
with
42,149 additions
and
20,955 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,42 @@ | ||
{ | ||
"name": "Anythink Development Container", | ||
"image": "public.ecr.aws/v0a2l7y2/wilco/anythink-devcontainer-java:latest" | ||
"image": "public.ecr.aws/v0a2l7y2/wilco/anythink-devcontainer:latest", | ||
"forwardPorts": [3000, 3001, 5433, 27017], | ||
"portsAttributes": { | ||
"3000": { | ||
"label": "Backend", | ||
"elevateIfNeeded": true, | ||
"requireLocalPort": true, | ||
"onAutoForward": "silent" | ||
}, | ||
"3001": { | ||
"label": "Frontend", | ||
"elevateIfNeeded": true, | ||
"requireLocalPort": true, | ||
"onAutoForward": "silent" | ||
}, | ||
"5433": { | ||
"label": "Database", | ||
"elevateIfNeeded": true, | ||
"requireLocalPort": true, | ||
"onAutoForward": "silent" | ||
}, | ||
"27017": { | ||
"label": "Database", | ||
"elevateIfNeeded": true, | ||
"requireLocalPort": true, | ||
"onAutoForward": "silent" | ||
} | ||
}, | ||
"postStartCommand": "bash -c .devcontainer/setup.sh", | ||
|
||
"settings": { | ||
"extensions.ignoreRecommendations": true, | ||
"workbench.startupEditor": "none", | ||
"workbench.colorTheme": "Visual Studio Dark", | ||
"workbench.colorCustomizations": {}, | ||
"workbench.welcomePage.walkthroughs.openOnInstall": false, | ||
"workbench.welcomePage.experimental.videoTutorials": "off", | ||
"github.codespaces.defaultExtensions": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
RETRY_COUNT=3 | ||
RETRY_INTERVAL=5 | ||
TARGET_PORTS=("3000" "3001") | ||
|
||
sleep 5 | ||
|
||
for port in "${TARGET_PORTS[@]}"; do | ||
for ((try = 1; try <= RETRY_COUNT; try++)); do | ||
echo "Attempt $try: Making port $port public." | ||
|
||
gh codespace ports visibility $port:public -c $CODESPACE_NAME | ||
sleep 1 | ||
|
||
ports_json=$(gh codespace ports -c $CODESPACE_NAME --json label,sourcePort,visibility) | ||
visibility=$(echo "$ports_json" | jq -r ".[] | select(.sourcePort == $port) | .visibility") | ||
|
||
if [ "$visibility" == "public" ]; then | ||
echo "Port $port is now public." | ||
break | ||
elif [ $try -lt $RETRY_COUNT ]; then | ||
echo "Port $port is still not public. Retrying in $RETRY_INTERVAL seconds..." | ||
sleep $RETRY_INTERVAL | ||
else | ||
echo "Failed to make port $port public after $RETRY_COUNT attempts." | ||
fi | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
sleep 10s | ||
|
||
echo "Welcome to" | ||
echo " _ _ _ _ _ " | ||
echo " / \ _ __ _ _ | |_ | |__ (_) _ __ | | __ " | ||
echo " / _ \ | '_ \ | | | | | __| | '_ \ | | | '_ \ | |/ / " | ||
echo " / ___ \ | | | | | |_| | | |_ | | | | | | | | | | | < " | ||
echo " /_/ \_\ |_| |_| \__, | \__| |_| |_| |_| |_| |_| |_|\_\ " | ||
echo " |___/ " | ||
|
||
echo '\n\e]8;;https://app.wilco.gg/chat\e\\Click here\e]8;;\e\\ to go back to Snack' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = { | ||
env: { | ||
node: true, | ||
}, | ||
root: true, | ||
parser: "@typescript-eslint/parser", | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier", | ||
], | ||
ignorePatterns: ["dist/", "node_modules/"], | ||
plugins: ["@typescript-eslint", "jest"], | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: "module", | ||
}, | ||
rules: { | ||
"@typescript-eslint/no-var-requires": 0, | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", | ||
{ | ||
varsIgnorePattern: "^_", | ||
argsIgnorePattern: "^_", | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["test/**/*.ts"], | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,41 @@ | ||
.gradle/ | ||
/build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
*.db | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
|
||
### IntelliJ IDEA ### | ||
# Logs | ||
logs | ||
*.log | ||
.DS_Store | ||
|
||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
node_modules | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### NetBeans ### | ||
nbproject/private/ | ||
build/ | ||
nbbuild/ | ||
dist/ | ||
nbdist/ | ||
.nb-gradle/ | ||
|
||
dist | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dist/ | ||
package.json | ||
package-lock.json | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
FROM public.ecr.aws/v0a2l7y2/wilco/anythink-backend-java:latest | ||
FROM node:18 | ||
|
||
RUN curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh --output /wait-for-it.sh | ||
|
||
RUN chmod +x /wait-for-it.sh | ||
|
||
WORKDIR /usr/src/backend | ||
RUN yarn install |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,3 @@ | ||
# Anythink Market Backend | ||
# Mongo Chat Server | ||
|
||
# How it works | ||
|
||
The application uses Spring Boot (Web, Mybatis). | ||
|
||
And the code is organized as this: | ||
|
||
1. `api` is the web layer implemented by Spring MVC | ||
2. `core` is the business model including entities and services | ||
3. `application` is the high-level services for querying the data transfer objects | ||
4. `infrastructure` contains all the implementation classes as the technique details | ||
|
||
# Getting started | ||
|
||
You'll need Java 11 installed. | ||
|
||
./gradlew bootRun | ||
|
||
To test that it works, open a browser tab at http://localhost:3000/api/tags | ||
Alternatively, you can run: | ||
|
||
curl http://localhost:3000/api/tags | ||
|
||
# Run test | ||
|
||
The repository contains a lot of test cases to cover both api test and repository test. | ||
|
||
./gradlew test | ||
|
||
# Code format | ||
|
||
Use spotless for code format. | ||
|
||
./gradlew spotlessJavaApply | ||
Based on https://mongodb.github.io/chatbot/server/configure |
Oops, something went wrong.