{"id":29838017,"url":"https://github.com/jim-junior/junior-dev","last_synced_at":"2026-04-20T09:34:13.206Z","repository":{"id":134546408,"uuid":"421272922","full_name":"jim-junior/junior-dev","owner":"jim-junior","description":"Jamstack site created with Stackbit","archived":false,"fork":false,"pushed_at":"2021-10-26T04:00:51.000Z","size":635,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-29T13:49:14.124Z","etag":null,"topics":["devto","gatsby","headless","jamstack","ssg","stackbit","static"],"latest_commit_sha":null,"homepage":"https://jamstack.new","language":"JavaScript","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/jim-junior.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-10-26T04:00:49.000Z","updated_at":"2023-03-07T06:39:00.000Z","dependencies_parsed_at":"2023-06-17T23:45:43.397Z","dependency_job_id":null,"html_url":"https://github.com/jim-junior/junior-dev","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jim-junior/junior-dev","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim-junior%2Fjunior-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim-junior%2Fjunior-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim-junior%2Fjunior-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim-junior%2Fjunior-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jim-junior","download_url":"https://codeload.github.com/jim-junior/junior-dev/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim-junior%2Fjunior-dev/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269693593,"owners_count":24460248,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"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":["devto","gatsby","headless","jamstack","ssg","stackbit","static"],"created_at":"2025-07-29T13:18:15.452Z","updated_at":"2026-04-20T09:34:08.164Z","avatar_url":"https://github.com/jim-junior.png","language":"JavaScript","readme":"# stackbit-api\n\nBackend API server for the frontend app stackbit-app\n\n## Private NPM Token\n\nThe API server uses npm packages from the private Stackbit npm registry. You will need an npm account and your npm username needs to be added to the Stackbit npm registry.\n\nFor local development, create a token and add it to the node environment.\n\n```\nnpm token create\n```\n\n```\nexport NPM_TOKEN=00000000-0000-0000-0000-000000000000\n```\n\n## AWS Secret Manager\n\nTo run the api server locally you will need a IAM account with AWS. Have Simon create an account for you.\n\nAdd the following AWS tokens to your env\n\n```\nexport AWS_ACCESS_KEY_ID=XXXXXXXX\nexport AWS_SECRET_ACCESS_KEY=XXXXXXXXXX\n```\n\n## Local Server\n\nRun the local API server:\n\n```\nnpm run build-config:local \u0026\u0026 npm start\n```\n\nOr use `start:no-watch` so the server isn't restarted whenever you edit code.\n\n```\nnpm run build-config:local \u0026\u0026 npm run start:no-watch\n```\n\n## Tests\n\nRun tests using jest. it would look for code changes and re-run the related tests after saving the files.\n\n```\nnpm run test\n```\n\nNaming convention:\n\n1. Unit tests: for a file named `x.ts` create tests in a file named `x.test.ts`\n1. Other tests:\n   use meaningful file name ends with `test.ts` in `src/tests` folder, group tests in subfolders by topic\n1. Test utils exists in `src/test-utils/`\n\n## Run container locally\n\n1. Clone stackbit-container next to stackbit-api (both must be in the same parent directory).\n1. Set up stackbit-container (`npm install \u0026\u0026 npm run build-config:local`).\n1. In `config.json`, change `localContainerMode.local` to be `true`.\n1. In `config.json`, change `forceUpdateContainerUrl.local` to be `true`.\n\nThis will stream all container logs to api's logs. If this is undesirable, in `config.json` turn off\n`outputLocalContainerLogs`.\n\n## Create MongoDB migrations\n\nCreate migration at `src/migrations/{timestamp}-{migration-name}.ts`, e.g.:\n`src/migrations/20201022145804-add-user-role.ts`. Open the migration file and implement\nthe `up` and `down` methods. Visit [migrate-mongo](https://github.com/seppevs/migrate-mongo)\nfor more info on how to implement migrations. You can also import mongoose models in\nmigration scripts. Also you can use existing migrations as an example inside `src/migrations/` folder.\n\nNext time the server starts it will run all migrations that were not yet run.\nThe state of all migrations is stored in mongo inside `migrations` collection.\n\n\u003e Note: For some developers migrations might fail running regular `npm start` because of weird behavior of `ts-node-server` in watch mode.\n\u003e Use `npm run start:no-watch` instead.\n\n### Stripe\n\nTo test the Stripe integration locally, including listening to webhooks sent by Stripe, you must be added to the Stackbit account on Stripe.\n\nAfter that, take the following steps:\n\n1. Install the [Stripe CLI](https://stripe.com/docs/stripe-cli)\n\n1. Sign in to the Stackbit account using `stripe login`\n\n1. Run `npm run stripe-webhook-listen`\n\n1. The command above will give you a secret key. Use it as an environment variable when running the app.\n\n    ```sh\n    STRIPE_WEBHOOK_SECRET=\u003cyour-webhook-secret\u003e npm start\n    ```\n\n### External api types sync with APP project script\n\nnote that script requires that `/stackbit-app` folder would be sibling of `/stackbit-api`\n\nTo update App's project external api types:\n\n1. add export to external-api-types.ts\n1. run `./npm run update-external-api-types:copy` from `/stackbit-api/`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjim-junior%2Fjunior-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjim-junior%2Fjunior-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjim-junior%2Fjunior-dev/lists"}