Lottify assists with providing the backend services required to list, search, preview, upload and retrieve lottie files
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.
To get a local copy up and running follow these simple steps.
- Node.js
- NPM
-
Clone the repo
git clone https://github.com/shettayyy/lottify
-
Install NPM packages
npm install
-
Download the
.env
file shared with you and add it in the root directory. Check .env.template for reference
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
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.
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.
We are using the following tools for linting:
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.
The project is deployed on Railway. The deployment is done automatically when a new commit is pushed to the main
branch.