{"id":16234432,"url":"https://github.com/alexanderprod/jam-stack-box","last_synced_at":"2025-03-16T12:32:24.782Z","repository":{"id":42962323,"uuid":"226842984","full_name":"AlexanderProd/jam-stack-box","owner":"AlexanderProd","description":"Your own self hosted continuous deployment solution for JAM Stack websites.","archived":false,"fork":false,"pushed_at":"2024-08-15T06:36:16.000Z","size":1140,"stargazers_count":28,"open_issues_count":12,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T08:54:49.357Z","etag":null,"topics":["builder","ci-cd","cicd","continuous-deployment","docker","gatsbyjs","jam-stack-websites","jamstack","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/AlexanderProd.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":"2019-12-09T10:17:44.000Z","updated_at":"2024-08-15T06:36:20.000Z","dependencies_parsed_at":"2024-03-10T12:46:17.958Z","dependency_job_id":"734d3d0b-19b3-4693-b9b5-c391121cb456","html_url":"https://github.com/AlexanderProd/jam-stack-box","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderProd%2Fjam-stack-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderProd%2Fjam-stack-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderProd%2Fjam-stack-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderProd%2Fjam-stack-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexanderProd","download_url":"https://codeload.github.com/AlexanderProd/jam-stack-box/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814880,"owners_count":20352037,"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":["builder","ci-cd","cicd","continuous-deployment","docker","gatsbyjs","jam-stack-websites","jamstack","nodejs","typescript"],"created_at":"2024-10-10T13:16:00.929Z","updated_at":"2025-03-16T12:32:24.482Z","avatar_url":"https://github.com/AlexanderProd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- AUTO-GENERATED-CONTENT:START (STARTER) --\u003e\n\u003ch1 align=\"center\"\u003e\n  \u003cimg alt=\"Logo\" src=\"frontend/assets/logo.png\" height=\"100px\" /\u003e\n  \u003cbr/\u003e\n  JAMStackBox\n\u003c/h1\u003e\n\nYour own self hosted continuous deployment solution for JAM Stack websites.\n\nIt takes GitHub repositories containing GatsbyJS sites and builts them once an POST request to a specific URL has been called.\n\nThe build happens inside a Docker container to assure that a stable enviroment is provided. Once the build is finished the static files are saved to a dedicated folder inside of `sites-public`.\n\nFeel free to contact me on Twitter [@alexanderhorl](https://twitter.com/alexanderhorl) or send me a mail (on my GitHub profile) if you like this project or would want to know more about it.\n\n## ⚠️ Prerequisites\n\n- You need to have a running Docker instance on your machine.\n  Currently only Docker on Linux or MacOS is supported.\n- Currently only sites based on [GatsbyJS](https://www.gatsbyjs.org) are supported.\n  Feel free to contribute by editing the builder to support other static site generators.\n\n## 🚀 Quick Start\n\n1.  **Download this repo**\n\n    ```sh\n    git clone https://github.com/AlexanderProd/jam-stack-box\n    ```\n\n2.  **Install packages and build server**\n\n    Simply run the install script in the downloaded directory.\n\n    ```sh\n    $ bash install.sh\n    ```\n\n3.  **Create .env file from example**\n\n    Use the `.env example` file to a create a file called `.env` in the server directory. This file contains all the necessary enviroment variables like the admin password.\n\n4.  **Start the server process**\n\n    The server process is a NodeJS server listening to a specific port, default `3000`.\n    You can change the port by providing a `PORT` enviroment variable.\n\n    The server process can be started manually.\n\n    ```sh\n    $ node server/dist/index.js\n    ```\n\n    Or using the [PM2 process manager](https://pm2.keymetrics.io) by running the following command in the downloaded directory.\n\n    ```sh\n    $ pm2 start\n    ```\n\n    or\n\n    ```sh\n    $ pm2 start --env production\n    ```\n\n## Usage\n\nSince this project is currently in development theres no frontend to control your sites yet. Though you can still use it simply by doing requests agains the rest server.\n\nWhen a new site gets added all parameters get saves to the DB and the sites gets a unique 6 digit alphanumeric string as ID.\n\nA new site gets created by posting a POST request against `/site` and a build gets triggered with a POST to `/build/[id]`.\n\n## REST Endpoints\n\nThe most important API endpoints are the following, checkout index.js in the server directory for the rest.\nThe default development port is 3000. It can be changed with a either PORT enviroment variable or in the config file in the server directory.\n\n### POST `/site`\n\nCreates a new site instance and saves it to the database, returns the id of the site.\nExpects content type `x-www-form-urlencoded`.\n\n| field  | required | description                                                                                                               |\n| ------ | -------- | ------------------------------------------------------------------------------------------------------------------------- |\n| name   | true     | Name of the site, only used for front-end purposes.                                                                       |\n| source | true     | GitHub link to a repository with the site content. \u003cbr/\u003e ( e.g. https://github.com/AlexanderProd/gatsby-shopify-starter ) |\n\nIf you want to use a private repo as source you have to supply a GitHub OAuth token in the source URL, like this. `https://\u003ctoken\u003e@github.com/owner/repo.git`. JamStackBox is using [this technique](https://docs.github.com/en/github/extending-github/git-automation-with-oauth-tokens) to clone private repos.\nYou can read how to create a personal OAuth token [here](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token).\n\n### POST `/build/[id or name]`\n\nTriggers a new build for the site with the ID.\n\n### GET `/sites`\n\nReturns a JSON array with all sites in the database.\n\n### GET `/sites/[id]`\n\nReturns all details of a specific site.\n\n### DELETE `/site/[id]`\n\nDeletes the site with given ID.\n\n### GET `/badge/[id or name]`\n\nReturns an svg image with the current state of a site, for example building or success.\n\n\u003cimg alt=\"success badge\" src=\"frontend/assets/success-status.svg\" /\u003e\n\n## 📌 ToDo\n\n- [x] Use dynamic NodeJS version in Builder using NVM.\n- [ ] Remote Deployment\n- [ ] Add frontend to control sites and builds.\n- [ ] Add support for other static site generators than Gatsby.\n- [ ] Implement a message broker.\n- [x] Deploy status badge.\n- [x] Split server and builder into dedicated docker containers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderprod%2Fjam-stack-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexanderprod%2Fjam-stack-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderprod%2Fjam-stack-box/lists"}