Sign inSign up

sarj33t/dart-api-server

By sarj33t

•Updated over 1 year ago

Dart-based REST API server integrating with Firestore for fetching user data

Image
API management
Web servers
0

78

sarj33t/dart-api-server repository overview

⁠Quick reference

⁠Dart API Server

A Dart-based API server for interacting with Firestore. This server provides secure OAuth 2.0 authentication and API endpoints to fetch user data. It is containerized with Docker for easy deployment and secure handling of sensitive environment variables using .env files.

⁠Features

  • OAuth 2.0 Authentication with Firebase
  • Firestore Integration for fetching user data
  • Dockerized for easy deployment
  • Secure handling of environment variables using .env

⁠Getting Started

Follow the steps below to get the project up and running.

⁠Prerequisites

  1. Docker and Docker Compose installed on your machine.
  2. Firebase project with credentials and a .env file containing the necessary configuration.

⁠Steps to Run

  • Pull the image:
   docker pull sarj33t/dart-api-server:v1
  • Run the container:
   docker run -v ./path/to/.env:/app/.env -p 8080:8080 sarj33t/dart-api-server:v1

NOTE: Make sure you've passed the .env file while running the container

Your .env file must look like:

FIREBASE_SERVICE_ACCOUNT_JSON='CONTENTS_OF_YOUR_SERVICE_ACCOUNT_JSON'
  • Access the API:

Once the server is running, access the API at http://localhost:8080⁠

  • API Endpoints:

GET: / Confirms Dart API Server is up and Running

GET: /users Returns a list of users from your firestore database

Also, for /users endpoint to work, make sure you've created a users table in your firestore and added some data to it.

Tag summary

Content type

Image

Digest

sha256:bf4087e6e…

Size

302.1 MB

Last updated

over 1 year ago

docker pull sarj33t/dart-api-server:v1