Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hugodf/express-server-render-starter
Starter app for server rendered Express applications using TailwindCSS, Nunjucks and Postgres
https://github.com/hugodf/express-server-render-starter
express express-session nunjucks nunjucks-starter-kit postgres tailwind-scaffolding tailwindcss
Last synced: 3 months ago
JSON representation
Starter app for server rendered Express applications using TailwindCSS, Nunjucks and Postgres
- Host: GitHub
- URL: https://github.com/hugodf/express-server-render-starter
- Owner: HugoDF
- License: mit
- Created: 2019-06-16T11:37:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T02:59:07.000Z (about 2 years ago)
- Last Synced: 2024-10-10T12:03:43.740Z (3 months ago)
- Topics: express, express-session, nunjucks, nunjucks-starter-kit, postgres, tailwind-scaffolding, tailwindcss
- Language: JavaScript
- Homepage:
- Size: 743 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Express Server-Render Starter
> A starter project for server-rendered Express applications using Nunjucks, TailwindCSS and Postgres
## Setup
Pre-requisites:
- Docker for Desktop
Run `docker-compose up` in the root of the project.
It will bring up Postgres and the Express application server in development mode.
It binds the application server to `localhost:3000`, this can be re-mapped this by changing the first 3000 in `3000:3000` of [./docker-compose.yaml](./docker-compose.yaml)).
The default Docker `CMD` is `npm start`, [./docker-compose.yaml](./docker-compose.yaml) overrides this to `npm run dev` which runs the application using nodemon (auto-restart on file change).
## Express setup
The Express "page" resources are located in [./src/pages](./src/pages).
Their corresponding Nunjucks templates are in [./src/views](./src/views).
Applications routes for pages are defined in [./src/router.js](./src/router.js).
Global concerns like security, cookie parsing, body parsing and request logging are handled in [./server.js](./server.js).
This application loosely follows the [Presentation Domain Data Layering](https://www.martinfowler.com/bliki/PresentationDomainDataLayering.html):
- Presentation is dealt with in the `./src/pages` folder
- Domain is dealt with in the `./src/modules` folder.
- Persistence is dealt with in the `./src/persistence` folder.