Documentation & Formatting Changes
Co-Authored-By: svedev <28451791+svedev0@users.noreply.github.com>
This commit is contained in:
parent
8c23c68565
commit
f542df17ab
12 changed files with 345 additions and 69 deletions
|
|
@ -12,7 +12,7 @@ REDIS_URL=redis://redis:6379
|
|||
|
||||
# Authentication
|
||||
PRIVATE_BETTER_AUTH_SECRET=your_super_secret_auth_key_here
|
||||
PUBLIC_BETTER_AUTH_URL=http://localhost:3002
|
||||
PUBLIC_BETTER_AUTH_URL=http://localhost:5173 # Change for Production to http://localhost:3002
|
||||
|
||||
# Google OAuth (optional - for social login)
|
||||
GOOGLE_CLIENT_ID=your_google_client_id
|
||||
|
|
@ -26,4 +26,7 @@ PUBLIC_B2_ENDPOINT=https://s3.us-west-002.backblazeb2.com
|
|||
PUBLIC_B2_REGION=us-west-002
|
||||
|
||||
# OpenAI (for AI features)
|
||||
OPENROUTER_API_KEY=your_openrouter_api_key
|
||||
OPENROUTER_API_KEY=your_openrouter_api_key
|
||||
|
||||
# Websocket URL
|
||||
PUBLIC_WEBSOCKET_URL=http://localhost:8080
|
||||
|
|
@ -1,38 +1,65 @@
|
|||
# sv
|
||||
# Rugplay Website
|
||||
|
||||
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
|
||||
This is the main website component of Rugplay, built with SvelteKit. It handles the user interface, trading functionality, and market visualization.
|
||||
|
||||
## Creating a project
|
||||
## Development
|
||||
|
||||
If you're seeing this, you've probably already done this step. Congrats!
|
||||
### Prerequisites
|
||||
|
||||
- Node.js (LTS version)
|
||||
- Redis running in the background
|
||||
- OpenRouter API key (for AI features)
|
||||
- AWS S3/B2 Storage (for file uploads)
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Create a `.env` file based on `.env.example`:
|
||||
|
||||
```bash
|
||||
# create a new project in the current directory
|
||||
npx sv create
|
||||
|
||||
# create a new project in my-app
|
||||
npx sv create my-app
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
## Developing
|
||||
Key variables to configure:
|
||||
- `PUBLIC_BETTER_AUTH_URL`: Set to `http://localhost:3002` if you want to deploy
|
||||
- `OPENROUTER_API_KEY`: Your OpenRouter API key for AI features
|
||||
- AWS credentials (optional but recommended)
|
||||
|
||||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||
### Running in Development
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run dev
|
||||
|
||||
# or start the server and open the app in a new browser tab
|
||||
npm run dev -- --open
|
||||
```
|
||||
|
||||
## Building
|
||||
The development server will be available at http://localhost:5173
|
||||
|
||||
To create a production version of your app:
|
||||
### Building for Production
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
npm run preview
|
||||
```
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
## Project Structure
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
||||
- `src/routes/`: Page components and API endpoints
|
||||
- `src/lib/`: Shared components and utilities
|
||||
- `src/lib/components/`: Reusable UI components
|
||||
- `static/`: Static assets (images, fonts, etc.)
|
||||
|
||||
## Features
|
||||
|
||||
- User authentication and profile management
|
||||
- Real-time trading interface
|
||||
- Market visualization with Treemap
|
||||
- Leaderboards and statistics
|
||||
- Integration with websocket server for live updates
|
||||
|
||||
## Contributing
|
||||
|
||||
1. Make sure Redis is running
|
||||
2. Start the websocket server (see `websocket/README.md`)
|
||||
3. Run the website in development mode
|
||||
4. Make your changes
|
||||
5. Test thoroughly
|
||||
6. Submit a pull request
|
||||
|
|
|
|||
92
website/package-lock.json
generated
92
website/package-lock.json
generated
|
|
@ -10,7 +10,6 @@
|
|||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.815.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.815.0",
|
||||
"@sveltejs/adapter-node": "^5.2.12",
|
||||
"@tailwindcss/postcss": "^4.1.7",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"@visx/scale": "^3.12.0",
|
||||
|
|
@ -34,6 +33,7 @@
|
|||
"@internationalized/date": "^3.8.1",
|
||||
"@lucide/svelte": "^0.482.0",
|
||||
"@sveltejs/adapter-auto": "^3.0.0",
|
||||
"@sveltejs/adapter-node": "^5.2.12",
|
||||
"@sveltejs/kit": "^2.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
||||
"@types/canvas-confetti": "^1.9.0",
|
||||
|
|
@ -56,7 +56,8 @@
|
|||
"vite": "^5.4.11"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-linux-x64-gnu": "*"
|
||||
"@rollup/rollup-linux-x64-gnu": "*",
|
||||
"lightningcss-linux-x64-gnu": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@alloc/quick-lru": {
|
||||
|
|
@ -1506,6 +1507,7 @@
|
|||
},
|
||||
"node_modules/@polka/url": {
|
||||
"version": "1.0.0-next.29",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@redis/bloom": {
|
||||
|
|
@ -1562,6 +1564,7 @@
|
|||
"version": "28.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.3.tgz",
|
||||
"integrity": "sha512-pyltgilam1QPdn+Zd9gaCfOLcnjMEJ9gV+bTw6/r73INdvzf1ah9zLIJBm+kW7R6IUFIQ1YO+VqZtYxZNWFPEQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": "^5.0.1",
|
||||
"commondir": "^1.0.1",
|
||||
|
|
@ -1587,6 +1590,7 @@
|
|||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz",
|
||||
"integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/estree": "*"
|
||||
}
|
||||
|
|
@ -1595,6 +1599,7 @@
|
|||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz",
|
||||
"integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": "^5.1.0"
|
||||
},
|
||||
|
|
@ -1614,6 +1619,7 @@
|
|||
"version": "16.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.1.tgz",
|
||||
"integrity": "sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": "^5.0.1",
|
||||
"@types/resolve": "1.20.2",
|
||||
|
|
@ -1637,6 +1643,7 @@
|
|||
"version": "5.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz",
|
||||
"integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/estree": "^1.0.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
|
|
@ -1661,6 +1668,7 @@
|
|||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
|
|
@ -1673,6 +1681,7 @@
|
|||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
|
|
@ -1685,6 +1694,7 @@
|
|||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
|
|
@ -1697,6 +1707,7 @@
|
|||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
|
|
@ -1709,6 +1720,7 @@
|
|||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
|
|
@ -1721,6 +1733,7 @@
|
|||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
|
|
@ -1733,6 +1746,7 @@
|
|||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -1745,6 +1759,7 @@
|
|||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -1757,6 +1772,7 @@
|
|||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -1769,6 +1785,7 @@
|
|||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -1781,6 +1798,7 @@
|
|||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -1793,6 +1811,7 @@
|
|||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -1805,6 +1824,7 @@
|
|||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -1817,6 +1837,7 @@
|
|||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -1829,6 +1850,7 @@
|
|||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -1853,6 +1875,7 @@
|
|||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -1865,6 +1888,7 @@
|
|||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
|
|
@ -1877,6 +1901,7 @@
|
|||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
|
|
@ -1887,6 +1912,7 @@
|
|||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
|
|
@ -2553,6 +2579,8 @@
|
|||
"version": "5.2.12",
|
||||
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-node/-/adapter-node-5.2.12.tgz",
|
||||
"integrity": "sha512-0bp4Yb3jKIEcZWVcJC/L1xXp9zzJS4hDwfb4VITAkfT4OVdkspSHsx7YhqJDbb2hgLl6R9Vs7VQR+fqIVOxPUQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@rollup/plugin-commonjs": "^28.0.1",
|
||||
"@rollup/plugin-json": "^6.1.0",
|
||||
|
|
@ -2565,6 +2593,7 @@
|
|||
},
|
||||
"node_modules/@sveltejs/kit": {
|
||||
"version": "2.21.1",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@sveltejs/acorn-typescript": "^1.0.5",
|
||||
|
|
@ -2594,6 +2623,7 @@
|
|||
},
|
||||
"node_modules/@sveltejs/vite-plugin-svelte": {
|
||||
"version": "4.0.4",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@sveltejs/vite-plugin-svelte-inspector": "^3.0.0-next.0||^3.0.0",
|
||||
|
|
@ -2613,6 +2643,7 @@
|
|||
},
|
||||
"node_modules/@sveltejs/vite-plugin-svelte-inspector": {
|
||||
"version": "3.0.1",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.3.7"
|
||||
|
|
@ -2776,6 +2807,7 @@
|
|||
},
|
||||
"node_modules/@types/cookie": {
|
||||
"version": "0.6.0",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/d3-array": {
|
||||
|
|
@ -2849,7 +2881,8 @@
|
|||
"node_modules/@types/resolve": {
|
||||
"version": "1.20.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz",
|
||||
"integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q=="
|
||||
"integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@visx/scale": {
|
||||
"version": "3.12.0",
|
||||
|
|
@ -3314,7 +3347,8 @@
|
|||
"node_modules/commondir": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
|
||||
"integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg=="
|
||||
"integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/content-disposition": {
|
||||
"version": "1.0.0",
|
||||
|
|
@ -3337,6 +3371,7 @@
|
|||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.6.0",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
|
|
@ -3460,6 +3495,7 @@
|
|||
},
|
||||
"node_modules/deepmerge": {
|
||||
"version": "4.3.1",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
|
|
@ -3500,6 +3536,7 @@
|
|||
},
|
||||
"node_modules/devalue": {
|
||||
"version": "5.1.1",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/drizzle-kit": {
|
||||
|
|
@ -3787,7 +3824,8 @@
|
|||
"node_modules/estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/etag": {
|
||||
"version": "1.8.1",
|
||||
|
|
@ -3898,6 +3936,7 @@
|
|||
},
|
||||
"node_modules/fdir": {
|
||||
"version": "6.4.4",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"picomatch": "^3 || ^4"
|
||||
|
|
@ -3984,6 +4023,7 @@
|
|||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
|
|
@ -4174,6 +4214,7 @@
|
|||
"version": "2.16.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
|
||||
"integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"hasown": "^2.0.2"
|
||||
},
|
||||
|
|
@ -4187,7 +4228,8 @@
|
|||
"node_modules/is-module": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
|
||||
"integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g=="
|
||||
"integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/is-promise": {
|
||||
"version": "4.0.0",
|
||||
|
|
@ -4217,6 +4259,7 @@
|
|||
},
|
||||
"node_modules/kleur": {
|
||||
"version": "4.1.5",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
|
|
@ -4255,6 +4298,26 @@
|
|||
"lightningcss-win32-x64-msvc": "1.30.1"
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-linux-x64-gnu": {
|
||||
"version": "1.30.1",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz",
|
||||
"integrity": "sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 12.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/parcel"
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-win32-x64-msvc": {
|
||||
"version": "1.30.1",
|
||||
"cpu": [
|
||||
|
|
@ -4440,6 +4503,7 @@
|
|||
},
|
||||
"node_modules/mri": {
|
||||
"version": "1.2.0",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
|
|
@ -4447,6 +4511,7 @@
|
|||
},
|
||||
"node_modules/mrmime": {
|
||||
"version": "2.0.1",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
|
|
@ -4621,7 +4686,8 @@
|
|||
"node_modules/path-parse": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "8.2.0",
|
||||
|
|
@ -4639,6 +4705,7 @@
|
|||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
|
||||
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
|
|
@ -4880,6 +4947,7 @@
|
|||
"version": "1.22.10",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz",
|
||||
"integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-core-module": "^2.16.0",
|
||||
"path-parse": "^1.0.7",
|
||||
|
|
@ -4909,6 +4977,7 @@
|
|||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "4.41.0",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/estree": "1.0.7"
|
||||
|
|
@ -4951,6 +5020,7 @@
|
|||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
|
|
@ -4992,6 +5062,7 @@
|
|||
},
|
||||
"node_modules/sade": {
|
||||
"version": "1.8.1",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mri": "^1.1.0"
|
||||
|
|
@ -5216,6 +5287,7 @@
|
|||
},
|
||||
"node_modules/sirv": {
|
||||
"version": "3.0.1",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@polka/url": "^1.0.0-next.24",
|
||||
|
|
@ -5279,6 +5351,7 @@
|
|||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
|
||||
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
|
|
@ -5565,6 +5638,7 @@
|
|||
},
|
||||
"node_modules/totalist": {
|
||||
"version": "3.0.1",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
|
|
@ -5699,6 +5773,7 @@
|
|||
},
|
||||
"node_modules/vite": {
|
||||
"version": "5.4.19",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.21.3",
|
||||
|
|
@ -5756,6 +5831,7 @@
|
|||
},
|
||||
"node_modules/vite/node_modules/esbuild": {
|
||||
"version": "0.21.5",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
|
|
@ -5795,6 +5871,7 @@
|
|||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
|
|
@ -5806,6 +5883,7 @@
|
|||
},
|
||||
"node_modules/vitefu": {
|
||||
"version": "1.0.6",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
"tests/deps/*",
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
"@internationalized/date": "^3.8.1",
|
||||
"@lucide/svelte": "^0.482.0",
|
||||
"@sveltejs/adapter-auto": "^3.0.0",
|
||||
"@sveltejs/adapter-node": "^5.2.12",
|
||||
"@sveltejs/kit": "^2.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
||||
"@types/canvas-confetti": "^1.9.0",
|
||||
|
|
@ -43,7 +44,6 @@
|
|||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.815.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.815.0",
|
||||
"@sveltejs/adapter-node": "^5.2.12",
|
||||
"@tailwindcss/postcss": "^4.1.7",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"@visx/scale": "^3.12.0",
|
||||
|
|
@ -64,6 +64,7 @@
|
|||
"svelte-lightweight-charts": "^2.2.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-linux-x64-gnu": "*"
|
||||
"@rollup/rollup-linux-x64-gnu": "*",
|
||||
"lightningcss-linux-x64-gnu": "*"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,26 @@
|
|||
// src/lib/auth.ts (or your auth config file)
|
||||
import { betterAuth } from "better-auth";
|
||||
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
||||
import { env } from '$env/dynamic/private';
|
||||
import { env as privateEnv } from '$env/dynamic/private';
|
||||
import { env as publicEnv } from '$env/dynamic/public';
|
||||
import { db } from "./server/db";
|
||||
import * as schema from "./server/db/schema";
|
||||
import { generateUsername } from "./utils/random";
|
||||
import { uploadProfilePicture } from "./server/s3";
|
||||
|
||||
if (!env.GOOGLE_CLIENT_ID) throw new Error('GOOGLE_CLIENT_ID is not set');
|
||||
if (!env.GOOGLE_CLIENT_SECRET) throw new Error('GOOGLE_CLIENT_SECRET is not set');
|
||||
if (!privateEnv.GOOGLE_CLIENT_ID) throw new Error('GOOGLE_CLIENT_ID is not set');
|
||||
if (!privateEnv.GOOGLE_CLIENT_SECRET) throw new Error('GOOGLE_CLIENT_SECRET is not set');
|
||||
if (!publicEnv.PUBLIC_BETTER_AUTH_URL) throw new Error('BETTER_AUTH_URL is not set');
|
||||
|
||||
export const auth = betterAuth({
|
||||
baseURL: env.PUBLIC_BETTER_AUTH_URL,
|
||||
secret: env.PRIVATE_BETTER_AUTH_SECRET,
|
||||
baseURL: publicEnv.PUBLIC_BETTER_AUTH_URL,
|
||||
secret: privateEnv.PRIVATE_BETTER_AUTH_SECRET,
|
||||
appName: "Rugplay",
|
||||
|
||||
trustedOrigins: [
|
||||
env.BETTER_AUTH_URL, "http://rugplay.com", "http://localhost:5173",
|
||||
publicEnv.PUBLIC_BETTER_AUTH_URL,
|
||||
"http://rugplay.com",
|
||||
"http://localhost:5173",
|
||||
],
|
||||
|
||||
database: drizzleAdapter(db, {
|
||||
|
|
@ -25,8 +29,8 @@ export const auth = betterAuth({
|
|||
}),
|
||||
socialProviders: {
|
||||
google: {
|
||||
clientId: env.GOOGLE_CLIENT_ID,
|
||||
clientSecret: env.GOOGLE_CLIENT_SECRET,
|
||||
clientId: privateEnv.GOOGLE_CLIENT_ID,
|
||||
clientSecret: privateEnv.GOOGLE_CLIENT_SECRET,
|
||||
mapProfileToUser: async (profile) => {
|
||||
const newUsername = generateUsername();
|
||||
let s3ImageKey: string | null = null;
|
||||
|
|
@ -62,7 +66,7 @@ export const auth = betterAuth({
|
|||
user: {
|
||||
additionalFields: {
|
||||
username: { type: "string", required: true, input: false },
|
||||
isAdmin: { type: "boolean", required: false, input: false },
|
||||
isAdmin: { type: "boolean", required: true, input: false },
|
||||
isBanned: { type: "boolean", required: false, input: false },
|
||||
banReason: { type: "string", required: false, input: false },
|
||||
baseCurrencyBalance: { type: "string", required: false, input: false },
|
||||
|
|
|
|||
|
|
@ -203,13 +203,15 @@
|
|||
|
||||
<!-- Page dots -->
|
||||
<div class="flex items-center justify-center gap-2">
|
||||
{#each tips as _, index}
|
||||
{#each tips as tip, index}
|
||||
<button
|
||||
onclick={() => goToPage(index)}
|
||||
class="h-2 w-2 rounded-full transition-colors {index === currentPage
|
||||
? 'bg-primary'
|
||||
: 'bg-muted-foreground/30 hover:bg-muted-foreground/50'}"
|
||||
/>
|
||||
aria-label={`Go to tip ${index + 1}: ${tip.title}`}
|
||||
aria-current={index === currentPage ? 'page' : undefined}
|
||||
></button>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ export function formatPrice(price: number): string {
|
|||
export function formatValue(value: number | string): string {
|
||||
const numValue = typeof value === 'string' ? parseFloat(value) : value;
|
||||
if (typeof numValue !== 'number' || isNaN(numValue)) return '$0.00';
|
||||
|
||||
if (numValue >= 1e12) return `$${(numValue / 1e12).toFixed(2)}T`;
|
||||
if (numValue >= 1e9) return `$${(numValue / 1e9).toFixed(2)}B`;
|
||||
if (numValue >= 1e6) return `$${(numValue / 1e6).toFixed(2)}M`;
|
||||
if (numValue >= 1e3) return `$${(numValue / 1e3).toFixed(2)}K`;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,32 @@
|
|||
# websocket
|
||||
# Websocket Server
|
||||
|
||||
To install dependencies:
|
||||
This is the websocket server component of Rugplay, built with [Bun](https://bun.sh) - a fast all-in-one JavaScript runtime.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Bun](https://bun.sh) (v1.2.11 or later)
|
||||
- [Redis](https://redis.io/downloads/) running in the background
|
||||
|
||||
## Development
|
||||
|
||||
### Initial Setup
|
||||
|
||||
```bash
|
||||
bun install
|
||||
```
|
||||
|
||||
To run:
|
||||
### Running the Server
|
||||
|
||||
```bash
|
||||
bun run src/main.ts
|
||||
```
|
||||
|
||||
This project was created using `bun init` in bun v1.2.11. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
||||
## Production
|
||||
|
||||
For production deployment, you do not need to start the WebSocket server separately. Simply run `build.sh` in the main directory, and the WebSocket server will be included as part of the deployment process.
|
||||
|
||||
## Notes
|
||||
|
||||
- This project was created using `bun init` in bun v1.2.11
|
||||
- The websocket server handles real-time updates for the trading platform
|
||||
- Make sure Redis is running before starting the server
|
||||
|
|
|
|||
Reference in a new issue