{"id":20802875,"url":"https://github.com/kaykeeb3/blog","last_synced_at":"2026-02-05T04:03:06.458Z","repository":{"id":247299508,"uuid":"803992763","full_name":"kaykeeb3/blog","owner":"kaykeeb3","description":"API developed with Node.js and TypeScript, featuring JWT authentication 🔒 and Prisma ORM 📊. Features: user, news, and profile management.","archived":false,"fork":false,"pushed_at":"2024-12-24T18:14:46.000Z","size":108,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T01:42:40.368Z","etag":null,"topics":["bycrypt","clean-architecture","express","jwt","nodejs","prisma","typrescript"],"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/kaykeeb3.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":"2024-05-21T18:46:18.000Z","updated_at":"2024-12-24T18:15:00.000Z","dependencies_parsed_at":"2024-12-23T16:27:02.782Z","dependency_job_id":"fd80ced7-03af-46d8-9cd4-ad7fe0a16f4f","html_url":"https://github.com/kaykeeb3/blog","commit_stats":null,"previous_names":["kaykeeb3/blog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kaykeeb3/blog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaykeeb3%2Fblog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaykeeb3%2Fblog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaykeeb3%2Fblog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaykeeb3%2Fblog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaykeeb3","download_url":"https://codeload.github.com/kaykeeb3/blog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaykeeb3%2Fblog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29110589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T03:44:17.043Z","status":"ssl_error","status_checked_at":"2026-02-05T03:44:12.077Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bycrypt","clean-architecture","express","jwt","nodejs","prisma","typrescript"],"created_at":"2024-11-17T18:38:00.699Z","updated_at":"2026-02-05T04:03:06.443Z","avatar_url":"https://github.com/kaykeeb3.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# News and User Profiles Management API\n\nThis project is an API developed to enable user registration, login, and management of news and user profiles. The solution is built using **Node.js**, **TypeScript**, **JWT** for authentication, **Prisma ORM** for database interaction, and follows **Clean Architecture** principles and good software development practices.\n\n## Features\n\n### Authentication\n- **User Registration**: Allows new users to register with name, email, and password.\n- **User Login**: Authenticates users and generates a JWT token for access to protected resources.\n\n### News Management\n- **Create News**: Authenticated users can create new news with title, description, and category.\n- **Edit News**: Authenticated users can edit their own news.\n- **Delete News**: Authenticated users can delete their news.\n- **List News**: Authenticated users can view all published news.\n\n### User Profile\n- **Create and Update Profile**: Users can create and update their profiles, including name, description, and photo URL.\n- **View Profile**: Users can view their own profile.\n\n## Technologies Used\n\n- **Node.js**: Development platform for building the API.\n- **TypeScript**: A superset of JavaScript that provides static typing and improves code maintenance.\n- **Express.js**: Minimal and flexible framework for building APIs.\n- **JWT (JSON Web Token)**: For authentication and user authorization.\n- **Prisma ORM**: ORM for efficient database interaction.\n- **bcryptjs**: Library for secure password hashing.\n\n## Architecture and Project Structure\n\nThe application follows Clean Architecture to ensure separation of concerns and facilitate scalability and code maintenance.\n\n### Directory Structure\n\n```\n/src\n  /config\n    - database.ts           # Database configuration\n  /controllers\n    - AuthController.ts     # Authentication logic\n    - HomeController.ts     # Initial routing\n    - NewsController.ts     # News management logic\n    - ProfileController.ts  # Profile management logic\n    - UserController.ts     # User management logic\n  /dtos\n    - CreateUserDTO.ts      # Data Transfer Object for user registration\n    - CreateNewsDTO.ts      # DTO for news creation\n    - CreateProfileDTO.ts   # DTO for profile creation\n  /interfaces\n    - IAuthService.ts       # Interface for authentication service\n    - IUserService.ts       # Interface for user service\n    - INewsService.ts       # Interface for news service\n    - IProfileService.ts    # Interface for profile service\n  /middlewares\n    - authenticateToken.ts  # Middleware to verify JWT token\n    - validateNews.ts       # News data validation middleware\n    - validateProfile.ts    # Profile data validation middleware\n  /repositories\n    - PrismaUserRepository.ts   # User repository using Prisma\n    - PrismaNewsRepository.ts   # News repository using Prisma\n    - PrismaProfileRepository.ts # Profile repository using Prisma\n  /routes\n    - index.ts              # API routing\n  /services\n    - AuthService.ts        # Authentication service\n    - UserService.ts        # User management service\n    - NewsService.ts        # News management service\n    - ProfileService.ts     # Profile management service\n  - server.ts               # Server initialization file\n  - app.ts                  # Express server setup\n```\n\n## Installation and Running\n\n### Backend\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/kaykeeb3/blog.git\n   cd your-repository/server\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Configure environment variables by creating a `.env` file at the root of the project:\n\n   ```env\n   DATABASE_URL=\"\"\n   JWT_SECRET=\"\"\n   PORT=3333\n   ```\n\n4. Run Prisma migrations:\n\n   ```bash\n   npx prisma migrate dev\n   ```\n\n5. Start the server:\n\n   ```bash\n   npm run dev\n   ```\n\nNow, the API will be available to receive requests.\n\n## API Usage Examples\n\n### User Registration\n\n```bash\nPOST /register\n{\n  \"name\": \"John Doe\",\n  \"email\": \"johndoe@example.com\",\n  \"password\": \"secret_password\"\n}\n```\n\n### User Login\n\n```bash\nPOST /login\n{\n  \"email\": \"johndoe@example.com\",\n  \"password\": \"secret_password\"\n}\n```\n\n### Create News\n\n```bash\nPOST /news\n{\n  \"title\": \"News Title\",\n  \"description\": \"News Description\",\n  \"category\": \"News Category\"\n}\n```\n\n### Update News\n\n```bash\nPUT /news/:id\n{\n  \"title\": \"Updated Title\",\n  \"description\": \"Updated Description\",\n  \"category\": \"Updated Category\"\n}\n```\n\n### Delete News\n\n```bash\nDELETE /news/:id\n```\n\n### Create and Update Profile\n\n```bash\nPOST /profile\n{\n  \"name\": \"John Doe\",\n  \"description\": \"Profile Description\",\n  \"photoUrl\": \"http://url-to-photo.com/photo.jpg\"\n}\n```\n\n### View Profile\n\n```bash\nGET /profile\n```\n\n## Contributing\n\nContributions are welcome! To contribute, follow the steps below:\n\n1. Fork the repository\n2. Create a new branch for your feature (`git checkout -b feature/new-feature`)\n3. Commit your changes (`git commit -am 'Added a new feature'`)\n4. Push your changes to the remote repository (`git push origin feature/new-feature`)\n5. Open a Pull Request with a detailed description of your contribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaykeeb3%2Fblog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaykeeb3%2Fblog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaykeeb3%2Fblog/lists"}