src/db/schema.tsshould be updated with your database schemasrc/cfg.tsshould be updated with your configuration format for thesheet-cfg.jsonfilecredentials.jsonsheet-cfg.json- envirement veriable
DATABASE_URLfor the database connection string
- Format for
sheet-cfg.jsonfile
{
"east": {
"spreadsheetID": "[Spreadsheet ID]",
"sheet": "[Sheet name]",
"playerIdColumn": [Column number],
"statusColumn": "[status column letter]",
"statusColumnID": [status column number],
"rank": {
"column": "[rank column letter]",
"columnID": [rank column number],
"dbKey": "[rank db key]",
"levels": ["N/A"]
}
},
"west": {...},
"independent": {...}
}Anything other then spreadsheetID, sheet, playerIdColumn, statusColumn, statusColumnID is treated as a rank/wl level.
The constab is special and not as other ranks as it is a value to value not a value to index.
-
Obtain a
credentials.jsonfile from the google cloud console with access to google sheets api. -
Fill in the
src/db/schema.tswith your database schema
export const playersTable = mysqlTable("players", {
playerid: varchar({ length: 64 }).notNull(),
whatever: mysqlEnum(["0", "1"]).default("0").notNull(),
});- Fill in the
src/cfg.tswith your configuration format for thesheet-cfg.jsonfile
const configSchema = z.object({
east: z.object({}),
west: z.object({
whatever: levelSchema,
}),
independent: z.object({}),
});docker build -t <image-name> .docker-compose.yml
services:
web:
image: <image-name>
ports:
- 3000:3000/tcp
environment:
- DATABASE_URL=
volumes:
- ./credentials.json:/usr/app/credentials.json:ro
- ./sheet-cfg.json:/usr/app/sheet-cfg.json:ro-
bun install
credentials.jsonandsheet-cfg.jsonshould be in the root directory- copy the
.env.exampleto.envand fill in the database connection string
bun run dev