{"id":51537050,"url":"https://github.com/farithadnan/jejak-buku","last_synced_at":"2026-07-09T09:31:17.661Z","repository":{"id":315801467,"uuid":"1060870290","full_name":"farithadnan/jejak-buku","owner":"farithadnan","description":"App that keeps track of books so my brain doesn’t have to.","archived":false,"fork":false,"pushed_at":"2026-01-13T03:45:29.000Z","size":1323,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-13T06:40:21.963Z","etag":null,"topics":["angular","book","nodejs","tailwindcss","tracker"],"latest_commit_sha":null,"homepage":"https://jejak-buku.vercel.app/","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/farithadnan.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":"2025-09-20T19:01:01.000Z","updated_at":"2026-01-13T03:45:27.000Z","dependencies_parsed_at":"2025-10-24T12:30:56.949Z","dependency_job_id":null,"html_url":"https://github.com/farithadnan/jejak-buku","commit_stats":null,"previous_names":["farithadnan/jejak-buku"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/farithadnan/jejak-buku","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farithadnan%2Fjejak-buku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farithadnan%2Fjejak-buku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farithadnan%2Fjejak-buku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farithadnan%2Fjejak-buku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farithadnan","download_url":"https://codeload.github.com/farithadnan/jejak-buku/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farithadnan%2Fjejak-buku/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35295105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","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":["angular","book","nodejs","tailwindcss","tracker"],"created_at":"2026-07-09T09:31:16.481Z","updated_at":"2026-07-09T09:31:17.654Z","avatar_url":"https://github.com/farithadnan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jejak Buku\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMWhkaGJnZjI4OTBjM3hzeHhwNW41azMzdno2Z2ltamhlbWRpZWZnbCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/NFA61GS9qKZ68/giphy.gif\" /\u003e\n\u003c/p\u003e\n\nJejak Buku is a project designed to help users track, manage, and explore books.\nIt consists of a **TypeScript/Express/Drizzle ORM backend** and an **Angular frontend**.\n\n---\n\n## Features\n\n- Book tracking and management (CRUD)\n- Responsive Angular frontend (mobile \u0026 desktop)\n- SQLite database with Drizzle ORM\n- Database migrations with Drizzle Kit\n- Environment configuration support\n- Easily run on localhost or your local network (for mobile/PWA testing)\n- Unit tests for both frontend and backend\n\n---\n\n## Project Structure\n\n```\njejak-buku/\n│\n├── backend/\n│   ├── .env                # Environment variables\n│   ├── .env.example        # Example environment variables\n│   ├── drizzle.config.ts   # Drizzle ORM configuration\n│   ├── jejak-buku.db       # SQLite database file\n│   ├── package.json        # Node.js dependencies and scripts\n│   ├── README.md           # Backend documentation\n│   ├── tsconfig.json       # TypeScript configuration\n│   ├── drizzle/            # Drizzle migration files and metadata\n│   └── src/\n│       ├── index.ts        # Main entry point (Express server)\n│       ├── db/\n│       │ └── schema.ts     # Database schema definitions\n│       ├── controllers/    # API controllers (with unit tests)\n│       ├── routes/         # Express routes (with unit tests)\n│       └── middleware/     # Middleware (validation, etc.)\n│\n├── frontend/\n│   ├── package.json        # Angular dependencies and scripts\n│   ├── README.md           # Frontend documentation\n│   ├── proxy.conf.json     # Proxy for API requests during dev\n│   ├── src/\n│   │   ├── app/            # Angular app source code\n│   │   ├── assets/\n│   │   └── index.html\n│   └── angular.json        # Angular CLI config\n│\n└── README.md               # (This file)\n```\n\n---\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js (v18+ recommended)\n- npm or yarn\n- Docker and Docker Compose (optional, for containerized development)\n\n---\n\n## Docker Setup (Recommended)\n\nThe easiest way to run the project is using Docker Compose:\n\n1. **Start the containers**\n   ```sh\n   docker-compose up --build\n\n   # Start in background\n   docker-compose up -d\n\n   # View logs\n   docker-compose logs -f\n   ```\n\n   **Note:** First startup will take a few minutes as dependencies are installed inside the containers.\n\n2. **Access the application**\n   - Frontend: [http://localhost:4200](http://localhost:4200)\n   - Backend API: [http://localhost:5000](http://localhost:5000)\n\n3. **Stop the containers**\n   ```sh\n   docker-compose down\n   ```\n\n**Docker Features:**\n- 🔄 Hot-reloading enabled for both frontend and backend\n- 📦 Dependencies installed inside containers (no conflicts with host OS)\n- 🗄️ SQLite database with automatic better-sqlite3 rebuild for Linux\n- 🌐 Network accessible from host machine\n\n---\n\n## Backend Setup\n\n1. **Install dependencies**\n   ```sh\n   cd backend\n   npm install\n   # or\n   yarn install\n   ```\n\n2. **Configure environment**\n   ```sh\n   cp .env.example .env\n   # Edit .env as needed (e.g., DB_FILE_NAME=file:jejak-buku.db)\n   ```\n\n3. **Generate and apply migrations**\n   ```sh\n   npx drizzle-kit generate\n   npx drizzle-kit migrate\n   ```\n\n4. **Run Backend**\n\n   - **Localhost only (private):**\n     ```sh\n     npm run dev:localhost\n     ```\n     Accessible only from your PC at `http://localhost:3000` (or your configured port).\n\n   - **Network (accessible from other devices on your WiFi):**\n     ```sh\n     npm run dev:network\n     ```\n     Accessible from your phone or other devices at `http://\u003cyour-pc-ip\u003e:3000`.\n\n   - **Find your PC's IP address:**\n     On Windows, run `ipconfig` and look for `IPv4 Address` (e.g., `192.168.1.10`).\n\n5. **Run Backend Unit Tests**\n    ```sh\n      npm test\n    ```\n\n---\n\n## Frontend Setup\n\n1. **Install dependencies**\n   ```sh\n   cd frontend\n   npm install\n   ```\n\n2. **Run the frontend**\n\n   - **Localhost (private, only on your PC):**\n     ```sh\n     npm run start:localhost\n     ```\n     or\n     ```sh\n     ng serve --host localhost\n     ```\n     Open [http://localhost:4200](http://localhost:4200).\n\n   - **Network (accessible from your phone or other devices on your WiFi):**\n     ```sh\n     npm run start:network\n     ```\n     or\n     ```sh\n     ng serve --host 0.0.0.0\n     ```\n     Open `http://\u003cyour-pc-ip\u003e:4200` on your phone or other device.\n\n3. **API Backend**\n\n   - Make sure your backend is running and accessible.\n   - If your backend is on a different host/port, update your API URLs in the Angular service or use environments.\n\n4. **Run Frontend Unit Tests**\n  ```sh\n    ng test\n  ```\n\n---\n\n## Building\n\n### Docker Production Build\n\nTo build production-ready Docker images:\n```sh\ndocker-compose build\n```\n\n### Frontend Production Build\n\nTo build the frontend for production:\n```sh\ncd frontend\nng build\n```\n\nTo preview the production build locally:\n```sh\nnpx serve dist/frontend --single\n```\n\n---\n\n## Testing\n\n- **Frontend unit tests:**\n  ```sh\n  cd frontend\n  ng test\n  ```\n\n- **Backend unit tests**\n  ```sh\n  cd backend\n  npm test\n  ```\n\n---\n\n## Troubleshooting\n\n### Docker Issues\n\n- **\"Docker is not running\" error:**\n  - Make sure Docker Desktop is running on your machine\n  - On Windows, check that the Docker service is started\n\n- **better-sqlite3 errors in backend:**\n  - This usually happens when node_modules from Windows are mounted into Linux container\n  - Solution: Rebuild the container with `docker-compose up --build`\n  - The Dockerfile will automatically rebuild better-sqlite3 for Alpine Linux\n\n- **Frontend \"package.json not found\" error:**\n  - Ensure the WORKDIR in Dockerfile matches the volume mount path\n  - Both should use `/app` as the working directory\n\n- **Port already in use:**\n  - Check if another service is using ports 5000 or 4200\n  - Stop the conflicting service or change ports in docker-compose.yml\n\n---\n\n## Developer Notes\n\n- **Switch between localhost and network easily** using the scripts above.\n- **For PWA/offline testing:**\n  Use network mode and access from your phone for a real mobile experience.\n- **If you get CORS errors:**\n  Make sure your backend allows requests from your frontend's origin.\n- **Keep the `drizzle/` folder in git** (do not add to `.gitignore`).\n- **Do not commit your `.env` file**.\n- **If you change the schema**, always generate and apply a new migration.\n\n---\n\n## Useful Commands\n\n| Command                        | Description                                 |\n|--------------------------------|---------------------------------------------|\n| `docker-compose up --build`    | Start all services with Docker              |\n| `docker-compose down`          | Stop all Docker services                    |\n| `docker-compose logs -f`       | View logs from all services                 |\n| `npm run dev:localhost`        | Run backend on localhost only               |\n| `npm run dev:network`          | Run backend on all network interfaces       |\n| `npm run generate:migration`   | Generate migration from schema changes      |\n| `npm run migrate`              | Apply migrations to the database            |\n| `npm run start:localhost`      | Run frontend on localhost only              |\n| `npm run start:network`        | Run frontend on all network interfaces      |\n| `ng build`                     | Build the frontend for production           |\n| `ng test`                      | Run frontend unit tests                     |\n| `npm test`                     | Run backend unit tests                      |\n\n---\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarithadnan%2Fjejak-buku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarithadnan%2Fjejak-buku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarithadnan%2Fjejak-buku/lists"}