{"id":26329056,"url":"https://github.com/ash1605/notesappbackend","last_synced_at":"2026-04-11T03:05:47.671Z","repository":{"id":274217082,"uuid":"922187133","full_name":"AsH1605/NotesAppBackend","owner":"AsH1605","description":"This is the backend service for CookieNote, a note-taking application. The backend is built using modern web technologies, ensuring scalability, maintainability, and secure handling of user data.","archived":false,"fork":false,"pushed_at":"2025-03-06T17:49:09.000Z","size":110,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T18:36:03.155Z","etag":null,"topics":["expressjs","knexjs","nodejs","postgresql","typescript"],"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/AsH1605.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":"2025-01-25T14:55:12.000Z","updated_at":"2025-03-06T17:50:16.000Z","dependencies_parsed_at":"2025-03-06T18:38:34.048Z","dependency_job_id":null,"html_url":"https://github.com/AsH1605/NotesAppBackend","commit_stats":null,"previous_names":["ash1605/notesappbackend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsH1605%2FNotesAppBackend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsH1605%2FNotesAppBackend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsH1605%2FNotesAppBackend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsH1605%2FNotesAppBackend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AsH1605","download_url":"https://codeload.github.com/AsH1605/NotesAppBackend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243790988,"owners_count":20348386,"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":["expressjs","knexjs","nodejs","postgresql","typescript"],"created_at":"2025-03-15T21:19:22.771Z","updated_at":"2025-12-30T21:04:52.695Z","avatar_url":"https://github.com/AsH1605.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# CookieNote Backend\n\nThis is the backend service for **[CookieNote](https://github.com/AsH1605/CookieNote)**, a note-taking application. The backend is built using modern web technologies, ensuring scalability, maintainability, and secure handling of user data.\n\n## Tech Stack\n| Component       | Technology |\n|------------------|-------------|\n| Language        | Typescript |\n| Runtime         | Node.js |\n| Framework       | Express.js |\n| Database        | PostgreSQL |\n| Query Builder   | Knex.js |\n| Authentication  | JWT |\n| Password Hashing| bcrypt |\n\n---\n\n## Architecture Overview\n\n### Project Structure\n```\n/auth              - Contains JWT verification and user auth logic\n/controller        - Contains all logic for handling requests and forming responses\n/db                - Knex configuration and DB functions\n/dto               - TypeScript interfaces for Data Transfer Objects\n/error             - JS Error classes with error codes for different types of error responses\n/models            - Database models \n/routes            - Defines user and note-related routes\n```\n\n### Routers\n| Router | Purpose |\n|---|---|\n| `userRouter` | Handles user actions like register and login |\n| `noteRouter` | Handles note actions like create, update, delete, fetch notes |\n\n---\n\n## Authentication\n- Users register and login through the `userRouter`.\n- Passwords are **hashed** before being stored in PostgreSQL.\n- Authentication is handled using **JWT** tokens.\n- Protected routes (note routes) require a valid **JWT token** to access.\n\n---\n\n## Environment Variables\nThe backend relies on environment variables for configuration. Example `.env` file:\n```\nDB_HOST=localhost\nDB_PORT=5432\nDB_USER=postgres\nDB_NAME=postgres\nDB_PASSWORD=hi\nJWT_SECRET=999\nSALT=applepie\n```\n\n---\n\n## Routes\n\n### User Router (`/user`)\n| Endpoint | Method | Description |\n|---|---|---|\n| `/register` | POST | Registers a new user |\n| `/login` | POST | Logs in a user, returns JWT token |\n\n### Note Router (`/note`)\n| Endpoint | Method | Description |\n|---|---|---|\n| `/createNote` | POST | Creates a new note |\n| `/getNotes` | GET | Fetch all notes for the logged-in user |\n| `/getNote/:note_id` | GET | Fetch a specific note by ID |\n| `/deleteNote/:note_id` | DELETE | Delete a note by ID |\n| `/updateNote/:note_id` | PUT | Update a note by ID |\n\n\n---\n*Happy Coding 🍪*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fash1605%2Fnotesappbackend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fash1605%2Fnotesappbackend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fash1605%2Fnotesappbackend/lists"}