Skip to content

Terbau/CineClash

Repository files navigation

CineClash

An expo app made for the course "Design and implementation of mobile application" at Politecnico di Milano.

Prerequisites

  • node.js v20.19+, v22.12+, or v24.0+
  • pnpm package manager (install globally with npm i -g pnpm)
  • maestro (for e2e testing only)

Installation

  • Install packages
pnpm i

Note: The command will likely end with an error after the packages have been installed. This is due to a step in the install process that requires environment variables. You can fix this by running doppler run pnpm i instead.

Setup

In order to run the application, you need to use doppler. Doppler is a service that manages environment variables for large teams. This avoid having a local .env file.

All of the following commands should be run in the project root.

  1. Login to doppler
doppler login
  1. Setup doppler to use the correct project. When prompted, choose monoapp -> dev
doppler setup

How to Run

Run the application by prepending doppler run (this loads environment variables)

doppler run pnpm dev

Important: If you are having issues with running the IOS simulator, please navigate to /apps/expo and run npx expo start --go and then click I on your keyboard when prompted. This is because you might have to set some automatic initial settings. After this and onwards you can run the pnpm command from the root folder like usual.

How to Test

There are two types of tests in this project, unit tests with jest and end to end tests (e2e) with maestro.

  1. In order to run the unit test, run
doppler run pnpm test
  1. In order to run the e2e tests, the app needs to be installed on the simulator and be running the dev client:
cd apps/expo
doppler run -- npx expo run:ios
maestro test .maestro/home.yml

About

This repository uses Turborepo and contains:

.github
  └─ workflows
        └─ CI with pnpm cache setup
.vscode
  └─ Recommended extensions and settings for VSCode users
apps
  ├─ expo
  │   ├─ Expo SDK 54
  │   ├─ React Native 0.81 using React 19
  │   ├─ Navigation using Expo Router
  │   ├─ Tailwind CSS v4 using NativeWind v5
  │   └─ Typesafe API calls using tRPC
  └─ api-server
      └─ E2E Typesafe API Server & Client
packages
  ├─ api
  │   └─ tRPC v11 router definition
  ├─ auth
  │   └─ Authentication using better-auth.
  └─ db
      └─ Typesafe db calls using Prisma & Neon Postgres Database

tooling
  ├─ eslint
  │   └─ shared, fine-grained, eslint presets
  ├─ prettier
  │   └─ shared prettier configuration
  ├─ tailwind
  │   └─ shared tailwind theme and configuration
  └─ typescript
      └─ shared tsconfig you can extend from

In this project, we use @jbe as the organization name for package names. This refers to the first initial of our project member's first names: (J)acob, (B)rage, (E)lise.

FAQ

How to add a new package under /packages/

To add a new package, simply run pnpm turbo gen init in the monorepo root. This will prompt you for a package name as well as if you want to install any dependencies to the new package (of course you can also do this yourself later).

The generator sets up the package.json, tsconfig.json and a index.ts, as well as configures all the necessary configurations for tooling around your package such as formatting, linting and typechecking. When the package is created, you're ready to go build out the package.

How to add and run a database migration

After having made your schema changes to the /packages/db/prisma/schema.prisma file, you must create a migration (a sort of update state that prisma understands). You can do this by running the following command in root:

doppler run pnpm db:migrate

You will be prompted to enter a migration name. Here you can write anything that shortly resembles your changes to the schema (e.g. add_movie).

Then, when clicking enter, prisma will automatically apply the new changes to the hosted database.

NOTE: Please note that you also have to generate the prisma types in order for the changes to be reflected in the code. You can do this by running doppler run pnpm db:generate. You are free to run this command without having run the migration commmand, but then the types locally will not match the hosted database schema.

TRPC router changes not picked up by TypeScript intellisense in expo/nextjs apps

This issue is annoying but not unfixable. Try deleting both node_modules and dist if they exist in /packages/api. Then run pnpm i in the root folder to regenerate the folders.

[Error] "Failed to connect to daemon"

This is a common issue when running doppler run pnpm dev. You can fix it by running the following commands in the root folder:

npx turbo daemon clean

References

The stack originates from create-t3-app.

Screenshots

Landing Screen Sign In Screen Create Account Screen
Home Screen Search Screen Movie Screen
Clash Screen Profile Screen Watched List Screen
No Rankings Screen Not Enough Movies Screen

About

An expo app made for the course "Design and implementation of mobile application" at Politecnico di Milano

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors