This demo illustrates how we can combine Third Party Data from https://pokeapi.co with our own backend API. The app allows users to mark Third Party data (pokemon) as 'favourites' by storing them in MongoDB.
- Open the terminal and run the command
npm installto setupexpressandprismalibraries - NOTE:
postinstallwill runprisma generateautomatically to create the Prisma Client based on./prisma/schema.prisma - Add a
.envfile to the root of your project containing the variableDATABASE_URLwith a MongoDB connection String as the value.
This project is compatible with Vercel. Connect your Git Repo to vercel, and add the DATABASE_URL as an environment variable during deployment.
If you find the patterns in this demo useful, you may apply the same approach in your own project. You may be able to borrow this pattern for use in other contexts where a favourites feature is useful.