{"id":16186241,"url":"https://github.com/zenflow/echoenglishschool.com","last_synced_at":"2025-04-07T13:22:33.384Z","repository":{"id":37303409,"uuid":"431284292","full_name":"zenflow/echoenglishschool.com","owner":"zenflow","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-17T04:02:50.000Z","size":42401,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T15:55:03.572Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zenflow.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}},"created_at":"2021-11-23T23:24:23.000Z","updated_at":"2023-03-04T06:20:26.000Z","dependencies_parsed_at":"2023-01-19T11:30:49.270Z","dependency_job_id":null,"html_url":"https://github.com/zenflow/echoenglishschool.com","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/zenflow%2Fechoenglishschool.com","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenflow%2Fechoenglishschool.com/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenflow%2Fechoenglishschool.com/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenflow%2Fechoenglishschool.com/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenflow","download_url":"https://codeload.github.com/zenflow/echoenglishschool.com/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657249,"owners_count":20974350,"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-10-10T07:17:41.789Z","updated_at":"2025-04-07T13:22:33.338Z","avatar_url":"https://github.com/zenflow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# echoenglishschool.com\n\n\u003e Powered by [Apostrophe CMS v3](https://v3.docs.apostrophecms.org/)\n\u003e Forked from [apos-my-site boilerplate](https://github.com/zenflow/apos-my-site)\n\n## Development\n\n### Prerequisites\n\n1. Git\n2. [Node.js](https://nodejs.org/en/) v14 or later\n3. [MongoDB Community Server](https://docs.mongodb.com/manual/administration/install-community/) v5 or later\n4. (Optional) [Docker](https://docs.docker.com/get-docker/) (for testing production Docker image)\n\n### Setup\n\n1. Fork this repo on GitHub\n2. Clone your fork onto your local machine (`git clone https://github.com/\u003cyour username/echo-english-school`)\n3. `cd` into the repo on your local machine (`cd echo-english-school`)\n4. Install dependencies (`npm install`)\n5. Copy contents of [`.env.example`](./.env.example) into `.env`\n   - These defaults are good for local development, and you can edit this file at any time.\n   - *Please be aware* If you want to change `APOS_MONGODB_URI`, that value is overridden in `docker-compose.yml`,\n     used when running the app in Docker.\n\n### Tasks\n\n- Run app in dev mode: `npm run dev`\n- Run app in production mode: `npm run build \u0026\u0026 npm run serve`\n- Build and run production Docker image: `docker-compose up --build`\n- Restore local database from `db` folder: `npm run db-restore`\n\n#### Advanced\n\n- Dump local database to `db` folder (requires MongoDB Database Tools):\n  `MONGODB_URI=mongodb://localhost/echo-english-school ./scripts/db-dump.sh`\n\n## Deploying to production\n\n1. Build the `Dockerfile` in the repo root\n2. Configure:\n    - mount volume for `/app/public/uploads`\n    - environment variables according to the [.env.example](./.env.example)\n        - *Hint* If you get errors about failed authentication when starting the app,\n          then you may need the `?authSource=admin` query param.\n3. (Optional) Restore app data:\n    1. Database. Restore from `db` folder /w `MONGODB_URI=\u003cconnection-string\u003e node scripts/restore-db`\n    2. Uploads. Copy files from `public/uploads` into the volume.\n4. Start the container\n5. If you skipped the \"Restore app data\" step, log in with username \"admin\" password \"admin\" and edit this user.\n\n## Automated backups of production\n\nThis project has a GitHub Actions workflow that can be used to back up production data **on a schedule** and **on-demand**.\nIt will back up both the database and the uploaded files.\nIt uses the GitHub repo as storage, so you can easily work with production data in your development environment.\n\nBackups go into the `backup/prod` branch to be manually merged with the `main` branch as desired.\nWhen merging it is recommended to **Squash and merge** to keep the Git commit history clean.\n\nTo set up:\n\n1. (Optional) Enable scheduled backups by un-commenting the two lines near the top of `.github/workflows/back-up-prod.yml`.\n2. Create a branch named `backup/prod` and push it to GitHub.\n3. Add repository secrets on GitHub under Settings \u003e Secrets \u003e New repository secret:\n   1. `MONGODB_URI` - e.g. `mongodb://username:password@example.com:27017/databasename?authSource=admin`\n   2. `UPLOADS_DIR` - e.g. `username:password@example.com:/path/to/public/uploads` (username and password are for SSH)\n\nTo trigger a backup on-demand, go to your project \"Actions\", select \"Back up prod\" from the list of workflows,\nclick the \"Run workflow\" dropdown, and click the \"Run workflow\" button.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenflow%2Fechoenglishschool.com","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenflow%2Fechoenglishschool.com","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenflow%2Fechoenglishschool.com/lists"}