Fullstack template
This is a template for small fullstack projects. It is based on svelte, express, and mongoDB, with support for AWS hosting. Routing for svelte is done with the svelte-routing
package. Larger projects should rely on something mroe sophisticated, like Sapper.
Installation
- Clone the repo
- Add your web app firebase config to
./frontend/src/services/firebase.js
on line 7. Note: this project uses both email/password login and google auth login. These must be enabled in your firebase project or it will cause issues. Removing them is as simple as removing the export in the frontend./src/service/firebase.js
file and in the frontend./src/components/SignInForm.svelte
file (remove the imports, functions, and buttons) - create a
.env
file in the/backend/
folder- add
GOOGLE_APPLICATION_CREDENTIALS=<PATH TO FIREBASE ADMIN SDK KEY JSON>
- add
DB_URI=<MONGODB SRV CONNECTION STRING>
- add
.gitignore
will ignore anything in the ./backend/google/
and .env
this allows for a convenient place to store things like google service account keys.
Usage
the npm scripts for the frontend are the standard svelte npm scripts the backend has npm scripts to start the server (as well as a nodemon version to start a dev server) and a lint lint file.