{"id":49549511,"url":"https://github.com/stefanbobrowski/doodle-market","last_synced_at":"2026-05-02T21:31:26.057Z","repository":{"id":352782547,"uuid":"1216573562","full_name":"stefanbobrowski/doodle-market","owner":"stefanbobrowski","description":"A full-stack Vite, React, TypeScript, Express app for uploading, selling, rating, and downloading doodles. Demonstrates backend concepts like orchestration, aggregation, business logic, media file handling, audit logging, and rate limiting. ","archived":false,"fork":false,"pushed_at":"2026-04-28T04:41:20.000Z","size":420,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-28T06:29:37.739Z","etag":null,"topics":["api-rest","backend","express","full-stack","middleware","react","typescript","vite"],"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/stefanbobrowski.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-21T03:18:59.000Z","updated_at":"2026-04-28T04:41:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stefanbobrowski/doodle-market","commit_stats":null,"previous_names":["stefanbobrowski/doodle-market"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stefanbobrowski/doodle-market","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanbobrowski%2Fdoodle-market","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanbobrowski%2Fdoodle-market/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanbobrowski%2Fdoodle-market/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanbobrowski%2Fdoodle-market/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanbobrowski","download_url":"https://codeload.github.com/stefanbobrowski/doodle-market/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanbobrowski%2Fdoodle-market/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32550836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"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":["api-rest","backend","express","full-stack","middleware","react","typescript","vite"],"created_at":"2026-05-02T21:31:25.453Z","updated_at":"2026-05-02T21:31:26.050Z","avatar_url":"https://github.com/stefanbobrowski.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Doodle Market\n\n```\n         '::.\n    _________H ,%%\u0026%,\n   /\\     _   \\%\u0026\u0026%%\u0026%\n  /  \\___/^\\___\\%\u0026%%\u0026\u0026\n  |  | []   [] |%\\Y\u0026%'\n  |  |   .-.   | ||\n~~@._|@@_|||_@@|~||~~~~~~~~~~~~~\n      \"\"\") )\"\"\"\n```\n\nA full-stack Vite, React, TypeScript, Express app for uploading, selling, and rating doodles. Demonstrates backend concepts like JWT authentication, ownership-based authorization, purchase flow, transactional emails, audit logging, rate limiting, integration testing, and admin tooling.\n\n## Features\n\n- **Browse \u0026 View**: Gallery of doodles with view and like counters.\n- **Upload Doodles**: Authenticated users can upload images with titles, descriptions, and prices. 5MB limit, images only, rate-limited to 5 uploads per hour.\n- **Edit \u0026 Delete**: Owners (and admins) can edit doodle details or replace the image, and delete with a two-step confirmation.\n- **Ownership Badges**: Doodle cards show an owner badge for your own doodles. Edit/Delete controls are only shown to the owner or admin.\n- **Purchase Flow**: Buy doodles using a demo account balance. Blocks self-purchase and enforces sufficient funds.\n- **Transactional Email**: Purchase confirmation email sent via the Resend API with an itemized receipt.\n- **JWT Auth**: Login returns a signed JWT (24h expiry) stored in localStorage and sent as a Bearer token on authenticated requests.\n- **Demo Accounts**: Two preset user accounts (`pixel_pete`, `sketch_sam`) with quick-fill buttons on the login page. Admin account is intentionally not shown on the login UI.\n- **Admin Dashboard**: Admin-only page to reset the entire app to seed state and wipe user-uploaded doodles, restores 5 seed doodles, and resets all account balances.\n- **Audit Logging**: Purchases and key events are appended to `logs/audit.json` with timestamps.\n- **Rate Limiting**: Upload endpoint is rate-limited per IP (5/hour) via `express-rate-limit`.\n- **Persistent Storage**: Synchronous SQLite via `better-sqlite3`. DB auto-creates and seeds on first run.\n- **Endpoint Testing**: Backend API tests with Vitest and Supertest, running against an in-memory SQLite database to keep tests isolated from real data.\n\n## Tech Stack\n\n- **Frontend**: Vite, React, TypeScript, SCSS\n- **Backend**: Express.js, TypeScript, ESM (`tsx` in dev)\n- **Database**: better-sqlite3 (SQLite)\n- **Auth**: jsonwebtoken, bcryptjs\n- **Email**: Resend API (`resend` SDK)\n- **File Uploads**: multer\n- **Rate Limiting**: express-rate-limit\n- **Testing**: Vitest, Supertest\n\n## Demo Accounts\n\n| Username     | Password                    | Role  | Starting Balance |\n| ------------ | --------------------------- | ----- | ---------------- |\n| `pixel_pete` | `pete123`                   | user  | $100.00          |\n| `sketch_sam` | `sam123`                    | user  | $100.00          |\n| `admin`      | _(not shown on login page)_ | admin | $1000.00         |\n\n## API Endpoints\n\n### Auth\n\n- `POST /auth/login` — Login, returns JWT + user object\n\n### Doodles\n\n- `GET /doodles` — Get all doodles\n- `GET /doodles/:id` — Get a single doodle\n- `POST /doodles` — Upload a new doodle _(auth required)_\n- `PATCH /doodles/:id` — Update title, description, price, or image _(owner or admin)_\n- `DELETE /doodles/:id` — Delete a doodle and its image file _(owner or admin)_\n- `POST /doodles/:id/view` — Increment view count\n- `POST /doodles/:id/like` — Increment like count\n- `POST /doodles/:id/purchase` — Purchase a doodle, deducts balance, sends email receipt _(auth required)_\n\n### Admin\n\n- `POST /admin/reset` — Reset all doodles to seed + restore all balances _(admin only)_\n- `POST /admin/reset-balance/:userId` — Reset a single user's balance _(admin only)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanbobrowski%2Fdoodle-market","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanbobrowski%2Fdoodle-market","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanbobrowski%2Fdoodle-market/lists"}