Skip to content

Commit

Permalink
add searching and fix some issues, also backend server open source, h…
Browse files Browse the repository at this point in the history
…opefully that wont go wrong
  • Loading branch information
FireMario211 committed Sep 1, 2024
1 parent 02405ee commit da7f295
Show file tree
Hide file tree
Showing 17 changed files with 1,372 additions and 36 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,10 @@ build-*/
.idea/
/cmake-build-*/

server
server/dist
server/node_modules
server/redis
server/package-lock.json

build-linux
compile_commands.json
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# Object Workshop
Download, upload, or find custom objects made by other creators!


# a mini todo for me
- fix the object limit setting
- allow people to search for objects
- implement reporting
- maybe try adding trending filter
- add icon
- fix bugs like clicking on the side bar while in an object
- fix the noticable movement
25 changes: 25 additions & 0 deletions server/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
services:
db:
image: postgres:13.16
restart: always
environment:
POSTGRES_DB: db
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./table.sql:/docker-entrypoint-initdb.d/table.sql
pgadmin:
image: elestio/pgadmin:latest
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: mypassword
PGADMIN_LISTEN_PORT: 8080
ports:
- "8080:8080"

volumes:
postgres_data:
38 changes: 38 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "server",
"version": "1.0.0",
"description": "A server for Custom Object Workshop.",
"main": "dist/index.js",
"scripts": {
"lint": "eslint src/**/*.ts",
"lintfix": "eslint src/**/*.ts --fix",
"build": "rm -rf dist && mkdir dist && cp -r src/* dist/ && npx tsc -p .",
"clean": "rm -rf dist",
"start": "npm run build && node .",
"watch": "npx tsc -p . --watch"
},
"author": "Firee",
"license": "GPL-3.0",
"devDependencies": {
"@types/body-parser": "^1.19.5",
"@types/express": "^4.17.21",
"@types/morgan": "^1.9.9",
"@types/node": "^20.11.16",
"@types/pg": "^8.11.6",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.56.0",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"dependencies": {
"axios": "^1.7.5",
"body-parser": "^1.20.2",
"crypto": "^1.0.1",
"express": "^4.18.2",
"express-rate-limit": "^7.4.0",
"express-validator": "^7.2.0",
"morgan": "^1.10.0",
"pg": "^8.12.0"
}
}
8 changes: 8 additions & 0 deletions server/src/Components/Comment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default interface CommentData {
id: number;
objectID: number;
accountID: number;
timestamp: Date | number;
content: string;
likes: number;
};
15 changes: 15 additions & 0 deletions server/src/Components/Object.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default interface ObjectData {
id: number;
account_id: number;
account_name: string;
timestamp: Date | number;
name: string;
description: string;
downloads: number;
favorites: number;
rating: number;
rating_count: number;
tags: Array<string>;
status: number;
data: string;
};
6 changes: 6 additions & 0 deletions server/src/Components/Rating.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default interface RatingData {
objectID: number;
accountID: number;
timestamp: Date | number;
stars: number;
};
10 changes: 10 additions & 0 deletions server/src/Components/User.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface UserData {
auth_method: string;
account_id: number;
name: string;
downloaded: Array<number>;
favorites: Array<number>;
timestamp: Date | number;
role: number;
uploads: number;
};
Loading

0 comments on commit da7f295

Please sign in to comment.