The Humble Superhero API is a simple yet meaningful application designed to celebrate the uniqueness and humility of superheroes. Every superhero has their own special abilities, but true greatness also comes with humility. This project allows users to add superheroes along with their superpower and humility score, then view a ranked list of superheroes based on their humility.
- Backend:
Express.js(Node.js framework) - Frontend:
React.jswithBootstrapfor styling - Data Storage: In-memory database
[array]
- I would deploy the project so that it is available to everyone, without having to download and install it locally.
- I would make the Search bar functional for easier searching.
- I would add an option to upload a picture of the Superhero.
- I would connect it to a database (MongoDB) so that all Superheroes are constantly available.
Prerequisites
Before proceeding, ensure you have the following installed:
- Node.js (LTS version recommended)
- npm (comes with Node.js) or yarn
- A terminal or command prompt
Clone it using Git:
- https: git clone
https://github.com/Bazzomir/Humble-Superhero-API.git
https://medium.com/@hammadrao891/how-to-clone-a-react-application-from-github-and-run-4f9b742e568a
Change into the project directory:
Then enter the directory (for Front-End):
Then enter the directory (for Back-End):
Run the following command to install the required dependencies:
Using npm:
Using yarn:
To start the local development server, run:
Using npm:
Using yarn:
This will start the application and open it in your default web browser at http://localhost:3000/. (Front-End React.js)
This will start the application and open it in your default web browser at http://localhost:3030/. (Back-End Express.js)
In the api folder
Copy the part from .env.example, create a new file .env on the same level as .env.example and paste the copied stuff into it.
Troubleshooting
If you encounter permission issues, try running commands with sudo (Mac/Linux) or PowerShell as Administrator (Windows).
If dependencies are outdated or broken, try:
or
Conclusion
You have now successfully downloaded, installed, and run a Humble-Superhero-API application locally. Happy coding!