Skip to content

Lottify assists with providing the backend services required to list, search, preview, upload and retrieve lottie files

Notifications You must be signed in to change notification settings

shettayyy/lottify

Repository files navigation

Lottify

Lottify assists with providing the backend services required to list, search, preview, upload and retrieve lottie files

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Design Decision
  5. Schema Design
  6. Linting
  7. Environment Variables
  8. Deployment

About The Project

Lottify assists with providing the backend services required to list, search, preview, upload and retrieve lottie files. The project is built using Node.js, Express.js, MongoDB and Mongoose. The project is also linted using ESLint and Prettier. The project is also using Husky, Lint-Staged, Commitlint and Conventional Commits for commit linting.

Built With 🧡

Typescript JavaScript Node.js Express.js MongoDB Docker ESLint Prettier AWS

Getting Started 🚀

To get a local copy up and running follow these simple steps.

Prerequisites 📋

  • Node.js
  • NPM

Installation 🛠️

  1. Clone the repo

    git clone https://github.com/shettayyy/lottify
  2. Install NPM packages

    npm install
  3. Download the .env file shared with you and add it in the root directory. Check .env.template for reference

Usage 📝

Start the server

npm run start:dev

The server should be running on http://localhost:3000/graphql

For the production build

npm run build
npm start

Design Decision 🎨

We use apollo server for building our endpoint. The server helps with the following:

  • Get a list of all lottie files sorted by the latest uploaded. You can also search for a specific file by providing the search query. We search for the file name, author name, description and user filename. The returned list is paginated.
  • Get a single lottie file by providing the id.
  • Upload a lottie file. The file is uploaded to an AWS S3 bucket and the metadata is stored in the MongoDB database. The upload and metadata retrieval happens without blocking the main thread or making the user wait for the upload to complete.
  • Get a signed URL for the lottie file. The signed URL is valid for 5 minutes and can be used to download the file from the S3 bucket.
  • For the sake of better user reviews, you can clone, clear cloned and clear all lotties to start from scratch.

Schema Design 📐

All details about the schema design can be found in the src/graphql/schema.graphql file or by visiting the /graphql endpoint. I have documented each field and it's visible on the studio.

Linting 🧹

We are using the following tools for linting:

Environment Variables 🌍

We are using the following packages for managing environment variables:

Envalid is used for validating the environment variables and Dotenv is used for loading the environment variables from the .env file.

Deployment 🚀

The project is deployed on Railway. The deployment is done automatically when a new commit is pushed to the main branch.

Contributor

About

Lottify assists with providing the backend services required to list, search, preview, upload and retrieve lottie files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published