Peacemanguy commited on
Commit
4d356ec
·
1 Parent(s): fe02ff1

restored readme

Browse files
Files changed (1) hide show
  1. README.md +11 -159
README.md CHANGED
@@ -1,159 +1,11 @@
1
- # GPU Leaderboard Application - Docker Setup
2
-
3
- This repository contains a Node.js application for GPU leaderboards with Docker configuration for easy deployment.
4
-
5
- ## Features
6
-
7
- - Main server for user voting and interaction
8
- - Admin server for managing entries
9
- - Persistent data storage
10
- - One vote per IP address per category
11
- - Custom start script to run both servers in a single container
12
- - **Weekly leaderboard archiving system**
13
- - Automatic archiving at the end of each week
14
- - Historical data stored in a catalogued format
15
- - View archived results by week or date range
16
-
17
- ## Docker Setup
18
-
19
- ### Prerequisites
20
-
21
- - Docker
22
- - Docker Compose
23
-
24
- ### Running the Application
25
-
26
- 1. Clone this repository
27
- 2. Navigate to the project directory
28
- 3. Build and start the containers:
29
-
30
- #### Option 1: Using the provided script
31
-
32
- - Windows: Double-click the `docker-run.bat` file
33
- - Linux/Mac: Run `./docker-run.sh` (make it executable first with `chmod +x docker-run.sh`)
34
-
35
- #### Option 2: Using Docker Compose directly
36
-
37
- ```bash
38
- docker-compose up -d
39
- ```
40
-
41
- 4. Access the application:
42
- - Main application: http://localhost:3000
43
- - Admin interface: http://localhost:6969/admin
44
- - Default admin credentials:
45
- - Username: admin
46
- - Password: secure_password123 (you should change this in admin_server.js)
47
-
48
- ### Stopping the Application
49
-
50
- ```bash
51
- docker-compose down
52
- ```
53
-
54
- ## Data Persistence
55
-
56
- All data is stored in the `./data` directory, which is mounted as a volume in the Docker container. This ensures that your data persists even if the container is removed.
57
-
58
- ## Ports
59
-
60
- - 3000: Main application server
61
- - 6969: Admin server
62
-
63
- ## Environment Variables
64
-
65
- You can customize the application by modifying the `.env` file:
66
-
67
- ```
68
- # Main server configuration
69
- PORT=3000
70
- NODE_ENV=production
71
-
72
- # Admin server configuration
73
- ADMIN_PORT=6969
74
- ```
75
-
76
- These variables are used in the `docker-compose.yml` file and passed to the application.
77
-
78
- ## Weekly Archiving System
79
-
80
- The system automatically archives the current leaderboard data at the end of each week (Sunday at 23:59). Each archive includes:
81
-
82
- - Week identifier (e.g., 2025-W17)
83
- - Start and end dates of the week
84
- - Timestamp when the archive was created
85
- - Complete snapshot of the leaderboard data
86
-
87
- ### Accessing Archived Data
88
-
89
- #### User Interface
90
-
91
- Users can access archived leaderboards through the main interface by clicking the "Archives" button. From there, they can:
92
-
93
- 1. Select a specific week from the dropdown menu
94
- 2. Search archives by date range
95
- 3. View detailed results for each archived period
96
-
97
- #### Admin Interface
98
-
99
- Administrators have additional capabilities:
100
-
101
- 1. View all archived weeks
102
- 2. Search archives by date range
103
- 3. Manually trigger archiving of the current leaderboard
104
- 4. View detailed statistics for each archived period
105
-
106
- ### Running the Archiving System
107
-
108
- ```bash
109
- # Start the weekly archiving scheduler
110
- npm run start-scheduler
111
-
112
- # Manually archive the current week
113
- npm run archive-week
114
- ```
115
-
116
- ### API Endpoints for Archives
117
-
118
- - `GET /api/archives/weeks` - Get list of all archived weeks
119
- - `GET /api/archives/week/:weekId` - Get archived data for a specific week
120
- - `GET /api/archives/week/:weekId/category/:category` - Get archived data for a specific week and category
121
- - `GET /api/archives/range?startDate=<date>&endDate=<date>` - Get archived data for a date range
122
-
123
- ## Security Notes
124
-
125
- - For production use, consider changing the admin credentials in `admin_server.js`
126
- - Consider adding HTTPS for secure connections
127
- - Review the session configuration in `admin_server.js` for production use
128
-
129
- ## Architecture
130
-
131
- ### Docker Setup
132
-
133
- The application is containerized using Docker with the following components:
134
-
135
- - **Dockerfile**: Builds a Node.js Alpine container with the application code
136
- - **docker-compose.yml**: Orchestrates the container and sets up networking and volumes
137
- - **docker-entrypoint.sh**: Initializes the data directory and files before starting the application
138
- - **start.js**: Custom Node.js script that runs both the main server and admin server in a single container
139
-
140
- ### Custom Start Script
141
-
142
- Instead of using npm scripts with concurrently, we use a custom Node.js script (`start.js`) to run both servers. This approach:
143
-
144
- - Provides better process management in the Docker container
145
- - Ensures proper handling of signals for graceful shutdown
146
- - Simplifies logging by inheriting stdio from the parent process
147
- - Avoids potential issues with npm scripts in containerized environments
148
-
149
- ### Data Persistence
150
-
151
- All data is stored in JSON files in the `./data` directory, which is mounted as a volume in the Docker container. This ensures that:
152
-
153
- - Data persists across container restarts and rebuilds
154
- - Files can be backed up easily from the host machine
155
- - Multiple containers can share the same data if needed
156
-
157
- ## License
158
-
159
- ISC
 
1
+ ---
2
+ title: LLMChoice
3
+ emoji: 🚀
4
+ colorFrom: green
5
+ colorTo: green
6
+ sdk: docker
7
+ pinned: false
8
+ short_description: What LLMs are you using this week?
9
+ ---
10
+
11
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference