Emails
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v107View latest version
- Val Town: The primary platform for hosting and running the webmail application, providing serverless capabilities for HTTP and email triggers.
- Deno: The runtime environment used by Val Town for executing TypeScript code, ensuring compatibility with modern JavaScript features.
- SQLite: The database solution provided by Val Town for persistent storage of email data.
- Drizzle ORM: An Object-Relational Mapping tool used for type-safe database interactions with SQLite, enhancing maintainability over raw SQL.
- TypeScript: The programming language used for writing the application, ensuring type safety and better development experience.
- @libsql/client: A library used with Drizzle ORM to interact with SQLite databases in a way compatible with Val Town's environment.
- Val Town Environment: Scripts are deployed as vals within Val Town, with
webmail.tsserving as an HTTP endpoint andreciever.tsas an email trigger. - Code Structure: Organized into
webmail.tsfor frontend and data fetching,reciever.tsfor email processing, andshared/db/schema.tsfor database schema definitions.
- Serverless Limitations: Must operate within Val Town's serverless constraints, affecting how migrations and file management are handled.
- SQLite Compatibility: Need to ensure database operations are compatible with Val Town's SQLite implementation, using
@libsql/clientfor connectivity.
- Val Town Standard Libraries: Utilizes
sqlitefromhttps://esm.town/v/std/sqlitefor initial database access. - Drizzle ORM Packages: Includes
npm:drizzle-orm,npm:drizzle-orm/libsql, andnpm:@libsql/clientfor ORM functionality and database connectivity. - No External Secrets: Following Val Town best practices, no API keys or secrets are hardcoded; environment variables would be used if needed.
- Drizzle ORM Query Builder: Used for constructing type-safe queries and inserts in both
webmail.tsandreciever.ts. - Migration Management: Drizzle ORM's migration system is set up for schema management, pending user-provided migration files or alternative strategies.