{"id":27081984,"url":"https://github.com/danedwardsdeveloper/express-react-monorepo","last_synced_at":"2025-08-09T05:23:09.126Z","repository":{"id":249686978,"uuid":"831685497","full_name":"danedwardsdeveloper/express-react-monorepo","owner":"danedwardsdeveloper","description":"An API and React app served by Express","archived":false,"fork":false,"pushed_at":"2024-07-26T09:11:01.000Z","size":493,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-26T20:27:33.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/danedwardsdeveloper.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-07-21T10:20:25.000Z","updated_at":"2024-07-26T09:11:05.000Z","dependencies_parsed_at":"2024-07-24T19:48:51.513Z","dependency_job_id":"15edd9b3-8dad-4f42-b4de-2fd1ea9f4929","html_url":"https://github.com/danedwardsdeveloper/express-react-monorepo","commit_stats":null,"previous_names":["danedwardsdeveloper/express-react-monorepo"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danedwardsdeveloper%2Fexpress-react-monorepo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danedwardsdeveloper%2Fexpress-react-monorepo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danedwardsdeveloper%2Fexpress-react-monorepo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danedwardsdeveloper%2Fexpress-react-monorepo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danedwardsdeveloper","download_url":"https://codeload.github.com/danedwardsdeveloper/express-react-monorepo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427019,"owners_count":20937197,"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":"2025-04-06T02:37:37.803Z","updated_at":"2025-04-06T02:37:40.883Z","avatar_url":"https://github.com/danedwardsdeveloper.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# express-react-monorepo\n\nAn API and React app served by a single instance of Express\n\n## Notes\n\nI'm using this as a base for a series of full-stack applications I'm creating for my portfolio. It doesn't look like much, but it's set up to enable me to create secure \u0026 fully fledged MERN applications.\n\n# Features\n\nStateless Express server\n\n   -  Written in TypeScript\n   -  Serves an API at `/api`\n   -  Currently uses hardcoded sign in values\n   -  Issues a JWT cookie on sign in\n   -  The client can't read or do anything with the JWT except pass it back with subsequent requests\n   -  Also serves the static React app at `/`\n\nReact app\n\n   -  Written in TypeScript\n   -  Uses React Router\n   -  Uses an AuthContext to store the `isAuthenticated` state globally\n   -  Makes requests to `/api/validate-token` to update the state\n   -  Uses Axios for requests\n   -  Layout styled with Tailwind\n\nEnvironment Variable handling\n\n-  I'm using one `.env` file for both parts of the site\n-  Back-end variables are prefixed with `EXPRESS_`\n   -  This is for clarity only\n-  Front-end variables are prefixed with `VITE_`\n   -  This is essential for the Vite bundler to be able to use them\n-  Both parts of the monorepo have an `environementChecks` file\n-  This is where you declare essential variables and check they can be accessed by the TypeScript complier (for the back-end) and Vite (for the front-end)\n-  This will throw an error if any aren't set.\n-  The whole point of this is to make deployment to Fly easy.\n\n Deployed with Fly\n\n-  The deploy script in `root/package.json`: `pnpm run deploy` first runs `/ops/checkVariables.js`, which will throw an error if anything is still set to 'production'\n-  This is annoyingly manual for my taste, but setting environment variables is currently quite difficult with Fly, and this gives me peace of mind that I'm not wasting build time \u0026 money\n-  Next the TypeScript Express server gets compiled into `dist/server`\n-  Then the React project is built into `dist/client`\n-  Then the `.env` file is scraped, and the variables are added to the `fly deploy` command\n-  You'll be able to see all environment variables logged to the Fly console\n-  The site will work beautifully\n\n  ## To-Do List\n\n  - Prune dependencies\n  - Write database connection file\n  - Add rate limiting\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanedwardsdeveloper%2Fexpress-react-monorepo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanedwardsdeveloper%2Fexpress-react-monorepo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanedwardsdeveloper%2Fexpress-react-monorepo/lists"}