This is a basic starter template for a web app. It's intended use case is for simple things that do not warrant using a SPA or other heavier client side frameworks. It opts for a very simple dev loop, no building/compiling, simply edit the files and the changes are live.
To launch the app, install the dependencies npm install
, and then run npm start
, and navigate here, to login check the ./logs/audit.log
for the generated admin password, you can change this afterwards.
If you wish to make a change, follow the above directions, expect instead of running npm start
, run npm run dev
. On save of your JavaScript files the server will automatically reload with the new changes.
Script | Description |
---|---|
dev | Uses nodemon to automatically restart server when javascript changes |
test | Runs unit tests using Jest |
test:e2e | Runs e2e tests using Playwright |
lint | Checks code/files using Standard.JS and Prettier |
lint:fix | Automatically fix style and linting violations |
start | Runs the application server |
Name | Default | Description |
---|---|---|
PORT | 3000 | The Listening port of the server |
COOKIE_PASSWORD | The 32 byte key used to encrypt the cookie |
services/
- services that support pages, routes and other activities of the serverroutes/
- express route controllerspublic/
- static files served by the web servermiddleware/
- middleware functions that can be applied to many routesconfig/
- config files and environment variable mappingtests/
- E2E Testsviews/
- PUG templatesdb/
- Database models, migrations and seedsYou can create a new model/table by running npx sequelize-cli model:generate --name TableName --attributes prop1:string,prop2:string
, this will create a basic migration for you under ./db/migrations
and a new model under ./db/models
.
You can create a new migration by running npx sequelize-cli migration:create --name your-migration-name
You can create a new seed by running npx sequelize-cli seed:generate --name seed-name
You can manually run migrations by running npx sequelize-cli db:migrate
services/users.js
to use your user store