Initial commit: Custom Start Page application with authentication and DynamoDB storage

This commit is contained in:
2026-02-18 22:06:43 -05:00
commit 7175ff14ba
47 changed files with 7592 additions and 0 deletions

45
cmd/server/init_tables.go Normal file
View File

@@ -0,0 +1,45 @@
package main
import (
"context"
"fmt"
"log"
"os"
"custom-start-page/internal/storage"
)
// InitializeTables creates all required DynamoDB tables
func InitializeTables() error {
ctx := context.Background()
// Get DynamoDB endpoint from environment (for local development)
endpoint := os.Getenv("DYNAMODB_ENDPOINT")
if endpoint == "" {
endpoint = "http://localhost:8000" // Default for DynamoDB local
}
// Create DynamoDB client
db, err := storage.NewDynamoDBClient(ctx, endpoint)
if err != nil {
return fmt.Errorf("failed to create DynamoDB client: %w", err)
}
log.Println("Creating Users table...")
if err := db.CreateUsersTable(ctx); err != nil {
return fmt.Errorf("failed to create Users table: %w", err)
}
log.Println("Users table created successfully")
// TODO: Add other table creation calls here as they are implemented
// - Pages table
// - Widgets table
// - Bookmarks table
// - Notes table
// - TagAssociations table
// - Groups table
// - SharedItems table
// - Preferences table
return nil
}