{"id":19558277,"url":"https://github.com/sbimochan/api-code-compass","last_synced_at":"2026-06-07T20:31:03.534Z","repository":{"id":258245911,"uuid":"866976480","full_name":"sbimochan/api-code-compass","owner":"sbimochan","description":"API Code Compass built for reference","archived":false,"fork":false,"pushed_at":"2024-10-29T08:41:12.000Z","size":423,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2024-10-29T09:55:49.127Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbimochan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-03T08:22:12.000Z","updated_at":"2024-10-29T08:41:15.000Z","dependencies_parsed_at":"2024-11-05T10:51:50.879Z","dependency_job_id":null,"html_url":"https://github.com/sbimochan/api-code-compass","commit_stats":null,"previous_names":["sbimochan/api-code-compass"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbimochan%2Fapi-code-compass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbimochan%2Fapi-code-compass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbimochan%2Fapi-code-compass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbimochan%2Fapi-code-compass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbimochan","download_url":"https://codeload.github.com/sbimochan/api-code-compass/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240814857,"owners_count":19861958,"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":[],"created_at":"2024-11-11T04:46:40.749Z","updated_at":"2026-06-07T20:31:03.455Z","avatar_url":"https://github.com/sbimochan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/sbimochan/api-code-compass/branch/dev/graph/badge.svg?token=DI53MR3LK0)](https://codecov.io/gh/sbimochan/api-code-compass)\n\nComes with:\n\n- [ES6](http://babeljs.io/learn-es2015/) features/modules\n- ES7 [async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)/[await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)\n- [Bookshelf](http://bookshelfjs.org/) ORM and [Knex](http://knexjs.org/) migrations\n- PostgreSQL (default) with support for MySQL and SQLite\n- [Docker](https://docs.docker.com/engine/docker-overview/) support for Development and Production\n- [ESLint](http://eslint.org/) for code linting\n- Request validation using [Joi](https://www.npmjs.com/package/@hapi/joi)\n- Code formatting using [Prettier](https://www.npmjs.com/package/prettier)\n- Configuration management using [dotenv](https://www.npmjs.com/package/dotenv)\n- Logging using [winston](https://www.npmjs.com/package/winston)\n- Error reporting using [Sentry](http://npmjs.com/package/@sentry/node)\n- Tests using [mocha](https://www.npmjs.com/package/mocha), [supertest](https://www.npmjs.com/package/supertest) and [chai](https://www.npmjs.com/package/chai)\n- VS Code built-in [Debugger](https://code.visualstudio.com/docs/nodejs/nodejs-debugging) Support\n\n---\n\n## Prerequisites\n\n- [Node.js](https://yarnpkg.com/en/docs/install)\n- [Yarn](https://yarnpkg.com/en/docs/install)\n- [NPM](https://docs.npmjs.com/getting-started/installing-node)\n- [PostgreSQL](https://www.postgresql.org/download/) / [MySQL](https://www.mysql.com/downloads/) / [SQLite](https://www.sqlite.org/download.html)\n\n## Setup\n\nClone the repository, install the dependencies and get started right away.\n\n    $ git clone --depth=1 git@github.com:sbimochan/sample-api.git \u003capplication-name\u003e\n    $ cd \u003capplication-name\u003e\n    $ rm -rf .git\n    $ yarn   # or npm install\n\nMake a copy of `.env.example` as `.env` and update your application details and database credentials. Now, run the migrations and seed the database.\n\n    $ yarn migrate\n    $ yarn seed\n\nFinally, start the application.\n\n    $ yarn start:dev (For development)\n    $ NODE_ENV=production yarn start (For production)\n\nNavigate to http://localhost:8848/api-docs/ to verify installation.\n\n## Creating new Migrations and Seeds\n\nThese are the commands to create a new migration and corresponding seed file.\n\n    $ yarn make:migration \u003cname\u003e\n    $ yarn make:seeder \u003cname\u003e\n\nExample,\n\n    $ yarn make:migration create_tags_table\n    $ yarn make:seeder 02_insert_tags\n\n## Using Docker\n\n### Using docker-compose\n\nUse [docker-compose](https://docs.docker.com/compose/) to quickly bring up a stack with pre-configured Postgres database container. Data is ephemeral and containers will disappear when stack is removed.\n\nUpdate `.env` file accordingly.\n\n- `0.0.0.0` as `$APP_HOST` to expose app on Docker network interface\n- Pre-configured Postgres settings - can be updated to point to another Postgres host\n\nBring up stack,\n\n    $ docker-compose up\n\nNavigate to http://localhost:8848/api-docs/ to verify application is running from docker.\n\nBring down stack,\n\n    $ docker-compose down\n\n### Multi-stage docker builds\n\nThere are multiple build targets available for different stages. These images can be used to deploy or run jobs in different container based cloud infrastructure like Kubernetes, AWS ECS, Fargate, GCP Cloud Run etc.\n\n1. Building a production image.\n\n   ```bash\n   $ docker build --target=prod -t api-code-compass:prod .\n   ```\n\n2. Building an image for development.\n\n   ```bash\n   $ docker build --target=dev -t api-code-compass:dev .\n   ```\n\n3. Building an image that runs migration and/or rollback.\n\n   ```bash\n    # Docker image that runs migration and seeds.\n    $ docker build --target=migrate -t api-code-compass:migrate .\n\n    # Docker image that rollbacks migrations.\n    $ docker build --target=migrate-rollback -t api-code-compass:migrate-rollback .\n   ```\n\nOnce the images have been built - all you need to do is run them providing a `.env` file. Like this:\n\n```bash\n$ docker run -v \"/path/to/your/.env:/app/.env\" sbimochan/api-code-compass:migrate\n```\n\n## Using MySQL instead of PostgreSQL\n\nInstall the [mysql](https://www.npmjs.com/package/mysql) driver first.\n\n    $ yarn add mysql\n\nUpdate these lines in your `.env` file.\n\n```diff\n- DB_CLIENT='pg'\n+ DB_CLIENT='mysql'\n\n- EXPOSED_DB_PORT='5432'\n+ EXPOSED_DB_PORT='3306'\n```\n\nYou can remove the [pg](https://www.npmjs.com/package/pg) driver if you like to.\n\n    $ yarn remove pg\n\nThat's it, you are ready to roll.\n\n## Tests\n\nTo run the tests you need to create a separate test database. Don't forget to update your `.env` file to include the connections for test database.\n\n```bash\nNODE_ENV=test yarn migrate\nyarn test\n```\n\nRun tests with coverage.\n\n```bash\nyarn test:coverage\n```\n\n## Postman Collection\n\nThe postman collection consists of series of tests for this API.\n\n[Click here](https://www.postman.com/api-code-compass/workspace/public-api-code-compass/collection/27851431-0a08f0a1-6e96-4fd4-aa88-801b65e4578b?action=share\u0026creator=27851431\u0026active-environment=27851431-5a1e16c7-904a-4be6-a7e8-95c1f2a7ed01)\n\nDownload this into your local machine and hit Run Collection.\n\n### To Maintainers\n\nFork this public postman link and after making changes create pull request in postman.\n\n## Why 8848?\n\nBecause the highest point in the world is [8848 meters](https://en.wikipedia.org/wiki/Mount_Everest).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbimochan%2Fapi-code-compass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbimochan%2Fapi-code-compass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbimochan%2Fapi-code-compass/lists"}