Websites
The websites module is a prebuild module for all things related to internet websites, this will evolve over time and should save you time if you want to interact with website entities in your own project.
Install
Follow these instructions to use the websites module in your project.
Package
Install the package into your project:
pnpm install @juicyllama/websites
Api Backend
Import the module into your application:
//app.module.ts
import { WebsitesModule } from '@juicyllama/websites'
@Module({
imports: [
WebsitesModule,
],
})
API Documentation
You can expose the API documentation for websites as follows
//main.ts
import { installWebsiteDocs } from '@juicyllama/websites'
//place this below the swagger setup
redoc = installWebsiteDocs(redoc)
Crons
The websites package has a number of automated processors you can choose to apply to your system depending on your use case.
You can override the default frequency by passing {CRON_NAME}_FREQUENCY
passing a CronExpression
value (provided by @nestjs/schedule
)
For example, if you wanted to invoice clients every month, you could add the following to your .env
file
CRON_WEBSITES_SCREENSHOT_GENERATE=1
CRON_WEBSITES_SCREENSHOT_GENERATE="0 0 1 * *"
Cron | Default Frequency | Description |
---|---|---|
CRON_WEBSITES_WEBSITE_SCREENSHOT_GENERATE | EVERY_MINUTE | Automatically generates thumbnail screenshots for any websites without one |
CRON_WEBSITES_WEBSITE_ICON_GENERATE | EVERY_MINUTE | Automatically generates icons from the websites favicon for any websites without one |
Social
The social module is a prebuild module for all things related to community, this will evolve over time and should save you time if you want to work with everything social related.
Commands
Run these commands from the root of each of your project's directories. If you have multiple projects, e.g. a backend api and a frontend user portal, you will need to run these commands from the root of both projects.