Skip to content

I have automated the advertising of new Wattpad chapters through the Facebook API using web scraping techniques. My dashboard allows me to track several novels, select the time of publication, and follow up on publications.

License

Notifications You must be signed in to change notification settings

Disble/web-stories-follow-up

Repository files navigation

Turborepo starter

This is an official starter turborepo.

Install dependencies

Run the following command:

bun install

What's inside?

This turborepo includes the following packages/apps:

Apps and Packages

  • dashboard: a Next.js app
  • @repo/config-auth: authentication configuration
  • @repo/config-env: environment configuration
  • @repo/config-tailwind: tailwind configuration
  • @repo/config-typescript: typescript configuration
  • @repo/database: Prisma ORM wrapper to manage & access your database
  • @repo/layer-fetch: a layer to fetch data from the external api
  • @repo/layer-prisma: a layer to store and retrieve data from the database
  • @repo/types: a shared types library
  • @repo/ui: a NextUI wrapper

Each package/app is 100% TypeScript.

Utilities

This turborepo has some additional tools already setup for you:

Database

We use Prisma to manage & access our database. As such you will need a database for this project, either locally or hosted in the cloud.

To make this process easier, we offer a docker-compose.yml file to deploy a MySQL server locally with a new database named turborepo (To change this update the MYSQL_DATABASE environment variable in the docker-compose.yml file):

docker-compose up -d

Once deployed you will need to copy the .env.example file to .env in order for Prisma to have a environment variables access.

.env from dashboard:

cp ./apps/dashboard/.env.example ./apps/dashboard/.env.local

.env from database package:

cd ./packages/database/.env.example ./packages/database/.env

If you added a custom database name, or use a cloud based database, you will need to update the POSTGRES_PRISMA_URL and POSTGRES_URL_NON_POOLING in your .env accordingly.

Once deployed & up & running, you will need to create & deploy migrations to your database to add the necessary tables. This can be done using Prisma Migrate:

First you need to open the database package:

cd ./packages/database

Then you can create a migration:

bun prisma migrate dev

If you need to push any existing migrations to the database, you can use either the Prisma db push or the Prisma migrate deploy command(s):

bun run db:push

# OR

bun run db:migrate:deploy

There is slight difference between the two commands & Prisma offers a breakdown on which command is best to use.

An optional additional step is to seed some initial or fake data to your database using Prisma's seeding functionality.

To do this update check the seed script located in packages/database/src/seed.ts & add or update any users you wish to seed to the database.

Once edited run the following command to run tell Prisma to run the seed script defined in the Prisma configuration:

bun run db:seed

For further more information on migrations, seeding & more, we recommend reading through the Prisma Documentation.

Prisma Studio

To start the Prisma Studio GUI for your database, run the following command:

bun prisma studio

Build

To build all apps and packages, run the following command:

bun run build

Develop

To develop all apps and packages, run the following command for all apps and packages:

bun run dev

And for the dashboard app:

bun dev --filter=dashboard

Landing app (Astro):

bun dev --filter=landing

Sync packages with Sherif

To sync packages with Sherif, run the following command:

bunx sherif@latest --fix

Cron Jobs

The cron jobs are defined in the vercel.json file.

You can create the schedule time is in Crontab format. Vercel will run the cron job on the Vercel serverless environment. The timezone of the schedule is UTC.

Useful Links

Learn more about the power of Turborepo:

About

I have automated the advertising of new Wattpad chapters through the Facebook API using web scraping techniques. My dashboard allows me to track several novels, select the time of publication, and follow up on publications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages