mauriciabad / begursecret

Descobreix Begur App by Maurici Abad

Home Page:https://begursecret.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Begur Secret App

Discover incredible places and explore Begur like never before.

https://begursecret.com

Development

Setup

  1. Install Node.js and pnpm

    # Install Node.js first
    npm i -g pnpm
  2. Create the file .env.local.

    • Copy the .env.example file and update the variables.
    • Or ask @mauriciabad for the file.
  3. Install the project's dependencies:

    pnpm i
  4. Run development server:

    pnpm dev
  5. Open http://localhost:3000 with your browser.

Using local database

By default, the app will connect to stage database in PlanetScale, but you can run it locally too.

  1. Install docker.

  2. Run the database in another console:

    pnpm db:local:run-db
  3. (Optional) Generate migrations if necessary:

    pnpm db:generate
  4. Run database migrations:

    pnpm db:local:migrate
  5. Run the app:

    pnpm db:local:run-app
  6. (Optional) Visualize the data with Drizzle Studio in another console:

    pnpm db:local:studio

Contributing

How to deploy changes in the database

  1. Make the changes in your code, testing them with the local database.
  2. Run pnpm db:generate to generate the migrations.
  3. Run pnpm db:push to upload the migrations to PlanetScale stage branch.
    • Only 1 branch can be pushed to PlanetScale at a time, if there were contents from another change they will be overridden. This is because we use the PlanetScale free tier.
  4. Run the GitHub's CI after the stage database is updated, by pushing a commit or running it manually.
    • GitHub's CI is configured to run on stage database, so it will catch any error.
  5. Right before merging the PR, go to PlanetScale dashboard and create a deploy preview and deploy it.
  6. Merge the PR in GitHub.

Access to other services

Ask @mauriciabad for access.

These are the services we use related to the code:

About

Descobreix Begur App by Maurici Abad

https://begursecret.com

License:GNU General Public License v3.0


Languages

Language:TypeScript 97.8%Language:JavaScript 2.1%Language:CSS 0.0%Language:HTML 0.0%