{"id":27969643,"url":"https://github.com/al0olo/awesome-express","last_synced_at":"2025-05-07T21:49:50.167Z","repository":{"id":291906724,"uuid":"979179058","full_name":"Al0olo/awesome-express","owner":"Al0olo","description":"An enhanced Express framework with HTTP/2 support and CLI tools for rapid application development.","archived":false,"fork":false,"pushed_at":"2025-05-07T09:28:49.000Z","size":286,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-05-07T21:49:44.342Z","etag":null,"topics":["express","http2","nodejs","npm-package","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/awesome-express","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Al0olo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-05-07T05:51:48.000Z","updated_at":"2025-05-07T08:45:44.000Z","dependencies_parsed_at":"2025-05-07T06:44:19.517Z","dependency_job_id":null,"html_url":"https://github.com/Al0olo/awesome-express","commit_stats":null,"previous_names":["al0olo/awesome-express","al0olo/express-http2"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al0olo%2Fawesome-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al0olo%2Fawesome-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al0olo%2Fawesome-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al0olo%2Fawesome-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Al0olo","download_url":"https://codeload.github.com/Al0olo/awesome-express/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252961858,"owners_count":21832193,"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":["express","http2","nodejs","npm-package","typescript"],"created_at":"2025-05-07T21:49:49.485Z","updated_at":"2025-05-07T21:49:50.106Z","avatar_url":"https://github.com/Al0olo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# awesome-express\n\n[![npm version](https://img.shields.io/npm/v/awesome-express.svg)](https://www.npmjs.com/package/awesome-express)\n[![License](https://img.shields.io/npm/l/awesome-express.svg)](https://github.com/al0olo/awesome-express/blob/main/LICENSE)\n\nAn enhanced Express framework with HTTP/2 support and CLI tools for rapid application development.\n\n## Features\n\n- **HTTP/2 Support**: Built-in HTTP/2 server configuration for Express\n- **Dual HTTP/HTTPS**: HTTP for easier local development, HTTPS with HTTP/2 for production\n- **CLI Tool**: Quickly generate new projects and components\n- **MVC Pattern**: Organized project structure with models, views, and controllers\n- **SSL Certificate Management**: Automatic setup with certbot\n- **TypeScript Support**: First-class TypeScript support out of the box\n- **JWT Authentication**: Ready-to-use JWT authentication with token generation and route protection\n\n## Installation\n\n```bash\nnpm install -g awesome-express\n```\n\n## Quick Start\n\nCreate a new project:\n\n```bash\nawesome-express new my-app\ncd my-app\n```\n\nThe project is ready to use with both HTTP and HTTPS:\n\n```bash\nnpm run dev\n```\n\nAccess your server at:\n- HTTP: `http://localhost:3001` (for easy local development)\n- HTTPS: `https://localhost:3000` (HTTP/2 enabled)\n\nDevelopment SSL certificates are automatically generated during project creation.\n\n## CLI Commands\n\n### Creating a New Project\n\n```bash\nawesome-express new \u003capp-name\u003e\n```\n\nOptions:\n- `-d, --directory \u003cdirectory\u003e`: Specify a custom directory\n- `--skip-install`: Skip installing dependencies\n- `--skip-git`: Skip git initialization\n\n### Generating Components\n\nGenerate a controller:\n\n```bash\nawesome-express generate controller UserController\n# or using the alias\nawesome-express g controller UserController\n```\n\nGenerate a model:\n\n```bash\nawesome-express g model User\n```\n\nGenerate a route:\n\n```bash\nawesome-express g route User\n```\n\nGenerate JWT authentication:\n\n```bash\nawesome-express g auth\n```\n\n### Setting up SSL Certificates\n\n```bash\nawesome-express certbot\n```\n\nOptions:\n- `-d, --domain \u003cdomain\u003e`: Domain name\n- `-e, --email \u003cemail\u003e`: Email address (for Let's Encrypt notifications)\n\n## Project Structure\n\nWhen you create a new project, it follows this structure:\n\n```\n.\n├── certs/                # SSL certificates\n├── scripts/              # Utility scripts\n├── src/                  # Source code\n│   ├── config/           # Configuration files\n│   ├── controllers/      # Route controllers\n│   ├── middleware/       # Express middleware\n│   ├── models/           # Data models\n│   ├── public/           # Static files\n│   ├── routes/           # Routes definitions\n│   ├── views/            # View templates\n│   ├── app.ts            # Express app setup\n│   └── server.ts         # HTTP/2 server entry point\n├── .env                  # Environment variables (configures HTTP_PORT and PORT)\n├── package.json\n└── tsconfig.json\n```\n\n## Configuration\n\nBy default, servers run on the following ports:\n- Development HTTP server: Port 3001 (configurable via `HTTP_PORT` in .env)\n- HTTP/2 HTTPS server: Port 3000 (configurable via `PORT` in .env)\n\n## HTTP/2 API\n\nThe framework provides a simple API for setting up HTTP/2 servers with Express:\n\n```typescript\nimport { createHttp2App, startHttp2Server } from 'awesome-express';\n\n// Create an Express app with HTTP/2 support\nconst app = createHttp2App();\n\n// Configure your app\napp.get('/', (req, res) =\u003e {\n  res.json({ message: 'Hello from HTTP/2!' });\n});\n\n// Start the HTTP/2 server\nstartHttp2Server(app, {\n  cert: '/path/to/cert.pem',\n  key: '/path/to/key.pem',\n  port: 3000\n});\n```\n\n## JWT Authentication\n\nThe framework includes a ready-to-use JWT authentication system that can be added during project creation or to an existing project.\n\n### Adding Authentication\n\nDuring project creation:\n```bash\nawesome-express new my-app --include-auth\n```\n\nOr to an existing project:\n```bash\nawesome-express g auth\n```\n\n### Authentication Features\n\n- **Token Generation \u0026 Verification**: Complete JWT token lifecycle management\n- **Pre-configured Routes**: Ready-to-use login, register, and refresh endpoints\n- **Route Protection**: Middleware for securing API endpoints\n- **TypeScript Decorators**: `@RequireAuth()` decorator for controller methods\n\n### Available Endpoints\n\nOnce integrated, the following endpoints become available:\n\n- `POST /auth/register` - Create a new user\n- `POST /auth/login` - Authenticate a user\n- `POST /auth/refresh-token` - Refresh an expired access token\n- `GET /auth/profile` - Get user profile (protected route)\n\n### Example Usage\n\nProtecting a route:\n\n```typescript\nimport { createJwtAuth } from './auth';\n\nconst jwtAuth = createJwtAuth({ secret: process.env.JWT_SECRET });\n\nrouter.get('/api/protected', jwtAuth.verifyToken, (req, res) =\u003e {\n  res.json({\n    message: 'This is a protected endpoint',\n    user: req.user\n  });\n});\n```\n\n### Customization\n\nThe authentication system is designed as a template that works out of the box but is meant to be extended with your own database implementation. It provides the JWT infrastructure while letting you implement your own user storage logic.\n\n## License\n\nMIT ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal0olo%2Fawesome-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal0olo%2Fawesome-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal0olo%2Fawesome-express/lists"}