{"id":28321920,"url":"https://github.com/kubaparol/nestjs-authentication-starter","last_synced_at":"2026-05-19T07:02:24.999Z","repository":{"id":271870440,"uuid":"896857765","full_name":"kubaparol/nestjs-authentication-starter","owner":"kubaparol","description":"A starter template for NestJS applications with built-in authentication","archived":false,"fork":false,"pushed_at":"2025-01-18T16:16:02.000Z","size":145,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-01T21:18:14.592Z","etag":null,"topics":["authentication","jwt","nestjs","password","prisma"],"latest_commit_sha":null,"homepage":"","language":"Handlebars","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/kubaparol.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-01T13:30:57.000Z","updated_at":"2025-01-18T16:16:01.000Z","dependencies_parsed_at":"2025-01-10T12:38:39.393Z","dependency_job_id":"35ea2f49-410c-4889-95f5-8ba00e5c3373","html_url":"https://github.com/kubaparol/nestjs-authentication-starter","commit_stats":null,"previous_names":["kubaparol/nestjs-authentication-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kubaparol/nestjs-authentication-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubaparol%2Fnestjs-authentication-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubaparol%2Fnestjs-authentication-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubaparol%2Fnestjs-authentication-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubaparol%2Fnestjs-authentication-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kubaparol","download_url":"https://codeload.github.com/kubaparol/nestjs-authentication-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubaparol%2Fnestjs-authentication-starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261220265,"owners_count":23126721,"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","jwt","nestjs","password","prisma"],"created_at":"2025-05-25T13:09:51.004Z","updated_at":"2025-10-25T00:02:46.977Z","avatar_url":"https://github.com/kubaparol.png","language":"Handlebars","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS Authentication Starter\n\nA starter template for NestJS applications with built-in authentication using JWT, Passport, and Prisma.\n\n## Features\n\n- 🔐 JWT Authentication\n- 📱 Local Authentication Strategy\n- 🔄 Passport Integration\n- 📚 Swagger API Documentation\n- 🗃️ Prisma ORM\n- 🐳 Docker support for development database\n- ✨ Input validation using class-validator\n- 🔒 Password hashing with bcrypt\n\n## Prerequisites\n\n- Node.js\n- pnpm\n- Docker (for development database)\n\n## Getting Started\n\n1. Clone the repository\n\n2. Install dependencies:\n\n```bash\npnpm install\n```\n\n3. Configure environment:\n\n```bash\n# Copy the example environment file\ncp .env.example .env\n\n# Open .env and update the values:\nDATABASE_URL=\"postgresql://postgres:123@localhost:5432/nest?schema=public\"\nJWT_SECRET=\"your-secret-key\"           # Change this to a secure random string\nBCRYPT_SALT_ROUNDS=10\nPORT=5000\n```\n\n4. Set up Docker environment:\n\n```bash\n# Create and start the PostgreSQL container\ndocker compose up db -d\n\n# Verify the container is running\ndocker compose ps\n\n# Check container logs if needed\ndocker compose logs db\n```\n\n5. Initialize the database:\n\n```bash\n# Apply database migrations\npnpm prisma:dev:deploy\n\n# Alternative: Restart database (removes existing data)\npnpm db:dev:restart\n```\n\n6. Start the application:\n\n```bash\npnpm start:dev\n```\n\n## API Documentation\n\nOnce the application is running, visit `http://localhost:5000/api` to access the Swagger documentation.\n\n### Available Endpoints\n\n#### Auth\n\n- POST `/auth/signin` - Sign in with email and password\n- POST `/auth/signup` - Create a new user account\n\n#### Users\n\n- GET `/users/me` - Get current user information\n\n## Technologies\n\n- NestJS\n- PostgreSQL\n- Prisma\n- Passport\n- JWT\n- Swagger\n\n## Development Tools\n\n### Database Management\n\n- **Prisma Studio**: Web-based database browser\n\n  ```bash\n  npx prisma studio\n  ```\n\n  Access at `http://localhost:5555`\n\n- **Docker Commands**:\n\n  ```bash\n  # View database logs\n  docker compose logs db\n\n  # Stop all containers\n  docker compose down\n\n  # Rebuild containers\n  docker compose up --build\n  ```\n\n### API Testing\n\n- Swagger UI: `http://localhost:5000/api`\n- Example cURL requests:\n\n  ```bash\n  # Sign up\n  curl -X POST http://localhost:5000/auth/signup \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"email\":\"test@example.com\",\"password\":\"password123\",\"firstName\":\"John\",\"lastName\":\"Doe\"}'\n\n  # Sign in\n  curl -X POST http://localhost:5000/auth/signin \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"email\":\"test@example.com\",\"password\":\"password123\"}'\n  ```\n\n## Docker Configuration\n\nThe project uses Docker Compose for local development. The default configuration:\n\n```yaml\n# PostgreSQL Database\n- Port: 5432 (external) -\u003e 5432 (internal)\n- Username: postgres\n- Password: 123\n- Database: nest\n```\n\nUseful Docker commands:\n\n```bash\n# Start specific service\ndocker compose up db -d\n\n# Stop all services\ndocker compose down\n\n# Remove database volume and container\npnpm db:dev:rm\n\n# View logs\ndocker compose logs db -f\n\n# Rebuild container\ndocker compose up db --build\n```\n\n## Scripts\n\n- `pnpm start:dev` - Start the application in development mode\n- `pnpm db:dev:restart` - Restart the development database\n- `pnpm build` - Build the application\n- `pnpm test` - Run tests\n- `pnpm lint` - Lint the codebase\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubaparol%2Fnestjs-authentication-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubaparol%2Fnestjs-authentication-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubaparol%2Fnestjs-authentication-starter/lists"}