{"id":22881147,"url":"https://github.com/mdxprograms/pocket-express","last_synced_at":"2025-03-31T15:49:41.459Z","repository":{"id":267886284,"uuid":"901670136","full_name":"mdxprograms/pocket-express","owner":"mdxprograms","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-13T17:41:50.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T21:29:06.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/mdxprograms.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}},"created_at":"2024-12-11T05:10:24.000Z","updated_at":"2024-12-13T20:15:28.000Z","dependencies_parsed_at":"2024-12-13T03:27:35.558Z","dependency_job_id":"344ac32e-5739-4332-badb-7cc8fbcae221","html_url":"https://github.com/mdxprograms/pocket-express","commit_stats":null,"previous_names":["mdxprograms/pocket-express"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fpocket-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fpocket-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fpocket-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Fpocket-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdxprograms","download_url":"https://codeload.github.com/mdxprograms/pocket-express/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246491479,"owners_count":20786187,"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":[],"created_at":"2024-12-13T17:31:05.298Z","updated_at":"2025-03-31T15:49:41.435Z","avatar_url":"https://github.com/mdxprograms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express and PocketHost Server\n\nThis project is a web application using **Express.js**, **PocketBase**, and **Pug** for rendering views. It includes user authentication, session management, and secure routing for a dynamic web experience.\n\n## Requirements\n\n### **Environment Variables**\nThe application uses the following environment variables:\n\n- **`PORT`**: The port number where the server runs (default is `3000`).\n- **`SESSION_SECRET`**: A secret key for managing session encryption. Use a strong, random string.\n- **`POCKETHOST_BASE_URL`**: The base URL of your PocketBase instance.\n- **`NODE_ENV`**: node environment (local -\u003e NODE_ENV=development)\n\nCreate a `.env` file in the root of your project with the following structure:\n\n```plaintext\n# Server Configuration\nPORT=3000\n\n# Session Configuration\nSESSION_SECRET=your_super_secret_key\n\n# PocketBase Configuration\nPOCKETHOST_BASE_URL=https://your-pocketbase-instance.com\n```\n\nEnsure `.env` is listed in your `.gitignore` file to avoid committing sensitive information.\n\n---\n\n### **Folder Structure**\n\nThe project follows this structure:\n\n```\n/project-root\n├── /public                 # Static assets (CSS, JS, images)\n│   ├── /css                # Tailwind CSS output\n│   ├── /js                 # Client-side scripts\n│   └── ...\n├── /views                 \n│   ├── /layouts            # Base layouts for Pug views\n│   ├── /user               # User-specific views (e.g., login)\n│   └── ...\n├── /routes                 # API routes\n├── /middleware             # Middleware logic\n├── .env                    # Environment variables\n├── server.js               # Main server file\n└── README.md               # Documentation\n```\n\n---\n\n### **Running the Project**\n\n1. Ensure you have `nvm` (Node Version Manager) installed. Use `nvm` to manage and apply the correct Node.js version:\n   ```bash\n   nvm use\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n3. Start the development server with live reload:\n   ```bash\n   npm start\n   ```\n\n4. For production, build the CSS and serve:\n   ```bash\n   npm run build:all\n   npm run serve\n   ```\n\n---\n\n### **Features**\n\n- **Authentication**: Login and session management using PocketBase.\n- **Secure Routes**: Middleware-protected endpoints for authorized users.\n- **Dynamic Views**: Server-side rendering with Pug.\n- **Static Assets**: Tailwind CSS for styling, served from the `public` directory.\n\n---\n\n### **Contributing**\n\n1. Fork the repository.\n2. Create a new feature branch.\n3. Commit your changes.\n4. Submit a pull request.\n\n---\n\n### **License**\n\nMIT License. See `LICENSE` file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdxprograms%2Fpocket-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdxprograms%2Fpocket-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdxprograms%2Fpocket-express/lists"}