Shameless project (tested on iPhone 16 Pro) I worked on for the voidpet written interview as we were allowed to answer questions in whatever format gets your ideas across most clearly.
/apps/api- Backend API server/apps/mobile- Mobile application (React Native/Expo)
- Node.js (v18 or later recommended)
- npm or yarn
- Docker (for running PostgreSQL database)
- Expo Go app (for testing on physical devices)
- Xcode (for iOS development)
git clone <repository-url>
cd voidpet-interview/voidpet-written-interview-
Navigate to the API directory:
cd apps/api -
Install dependencies:
npm install
-
Set up environment variables:
- Copy
.env.exampleto.env - Update the environment variables as needed
- Copy
-
Start the PostgreSQL database using Docker:
docker-compose up -d
-
Run database migrations:
npx prisma migrate dev
-
Start the development server:
npm run dev
The API will be available at
http://localhost:4000
-
Navigate to the mobile directory:
cd ../mobile -
Install dependencies:
npm install
-
Start the development server:
npm start
This will open the Expo development server in your browser.
-
Run the app on a device or emulator:
- iOS Simulator: Press
iin the terminal or click "Run on iOS simulator" in the browser - Physical Device: Scan the QR code with your phone's camera (iOS) or the Expo Go app (Android)
- iOS Simulator: Press
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/monster_battler?schema=public"
JWT_SECRET="your-secret-key-here"
JWT_ISSUER="voidpet-written-interview"
JWT_AUDIENCE="voidpet-written-interview-mobile"
PORT=4000
npm run dev- Start the development servernpm run build- Build the applicationnpm start- Start the production server
npm start- Start the Expo development servernpm run ios- Run on iOS simulatornpm run web- Run in web browser
The application uses PostgreSQL with Prisma ORM. Database migrations are managed using Prisma Migrate.
To create and apply a new migration:
cd apps/api
npx prisma migrate dev --name your_migration_name