- apps
api
: a NestJS backend application working as APIweb
: a Vite Remix SPAreverse-proxy
: for domains and https during development
- packages
email-templates
: a package for email templateseslint-config
: a package for eslint configurationtypescript-config
: a package for typescript configuration
To start with the setup make sure you have the correct NodeJS version stated in .tool-versions.
For the node versioning we recommend asdf. At the time of writing this readme the version is 20.15.0
After these steps, run the following command
pnpm install
Now to configure our reverse proxy we need to install Caddy. You
can do this using homebrew
on mac.
Important
First run has to be run by hand to configure caddy. Later on it will automatically start with the app start script.
To do that proceed with the following
cd ./apps/reverse-proxy
caddy run
After running caddy proceed with the on screen instructions.
Last step is to go our NestJS app and configure its environmental variables and docker.
So being in guidebook/apps/api
run the following command
cp .env.example .env
docker-compose up -d
Once the docker is up and running we need to run the migrations. To do that run the following command
pnpm db:migrate
Now in the main directory once you run pnpm dev
it will run everything in parallel
and you should be abble to acces your app on the following adresses!
Service | URL |
---|---|
Web app | https://app.guidebook.localhost |
Api | https://api.guidebook.localhost |
Swagger | https://api.guidebook.localhost/api |
-
-
generate migration
pnpm db:generate
-
run migrations
pnpm db:migrate
-
Important
Once migration is generated chagne its name to something more descriptive.
Also make sure to change the migration name in _journal.json file under the tag
key.
-
To generate the http client run the following command.
pnpm generate:client
This command automates the process of creating a TypeScript client for the API based on the Swagger specification.
-
Email templates are generated on every start of turborepo. To generate them manually run the following command in
packages/email-templates
.pnpm build
The mailhog service is available at mailbox.guidebook.localhost
-
- Frontend:
pnpm test:web
pnpm test:web:e2e
- Backend:
pnpm test:api
pnpm test:api:e2e
- Frontend:
This project was generated using Selleo Guidebook which is licensed under the MIT license.