{"id":17712580,"url":"https://github.com/niravjoshi33/express-ts-drizzle-template","last_synced_at":"2026-02-10T17:37:22.045Z","repository":{"id":258461676,"uuid":"873944436","full_name":"NiravJoshi33/express-ts-drizzle-template","owner":"NiravJoshi33","description":"Basic Express Template with Typescript, Basic Auth, Drizzle ORM, \u0026 SQLite Database","archived":false,"fork":false,"pushed_at":"2024-10-19T15:19:40.000Z","size":98,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-21T10:34:17.412Z","etag":null,"topics":["authentication","drizzle-orm","express","lucia-auth","sqlite","template","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NiravJoshi33.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-17T01:43:10.000Z","updated_at":"2024-10-19T15:29:14.000Z","dependencies_parsed_at":"2024-10-21T12:06:00.120Z","dependency_job_id":null,"html_url":"https://github.com/NiravJoshi33/express-ts-drizzle-template","commit_stats":null,"previous_names":["niravjoshi33/express-ts-drizzle-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiravJoshi33%2Fexpress-ts-drizzle-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiravJoshi33%2Fexpress-ts-drizzle-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiravJoshi33%2Fexpress-ts-drizzle-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiravJoshi33%2Fexpress-ts-drizzle-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NiravJoshi33","download_url":"https://codeload.github.com/NiravJoshi33/express-ts-drizzle-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252531834,"owners_count":21763290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","drizzle-orm","express","lucia-auth","sqlite","template","typescript"],"created_at":"2024-10-25T09:05:37.781Z","updated_at":"2026-02-10T17:37:21.985Z","avatar_url":"https://github.com/NiravJoshi33.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express TypeScript Drizzle Template\n\nThis is a comprehensive template for building robust backend applications using Express, TypeScript, and Drizzle ORM. It provides a solid foundation for creating scalable, maintainable, and secure server-side applications.\n\n## Features\n\n- **Express Server**: Fast, unopinionated, minimalist web framework for Node.js\n- **TypeScript Support**: Adds static typing to JavaScript, enhancing code quality and developer productivity\n- **Drizzle ORM**: Modern TypeScript ORM for SQL databases with a focus on type safety\n- **SQLite Database**: Lightweight, serverless database for easier setup and development\n- **User Authentication**: Secure user authentication system inspired by [Lucia-auth](https://lucia-next.pages.dev/)\n- **Session Management**: Efficient handling of user sessions\n- **Error Handling Middleware**: Centralized error handling for consistent error responses\n- **Rate Limiting**: Protects against brute-force attacks and ensures fair usage\n- **Security Middleware**: Implements best practices for web application security\n- **Input Validation**: Uses Zod for robust and type-safe input validation\n- **CORS Support**: Handles Cross-Origin Resource Sharing for frontend integration\n- **Cookie Parsing**: Efficiently manages client-side cookies\n\n## Prerequisites\n\n- Node.js (v14 or later)\n- npm (v6 or later)\n\n## Getting Started\n\n1. Clone the repository:\n\n   ```\n   git clone https://github.com/NiravJoshi33/express-ts-drizzle-template.git\n   cd express-ts-drizzle-template\n   ```\n\n2. Install dependencies:\n\n   ```\n   npm install\n   ```\n\n3. Set up environment variables:\n\n   - Copy the `.env.example` file to `.env`\n   - Update the values in `.env` as needed\n\n4. Start the development server:\n\n   ```\n   npm run dev\n   ```\n\n   This will start the server using `tsx watch`, which will automatically restart the server when changes are detected.\n\n5. For production, build and start the server:\n   ```\n   npm run build\n   npm start\n   ```\n\nThe server will start on the port specified in your `.env` file (default is 3000). You can now make requests to `http://localhost:3000/api/v1` (or whatever port and prefix you've configured).\n\nNote: Make sure to run database migrations before starting the server for the first time:\n\n## Project Structure\n\nThe project structure is organized as follows:\n\n- `src/`: Contains the main source code of the application.\n\n  - `db/`: Contains the database configuration and schema definitions.\n\n  - `handlers/`: Contains the route handlers for different endpoints.\n\n  - `middleware/`: Contains custom middleware functions.\n\n  - `models/`: Contains data models and validation schemas.\n\n  - `routes/`: Contains the route definitions.\n\n  - `utils/`: Contains utility functions and configuration.\n\n- `drizzle.config.ts`: Configuration file for Drizzle.\n\n- `migrate.ts`: Script for running database migrations.\n\n- `tsconfig.json`: TypeScript configuration file.\n\n## Database\n\nThe template uses SQLite as the database and Drizzle ORM for database management. The database schema is defined in the `src/db/schema` directory.\n\nTo generate new migration files, run:\n\n```\nnpm run db:generate\n```\n\nTo run the database migrations, use:\n\n```\nnpm run db:migrate\n```\n\n## Contributing\n\nContributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniravjoshi33%2Fexpress-ts-drizzle-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniravjoshi33%2Fexpress-ts-drizzle-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniravjoshi33%2Fexpress-ts-drizzle-template/lists"}