This project is an integral component of the 'Backend Development and API' certification program offered by freeCodeCamp. For comprehensive details on each project requirement, please refer to the following links:
Timestamp Microservice
Request Header Parser Microservice
URL Shortener Microservice
Exercise Tracker Microservice
File Metadata Microservice
In this project, I have chosen to implement the Model-Service-Controller (MSC) design pattern. While the project requirements do not mandate a complex design pattern, I have opted for this approach to familiarize myself with industry-standard practices and to challenge myself to grow as a developer. I acknowledge that there may be opportunities for improvement in this project, and I wholeheartedly welcome any feedback or suggestions you may have. Your input is invaluable not only for the project but also for my personal growth and development as a developer.
This project relies on MongoDB Atlas cloud instances for managing resources such as /shorturl
and /users
. If you
intend to clone this repository and run it locally, please follow these steps:
- Create a MongoDB Atlas Account: To get started, you'll need to create an account on MongoDB Atlas, and the good news is, it's absolutely free! You can follow the step-by-step instructions in the MongoDB Atlas Tutorial – How to Get Started provided by freeCodeCamp to set up your own cluster.
- Configure Your Environment Variables: After setting up your MongoDB Atlas cluster, you'll need to configure your
environment variables. To do this, rename the
.env.sample
file in your project directory to.env
. Then, open the.env
file and insert the MongoDB URI from your Atlas cluster.
Here's what it should look like:
# Database variables
MONGODB_ATLAS_URI=mongodb+srv://<MONGODB_USER>:<MONGODB_PASSWORD>@<MONGODB_CLUSTER_HOST>/<MONGODB_DB_NAME>?retryWrites=true&w=majority
Note: In the example snippet above, you'll notice that the URI includes a database name. While this field is technically optional, it's highly recommended that you create your own database instance on your MongoDB Atlas cluster. This practice helps maintain organization and clarity in your project.
To run the express application, do follow the following steps
- Clone the repo:
git clone [email protected]:mrarvind90/fcc-backend-api-projects.git
- Navigate to the repository:
Change <repository_directory> to the name of the cloned directory.
cd <repository_directory>
- Install Dependencies:
This command will install all the necessary dependencies for the application.
npm install
- Configure Environment Variables: Rename the .env.sample file in your project directory to .env and update it with the
relevant credentials:
cp .env.example .env
- Choose Your Run Mode:
- Development Mode (with automatic code reload):
To run the application in watch mode, enabling seamless source code changes without manual server restarts, use the following command:
npm run dev
- Standard Server Mode:
If you prefer to simply run the server without automatic code reloading, you can use the following command:
npm run start
- Development Mode (with automatic code reload):
While developing this project, there are several areas I plan to focus on for enhancements and refinements which can be found on GitHub.