Skip to content

guillevc/menugrab-server

Repository files navigation

Menugrab server

ci codecov

This repo contains the backend component of the Menugrab iOS App (https://github.com/guillevc/menugrab-ios).

Details

Here are some small implementation details of menugrab-server. For a description of the full platform, with all its features, refer to the iOS App readme.

  • Node.js REST API using Fastify.
  • Firestore as a database.
  • Integrates with Firebase Authentication Admin aswell, allowing authorization from the iOS app through a Authorization: Bearer <token> header structure holding a Firebase Authentication ID token.
  • Route-specific protection for authenticated users.
  • Integration with Swagger, which generates API documentation based off of defined routes and schemas. It can be accessed trough the /docs route.

Requirements

  • Node.js v14.x
  • Firebase project for Firestore, Firebase Authentication and Firebase Cloud Messaging.

Quick start

Add your Firebase service account key JSON file content base64 encoded as the FIREBASE_CERT_FILE_BASE64 environment variable. The project uses fastify-env, so you can create a .env file at the root directory of the project and set environment variables that way.

Then, simply run:

npm install
npm start

Serves on port 3000 by default. A different port can be specified through the PORT environment variable.