{"id":21103490,"url":"https://github.com/oliverjam/express-sqlite-example","last_synced_at":"2025-03-14T08:41:41.075Z","repository":{"id":89654046,"uuid":"534686618","full_name":"oliverjam/express-sqlite-example","owner":"oliverjam","description":"A simple server with Express and SQLite","archived":false,"fork":false,"pushed_at":"2023-10-20T13:48:39.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-21T03:12:04.428Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oliverjam.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}},"created_at":"2022-09-09T14:54:38.000Z","updated_at":"2022-09-09T14:59:04.000Z","dependencies_parsed_at":"2023-03-05T10:30:43.202Z","dependency_job_id":"8f836bbf-10ce-4ac1-ae3d-8ead58ed787e","html_url":"https://github.com/oliverjam/express-sqlite-example","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/oliverjam%2Fexpress-sqlite-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverjam%2Fexpress-sqlite-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverjam%2Fexpress-sqlite-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverjam%2Fexpress-sqlite-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverjam","download_url":"https://codeload.github.com/oliverjam/express-sqlite-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243551237,"owners_count":20309290,"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-19T23:59:00.201Z","updated_at":"2025-03-14T08:41:41.049Z","avatar_url":"https://github.com/oliverjam.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express SQLite example\n\nThis is an example of how I'd set up a basic Express + SQLite app.\n\n## DB setup\n\nThe SQLite connection is defined in `src/database/db.js`. This will read the `DB_FILE` environment variable and connect to the corresponding DB (or create a new one if it doesn't exist). It will also run the statements in `src/database/schema.sql` to ensure the DB contains the right tables.\n\nThis DB setup happens whenever the server starts, so make sure the `schema.sql` commands are safe to be re-run.\n\nYou can seed the DB with some example values by running `npm run seed`. This will execute the commands in `src/database/seed.sql`, which will insert some data.\n\nThe local `dev` npm script sets `DB_FILE` to `db.sqlite`, which is listed in the `.gitignore` so each local user can have their own copy of the DB.\n\n## Deployment\n\nMake sure you set the `DB_FILE` env var in your production environment. This might need to be in a specific directory (e.g. on [Glitch](https://glitch.com) only the `.data/` directory is persisted).\n\n\u003e [!Important]\n\u003e Most \"Platform-as-a-service\" hosts like Heroku are \"ephemeral\"—they recreate your app every time you deploy (and sometimes more often). This means the filesystem does not persist and your data will be lost.\n\u003e \n\u003e SQLite should be used with platforms that either allow attaching a persistent volume (like [fly.io](https://fly.io/docs/reference/volumes/)), or just give you full control over the computer you're deploying to.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverjam%2Fexpress-sqlite-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverjam%2Fexpress-sqlite-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverjam%2Fexpress-sqlite-example/lists"}