{"id":23491478,"url":"https://github.com/sarwar-asik/ready-serverprismapostgres","last_synced_at":"2026-04-30T10:08:57.665Z","repository":{"id":250032822,"uuid":"685847481","full_name":"sarwar-asik/ready-serverPrismaPostgres","owner":"sarwar-asik","description":"Prisma Express, PostgreSQL,JWT, Husky,logger,uncaught error with TypeScript  Server built for fast cloning","archived":false,"fork":false,"pushed_at":"2025-02-04T12:24:51.000Z","size":4312,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T01:45:58.675Z","etag":null,"topics":["aws-s3","compression","husky","jwt-authentication","postgresql","prisma","security-audit","swagger","swagger-ui","typescript","winstone"],"latest_commit_sha":null,"homepage":"","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/sarwar-asik.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":"2023-09-01T06:33:22.000Z","updated_at":"2025-02-04T12:24:55.000Z","dependencies_parsed_at":"2025-02-04T13:35:10.856Z","dependency_job_id":null,"html_url":"https://github.com/sarwar-asik/ready-serverPrismaPostgres","commit_stats":null,"previous_names":["sarwar-asik/ready-serverprismapostgres"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sarwar-asik/ready-serverPrismaPostgres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Fready-serverPrismaPostgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Fready-serverPrismaPostgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Fready-serverPrismaPostgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Fready-serverPrismaPostgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarwar-asik","download_url":"https://codeload.github.com/sarwar-asik/ready-serverPrismaPostgres/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarwar-asik%2Fready-serverPrismaPostgres/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32460940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aws-s3","compression","husky","jwt-authentication","postgresql","prisma","security-audit","swagger","swagger-ui","typescript","winstone"],"created_at":"2024-12-25T01:27:58.144Z","updated_at":"2026-04-30T10:08:57.649Z","avatar_url":"https://github.com/sarwar-asik.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗺️ Ready PostgreSQL Backend\n\nA advance backend boilerplate with modern secure high demand features\n\n## 🚀 Overview\n\nReady PostgreSQL Backend is a TypeScript-based Express.js application that provides a secure and scalable API. It uses Prisma as an ORM and implements various security features and optimizations.\n\n## 🛠️ Tech Stack\n\n- **Runtime Environment:** Node.js\n- **Framework:** Express.js\n- **Language:** TypeScript\n- **Database ORM:** Prisma\n- **Authentication:** JWT, Cookie-based\n- **Security:** \n  - Rate Limiting\n  - CORS\n  - Compression\n  - Cookie Parser\n- **Development Tools:**\n  - ESLint\n  - Prettier\n  - Husky (Git Hooks)\n  - ts-node-dev\n\n## ✨ Features\n\n- **Authentication \u0026 Authorization**\n  - JWT-based authentication\n  - Secure cookie handling\n  - Role-based access control\n\n- **API Security**\n  - Rate limiting to prevent abuse\n  - CORS configuration\n  - Request compression\n  - Error handling middleware\n\n- **Development Features**\n  - Hot reloading\n  - TypeScript support\n  - Code formatting and linting\n  - Git hooks for code quality\n  - CI/CD with GitHub Actions\n  - Docker support\n  - AWS S3 for file storage\n  - Cloudinary for image processing\n  - Nodemailer for email sending\n  - Swagger for API documentation\n  - Sentry for error monitoring\n  - Docker Compose for easy local development\n\n## 🚦 Getting Started\n\n### Prerequisites\n\n- Node.js (v14 or higher)\n- npm or yarn or pnpm\n- PostgreSQL database\n\n### Environment Setup\n\nCreate a `.env` file in the root directory with the following variables:\n\n```env\n\n#------Server\nNODE_ENV=development\nPORT=5000\nSERVER_NAME=\"Ready Backend\"\n\n#------Database\nDATABASE_URL=\"postgresql://postgres:pass_your@127.0.0.1:5432/ready-backend_db?schema=public\"\nSHADOW_DATABASE_URL='postgresql://postgres:pass_your@127.0.0.1:5432/ready-backend_db?schema=public'\n\n#----------Security\nBCRYPT_SALT_ROUNDS=12\nJWT_SECRET=your-secret\nJWT_EXPIRES_IN=1d\nJWT_REFRESH_SECRET=very-refresh-secret\nJWT_REFRESH_EXPIRES_IN=365d\nSERVER_URL='http://localhost:5001'\n\n#---------Cloudinary\nCLOUDINARY_CLOUD_NAME=\"sadfasdfasd\"\nCLOUDINARY_API_KEY=\"234512342314\"\nCLOUDINARY_API_SECRET=\"1234342345\"\n\n#---------AWS S3\nS3_BUCKET=\"ready-backend\"\nS3_REGION=\"ap-southeast-1\"\nS3_ACCESS_KEY_ID=\"EXAMPLEKEYID\"\nS3_SECRET_ACCESS_KEY=\"EXAMPLE_example\"\n\n#---------SMTP\nFRONTEND_URL = \"\"\n# SMTP_USER=your-email@gmail.com\n# SMTP_PASS=your-app-password\n\nSMTP_HOST='smtp.gmail.com'\nSMTP_PORT=587\nSMTP_SECURE=false\nSMTP_USER='sarwarasik@gmail.com'\nSMTP_PASS='example example example'\n\n\n#---------Default Password\nSUPER_ADMIN_EMAIL=admin@gmail.com\nSUPER_ADMIN_PASSWORD=adminPass\n\n\n\n```\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone [repository-url]\ncd ready-backend\n```\n\n2. Install dependencies:\n```bash\nyarn install\n# or\nnpm install\n```\n\n3. Run database migrations:\n```bash\nnpx prisma migrate dev\n```\n\n4. Start the development server:\n```bash\nyarn dev\n# or\nnpm run dev\n```\n\n## 📝 Available Scripts\n\n- `yarn start`: Start production server\n- `yarn dev`: Start development server with hot reloading\n- `yarn build`: Build the TypeScript project\n- `yarn lint:check`: Check for linting issues\n- `yarn lint:fix`: Fix linting issues\n- `yarn prettier:check`: Check code formatting\n- `yarn prettier:fix`: Fix code formatting\n- `yarn lint-prettier`: Run both lint and prettier checks\n\n## 🔒 API Security Features\n\n- Rate limiting configuration to prevent abuse\n- CORS setup for development and production\n- Request compression for better performance\n- Secure cookie handling\n- Global error handling middleware\n\n## 🔄 CI/CD with GitHub Actions\n\nThis project uses GitHub Actions for continuous integration and deployment. Our workflow automatically:\n\n- Builds the application\n- Runs tests\n- Checks code quality\n- Deploys to production (when merging to main branch)\n\n### Example Workflow Run:\n\n![GitHub Actions Workflow](logs/git-actions.png)\n\n### Workflow Features:\n\n- Automatic builds on push and pull requests\n- Node.js environment setup\n- Dependency caching for faster builds\n- Environment variable handling\n- Deployment automation\n\nTo view detailed workflow configurations, check `.github/workflows/build-deploy.yml`.\n\n## 📁 File Upload Features\n\nThe backend supports file uploads with the following features:\n- Image upload support for user profiles\n- Automatic directory creation for uploads\n- File type validation\n- Size limits and optimization\n- Secure file storage\n\n## 👤 User Management\n\n- Role-based access control (User, Admin, Super Admin)\n- Super Admin seeding on first startup\n- Profile management with image upload\n- Secure password handling\n- Email verification\n\n## 🔐 Authentication Features\n\n- JWT-based authentication\n- Refresh token support\n- Password reset functionality\n- Email verification\n- Session management\n- Rate limiting on auth endpoints\n\n## 🐳 Docker Setup\n\n### Using Docker Compose (Recommended)\n\n1. Start all services:\n```bash\ndocker-compose up -d\n```\n\n2. Stop all services:\n```bash\ndocker-compose down\n```\n\n3. View logs:\n```bash\ndocker-compose logs -f api\n```\n\n### Manual Docker Build\n\n1. Build the Docker image:\n```bash\ndocker build -t ready-backend .\n```\n\n2. Run the container:\n```bash\ndocker run -p 5000:5000 --env-file .env ready-backend\n```\n\n### Docker Configuration\n\nThe project includes:\n- Multi-stage build optimization\n- Production-ready Node.js configuration\n- PostgreSQL database container\n- Volume persistence for database\n- Hot-reloading for development\n- Automatic container restart\n- Network isolation\n\n### Docker Files\n- `Dockerfile`: Multi-stage build configuration\n- `docker-compose.yml`: Service orchestration\n- `.dockerignore`: Build optimization\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 👥 Authors\n\n- [Sarwar Hossin](https://github.com/sarwar-asik)\n\n## 🙏 Acknowledgments\n\n- Express.js community\n- Prisma team\n- TypeScript team\n\n\u003c!-- \n[![autocomplete](https://codeium.com/badges/user/sarwar-asik/autocomplete)](https://codeium.com/profile/sarwar-asik)\n\n\n\n[![streak](https://codeium.com/badges/v2/user/sarwar-asik/streak)](https://codeium.com/profile/sarwar-asik) --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarwar-asik%2Fready-serverprismapostgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarwar-asik%2Fready-serverprismapostgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarwar-asik%2Fready-serverprismapostgres/lists"}