An example fullstack app that displays a Message of the Day written with TypeScript. Uses Auth0 for role-based access control. Administrators can log in to create, edit, and remove MOTDs. Average users simply see the latest MOTD.
You can find a live deployment of this app at motd.example.fromthe.nexus
- An API scoped out in openapi.yml
GET /
: Retrieves the latest MOTDPOST /
: Creates a new MOTDGET /{id}
: Retrieves a specific MOTDPATCH /{id}
: Updates a specific MOTDDELETE /{id}
: Removes a specific MOTDGET /history
: List previous MOTDs sorted by newest to oldest
- Auth0 for login / role-based access control
- A monolithic ExpressJS implementation in apps/express-backend
- A frontend built in React with Mantine
- A Docker Compose configuration that contains the entire app & reverse proxies it to a single port
Before you can do anything, the project must have its dependencies installed. Make sure you have pnpm installed, then run pnpm install
at the project root to grab all deps.
To run locally, this project also requires Docker Compose to be installed so that the database can be self-hosted easily.
You can lint the whole project by running pnpm lint
in the root of the project.
You can test the whole project by running pnpm test
in the root of the project. You can lint individual packages by navigating to one (such as apps/express-backend
) and running npm run test
or npm run test:watch
in its directory.
- cd to
apps/express-backend
- Start the local database with
npm run dev:up
- Run the app with
npm run dev
- The API will be hosted on port 30330
- Make sure that the backend is already running locally
- cd to
apps/react-frontend
- Run the app with
npm run dev
- The frontend will be hosted on a random port. See log output for detail.
- cd to the root of the repo
- Run the whole app with
docker compose up --build
- The frontend and backend will be deployed on port 80