Coder Social home page Coder Social logo

chicago_artworks_app's Introduction

Chicago Artworks App with Firestore, React and Express

This project is created to practice React and Node.js and experiment new features and to be the base for blog posts.

It's full-stack application that includes a Node.js Express backend and a Firestore database. The backend serves as an API for fetching artist and artwork data from Firestore, while the frontend is a React application that consumes this data and displays it to the user. The app also includes a folder named jobs that contains a script that runs every 24 hours to fetch the data from the Art Institute of Chicago API and store it in Firestore. It also has a script to scan the images from wikipedia, compress and store them in a Bucket in Google Cloud Storage.

The deployment of the app was planned to be done in Google Cloud. To do this we build the frontend app using Vite and the backend app using Express.js. The backend app is deployed to Google Cloud Run. We use Google Cloud Storage to store the images and Google Cloud Firestore to store the data of the artists and artworks.

Features

Setup

Prerequisites

  • Node.js and npm installed.
  • A Google Cloud project with Firestore enabled.

Running the Application

To start the application, run:

make run

This will start the server on the defined PORT, defaulting to 8000 if not specified in the environment variables.

API Endpoints

  • GET /api/artists: Fetches a list of artists from Firestore.
  • GET /api/artworks: Fetches a list of artworks from Firestore.
  • GET /api/artworks/:id: Fetches details for a specific artwork by ID from Firestore.

Additional endpoints can be added by defining new routes in the respective modules.

Deployment

For deploying the application to a production environment, we are using Google Cloud Run. The following steps outline the deployment process:

  1. Set environment variables: Configure the necessary environment variables for your production environment, such as the Firestore credentials and the server IP.
  2. Build the frontend: Build the frontend application using the appropriate build command.
make build
  1. Deploy to GCP as a service: Deploy the application to Google Cloud Run using the gcloud CLI or the Google Cloud Console.
gcloud run deploy chicago-service --source .
  1. Access the deployed service: Once the deployment is complete, you can access the service using the provided URL.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.