Introduction
Hello everyone, this month I’m planning to redesign and rebuild Onix Fragrance e-commerce site. This project purpose is just have fun and learn new web development stuff. The deadline for this project is a month, so that means the deadline is 4th November 2023.
It's important to note that this website won't facilitate any actual transactions, as it's not an official e-commerce platform. Instead, it's just a sandbox for me to experiment and warm up my web development skills.
Development Stack
The development stack I’m planning to use is:
- NextJS for the UI framework
This is the framework I’m comfortable with so far. I really like the Server Side Rendering (SSR), quick data fetching, SEO-friendly, and super fast page load time.
- Tailwind for the styling
No need to explain it, I can’t resist using tailwind
- MongoDB for database product
The plan is to store all of the product info, user authentication, and user’s cart.
- Docker for infrastructure
I’m planning to use Docker containers so that I don’t need to configure and setup anything like, for instance, MongoDB. I don’t have MongoDB on my machine, so I’m planning to use docker-compose to run a container on my docker engine.
- Bun for package manager and runtime
Bun is a new package manager that is super fast, like blazingly fast.
- AWS for production environment
Design Inspiration
When it comes to finding inspiration for this project's design, I'm inspired on the Vercel official store at https://demo.vercel.store/. This site blew mind because, not only from it’s cool design, the page load is incredibly fast, like millisecond fast.
As for the website's content and structure, my reference point will be the official Onix Website. By using the elements from their site, I plan to ensure that the project aligns nicely with Onix's branding style.
I think that’s it for tonight’s journal entry. I will take a rest and maybe start doing the project around 8 A.M. in the morning. All right, good luck me in the future!
Gathan Mahesa, 00:09, 4th Oct 2023.
Create NextJS App
This part is quite simple, we just need to run this command and it will create a NextJS development framwork for us.
bun create next-app@latest
Setting Up The Environment With Docker
Before we dive into coding session, our first step is to set up a consistent development environment using Docker. This approach make sure that everyone involved in this project can work nicely, eliminating the infamous "It works on my machine" issue.
Note
I need to tell you something, I’m very new to Docker and MongoDB. For now, I have no idea what all of this does, and that’s why I think this is a great way for me to learn to skills. I will try to explain what I understand so far, so, sorry If I explain kinda dumb.
Gathan Mahesa, 08:09, 4th Oct 2023.
Create The Docker Image For The App
Before I create the Docker Compose file, my initial step is to build a standalone Docker image for this application, for testing purposes. Afterward, I'll convert that image to construct the Docker Compose configuration.
Here's the Dockerfile code I've prepared:
FROM node:20 WORKDIR /home/app COPY package*.json . RUN npm ci COPY . . CMD ["npm", "run", "dev"]
This Dockerfile is a basic Node.js docker image application. It sets up a working directory, copies the package.json and package-lock.json files, runs
npm ci
to install dependencies, and copies the remaining application files. Finally, it executes the npm run dev
command to initiate the application when the image is run.# Build the Docker image for Onix development sudo docker build -t onix:dev . # Run a Docker container in detached mode, mapping port 3000, and synchronizing code sudo docker run -d -p 3000:3000 -v $(pwd):/home/app --name onix onix:dev
These commands are used to verify if code synchronization between my local file system and Docker's file system is successful. With this successful test, I will modify the Dockerfile of the app and write a Docker Compose file for that.
Dockerfile
FROM node:20 WORKDIR /home/app # Install dependencies COPY package*.json . RUN npm ci # Set an environment variable to enable code reloading ENV NODE_ENV=development # Expose the development server port EXPOSE 3000 # Start the development server CMD ["npm", "run", "dev"]
docker-compose.yml
version: '3' services: app: build: context: . dockerfile: Dockerfile ports: - "3000:3000" volumes: - .:/home/app
With this setup, we don't need to specify the volume mount and other options when running the container manually. We can build and run our Docker container with Docker Compose using the following commands:
docker-compose build docker-compose up -d
Now, our code from our local machine with the code in the container are synchronized
Adding The MongoDB Image and Connect To It
After configuring our app image, it's time to configure the MongoDB image to our environment and create a connection between NextJS and the database. We can achieve this by modifying our Docker Compose file as follows:
version: '3.9' services: mongo: image: mongo:latest ports: - "27017:27017" volumes: - mongodb-data:/data/db app: build: context: . dockerfile: Dockerfile ports: - "3000:3000" volumes: - .:/home/app depends_on: - mongo environment: MONGO_URI: "mongodb://mongo:27017/onix" volumes: mongodb-data:
We make a function to check our connection with the database
import mongoose from "mongoose"; export const connectDB = async () => { try { await mongoose.connect(process.env.MONGO_URI!, { useNewUrlParser: true, useUnifiedTopology: true, }); console.log('MongoDB connected successfully'); } catch (error) { console.error('Error connecting to MongoDB:', error.message); } }
import { connectDB } from "@/lib/utils" export default async function Home() { connectDB() return ( <main> <div className="w-screen h-screen flex flex-col gap-4 items-center justify-center text-4xl font-semibold tracking-wide"> <h1> Onix Fragrance Website </h1> <span className="text-xl font-light"> Powered by NextJS, MongoDB, and Docker </span> </div> </main> ) }
Now, to execute the Docker Compose setup, we simply need to build and run it using the following commands:
sudo docker compose build sudo docker compose up
Successfully connected to the database.
Task For Tomorrow
With the infrastructure of our project now in place, we've completed our first milestones and learn new things. We've successfully implemented the UI framework, created and connected to our database, and proudly configure our first ever Docker containers using Dockerfile and Docker Compose.
Our task for tomorrow will revolve around scraping all the essential product information from Onix's official Tokopedia store. Subsequently, we aim to enrich our database with the valuable data gathered from this scraping endeavor.
Here's a breakdown of the specific information we intend to extract:
- Product Name: The name of the product.
- Image/Thumbnail Sources: A collection of image sources represented as an array of strings.
- Price: The product's price, represented as a numeric value.
- Description: A product description, which will be processed to present a clean and formatted string. For instance, any
\n
characters in the string will be transformed into actual new lines.
- Stock Availability: Information regarding product availability.
- Sales Data: Insights into the quantity of items sold.
- Product Options: If the product offers variants or options, such as size variations, we will present this data in a clear and organized format. For example:
- 30 ml
- 50 ml
Volumes
- Group: Onix Product have 3 groups: 30ML, 50ML, and Bundling.
It's essential to clarify that the product data scraping task is likely not within the scope of this project, you can add the data to the database manually, but, I just want to look more challenges. Therefore, I may document this to another journal entry.
Getting The Dataset From Tokopedia Using Puppeteer
October 6th 2023, 09:00
Today, we will create a Node.js script that uses Puppeteer to scrape product data from Tokopedia and store it in a JSON file. This script purpose is to acquire a dataset of products that will later be stored into our MongoDB database.
The Code
The code provided uses Puppeteer, a headless browser automation library for Node.js, to navigate Tokopedia's website, extract product information, and save it as a JSON file. Let's break down the key components of the code.
1. Import Dependencies
import puppeteer, { Page } from "puppeteer"; import fs from "fs";
Here, we import the necessary libraries: Puppeteer for web scraping and fs for file system operations.
2. Define URLs and Selectors
const target_urls : string[] = [ "https://www.tokopedia.com/onixofc/etalase/produk-30ml", "https://www.tokopedia.com/onixofc/etalase/produk-50ml", "https://www.tokopedia.com/onixofc/etalase/bundling", ] const clickable_selector: string = '.pcv3__info-content.css-gwkf0u';
Here, we specify a list of target urls to scrape (
target_urls
). We also define a CSS selector (clickable_selector
) that identifies the clickable elements leading to individual product pages.3. Selectors for Data Extraction
const selector_list = [ { selector: '.css-1os9jjn', property: 'innerHTML', key: 'name' }, { selector: '.price', property: 'innerHTML', key: 'price' }, { selector: '.intrinsic.css-1xopdmj > img', property: 'getAttribute', attr: 'src', key: 'images' }, { selector: 'div[data-testid="lblPDPDescriptionProduk"]', property: 'innerHTML', key: 'description' }, { selector: '.css-1yy88m3-unf-heading > b:nth-child(1)', property: 'innerHTML', key: 'stock' }, { selector: '.items > p:nth-child(1)', property: 'innerHTML', key: 'sold' }, { selector: 'li.css-bwcbiv:nth-child(1) > span:nth-child(2)', property: 'innerHTML', key: 'condition' }, { selector: 'li.css-bwcbiv:nth-child(2) > span:nth-child(2)', property: 'innerHTML', key: 'minimal_order' }, { selector: 'li.css-bwcbiv:nth-child(3) > a:nth-child(2) > b:nth-child(1)', property: 'innerHTML', key: 'product_group' }, ]
These selectors define which elements on the product pages to target for data extraction. Each selector specifies the CSS selector, the property to retrieve (e.g.,
innerHTML
or getAttribute
), and the key to store the data.4. Helper Functions
The script includes a few helper functions:
extractNumberFromString
: This function extracts numbers from a given string.
waitForSelectors
: This function waits for specified selectors to appear on the page.
scrapeDataFromPage
: This function extracts data from a product page using the provided selectors.
5. Main Function
const main = async () => { // Launch a headless browser instance. const browser = await puppeteer.launch({ headless: false }); const products: any[] = []; // Loop through target URLs. for (const url of target_urls) { const page = await browser.newPage(); await page.goto(url, { waitUntil: "domcontentloaded" }); await page.waitForSelector(clickable_selector); const anchors = await page.$$(clickable_selector); // Loop through clickable elements (product links). for (const element of anchors) { const link = await element.getProperty("href"); const linkUrl = await link.jsonValue(); const newPage = await browser.newPage(); await newPage.goto(linkUrl, { waitUntil: "domcontentloaded" }); await waitForSelectors(newPage, selector_list); // Scrape data from the product page. const data = await scrapeDataFromPage(newPage, selector_list); if (data) { console.log(data) products.push(data); } await newPage.close(); } await page.close(); } // Close the browser instance. await browser.close(); // Write the scraped data to a JSON file. const outputFile = "output.json"; fs.writeFileSync(outputFile, JSON.stringify(products, null, 2)); console.log(`Data written to ${outputFile}`); }; main();
The
main
function is where the main scraping process takes place. It iterates through the target URLs, visits each product page, extracts data using the defined selectors, and stores the data in the products
array. Finally, it writes the collected data to a JSON file.Running the Script
To run this script, make sure you've installed the required dependencies (Puppeteer) and have Node.js installed. Then, simply execute the script using the command:
node main.ts
The Dataset
This is the resulting dataset. Now it’s time for us to insert this JSON into our MongoDB database.
[ { "name": "Parfume Collaboration Onix X Dochi Sadega - Long Shower 30ml", "price": "Rp203.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/8/30/2df8383e-bc5d-4043-9c81-125d06fe7b95.png.webp?ect=4g", "description": "Hi, Dengan Niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Parfume Collaboration Onix X Dochi Sadega - Long Shower 30ml<br>Perpaduan aroma manis dan fresh akan terasa sejak semprotan pertama yang diciptakan oleh LONG SHOWER eau de parfum sehingga akan memberikan sensasi menyegarkan dan menenangkan.<br><br>Eau De Perfume 30 ml tahan hingga 8 jam <br><br>General Description : Sweet oriental fruity floral on a woody and musky base<br>Top Note: Sage, Amoise, Fruity<br>Middle Note: Fressia, Rose<br>Base Note: Musk, woody and Benzoin<br><br>Ukuran : 30ml<br>BPOM : NA18230601208<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 236, "sold": "80+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Produk 30ml" }, { "name": "ONIX SEDUCTRESS", "price": "Rp95.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2022/8/18/76be0279-93d8-4f43-826e-fbd83fddb097.jpg.webp?ect=4g", "description": "Hi, Dengan Niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Seductress adalah kolaborasi Onix x Alya Francine <br>Seductress itu lebih ke sweet sensual gitu. Notes aromanya Vanilla, Musk, Amber, Sandalwood. Aromanya cocok banget untuk kegiatan indoor seperti ngedate, dinner atau acara formal lainnya 😍<br><br>Top Note : VANILLA<br>Middle Note : VANILLA, JASMINE, MUGUET<br>Base Note : MUSK, AMBER, VANILLA, SANDALWOOD, COCONUT<br>General Description : Vanillic Froral Ambery<br><br>Ukuran : 30ml<br>Ketahanan : 6-8 Jam<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 792, "sold": "750+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "ONIX SCORPIO (30ml)", "price": "Rp95.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2022/7/12/c32c056a-bf73-4503-a970-9c870f6cbb6b.png.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>karakter aromanya mature kalem banget. Perpaduan aroma coffe, vanilla , dan woodynya bener-bener bikin nyaman 🥰<br>Top notes : Pink Pepper, Orange Blossom <br>Middle notes : Jasmine, Coffee<br>Based notes : Vanilla, Patchouli, Cedarwood<br><br>Ukuran : 30ml<br>Ketahanan : 6-8 Jam<br>BPOM : NA18210600780<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 623, "sold": "1rb+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "ONIX FWB (30 ml)", "price": "Rp95.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/6/6/7c490da4-4b07-458d-84d2-f5d71f9569bb.png.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Untuk fwb, fresh citrus gitu karna ada aroma lemonya tapi nanti dia ada manisnya juga karna campuran aroma vanilla dan caramelnya. Pokoknya ini aromanya unik parah, fresh tapi ada manis-manisnya gitu. Wajib coba sih 🙈<br><br>General Description : Citrus fruity floral with sweet ambery notes<br>Top Note : Bergamot, Lemon, Orange, Apple, Green tea<br>Middle Note : Freesia, White Floral, Amber, Peach, Coconut<br>Bottom Note : Amber, Vetiver, Musk, Vanilla, Cedarwood, Caramel<br><br>Ukuran : 30ml<br>Ketahanan : 6-8 Jam<br>BPOM : NA18210600779<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 50, "sold": "8rb+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "ONIX MEXICOLA (30ml)", "price": "Rp95.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/6/6/c782a811-b151-4c5c-ad7d-60019c6b6b4d.png.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>General description : Sweet fruity floral woody and musk<br>Top notes : Raspberry, apple, pineapple<br>Middle notes : Jasmine, muguet, cyclamen, freesi<br>Based notes : Sandalwood, coconut, musk, tonka, vanilla, caramel<br><br>Kalo pake mexicola vibesnya berasa lagi liat sunset di Bali sambil minum wine 🍻<br><br>Ukuran : 30ml<br>BPOM : NA18210601055<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 1784, "sold": "6rb+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "ONIX SENOPARTY (30ml)", "price": "Rp95.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/7/13/c5834a75-7975-4fd4-855f-dec290dd03fb.png.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>General description : Floral pudh herbal caramelic ambery<br>Top notes : Saffron, fir, bergamot, nagarmotha<br>Middle notes : Oud, white floral, tageta<br>Based notes : Amber, musk, caramel cedar, moss<br><br>Cocok banget untuk kegiatan indoor, khususnya dating, dinner atau hangout bareng temen 😊<br><br>Ukuran : 30ml<br>BPOM : NA18210601056 <br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 2101, "sold": "3rb+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "ONIX CALL ME BENTO", "price": "Rp95.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2022/10/21/9a2a0a7f-fd59-417d-b739-f039cb79c57c.png.webp?ect=4g", "description": "Hi, Dengan Niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Call Me Bento itu aromanya lebih ke jasmin dan di akhir ada sedikit powderynya kak. Untuk notesnya ada jasmine, rose musk, cabreuva, cedarwood. biasanya cocok di pakai untuk acara formal seperti acara dinner, wedding party dll. Aroma yang merefleksikan sebuah kepercayaan diri karena memiliki wibawa yang diakui. Aroma yang menggambarkan sebuah kekuatan dalam memimpin dan dikenal karena aura mewahnya <br><br>Top notes : Marigold, bergamot, lemon, prune, tagete<br>Middle notes : Jasmine sambac, ylang, rose, coconut, clove, orange flower<br>Based notes : Amber benzoin, musk, vanilla, cabreuva, cedar<br>General description : White floral on an ambery, woody and musk base<br><br>Ukuran : 30ml<br>Ketahanan : 6-8 Jam<br>BPOM : NA18220602092<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses", "stock": 1317, "sold": "250+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "CHILLIN BABY", "price": "Rp95.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/7/13/b133f798-d217-4872-9125-5c851e4ccf9e.jpg.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>General Description : Floral Fruity<br>Top notes : peach, apple, melony<br>Middle notes : Floral bouquet of mimosa, tuberose, freesia, jasmine and ylang ylang<br>Base notes : sandalwood, musk, oakmoss<br><br>Pokoknya seger dan soft, aromanya cocok untuk aktifitas outdoor 🥰<br><br>Ukuran : 30ml<br>BPOM : NA18210601057<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 217, "sold": "500+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "FRESH BOOK PASSION", "price": "Rp95.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2022/10/21/cef76d78-1a2c-43cd-a958-094e95f8cc85.png.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>General description : Floriental Woody<br>Top notes : Fruity cocktail of blackcurrant, red apple, raspberry and mango<br>Middle notes : Consist of floral bouquet of jasmine, violet, plum and blach fig<br>Based notes : Musk, sandalwood, cedarwood, amber and vanilla<br><br>Biasanya cocok di pakai untuk kegiatan santai di outdoor 🤗<br><br>Ukuran : 30ml<br>BPOM : NA18220602090<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 775, "sold": "100+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "ONIX ROSE", "price": "Rp179.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/1/31/a09f2e1c-02f3-443c-b721-a40beaa3881d.jpg.webp?ect=4g", "description": "Hi, Dengan Niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Aroma manis dan fresh akan terasa sejak semprotan pertama yang diciptakan oleh ROSE eau de parfum sehingga akan memberikan sensasi menyegarkan dan menenangkan. Cocok banget untuk daily di outdoor maupun di indoor 🥰<br><br>General Description : Sweet oriental floral on a woody, musky and powdery base<br>Top Note: mandarin, bergamot, almond, lavender, green<br>Middle Note: ylang, jamine sambac, orris, cyclamen, violet<br>Base Note: sandal, tonka, vanilla, musk, patchouli, caramel<br><br>Ukuran : 50ml<br>BPOM : NA18210602412<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 293, "sold": "80+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "ONIX JACK", "price": "Rp179.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/1/31/88a02555-3c5d-46b1-b859-513be89501c9.png.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Kesan hangat dihadirkan tiap semprotan JACK eau de parfum, sehingga menggambarkan pribadi yang maskulin dan misterius. Varian ini cocok banget buat ke acara formal dan memberi kesan kepribadian misterius gitu 😎<br> <br>General Description : Leathry oriental floral on a woody, musky and powdery base<br>Top Note: Pink paper, cardamon, saffron,coriander, raspberry<br>Middle Note: Jasmine sambac, orange flower, orris, suede, violet, leather<br>Base Note: Amber, moss, patchouli, vanilla, cedar, musk<br><br>Ukuran : 50ml<br>BPOM : NA18210602411<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 130, "sold": "100+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "ONIX GRATITUDE", "price": "Rp187.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2022/9/27/cf7c52e4-f82e-4f41-a486-9c03a09b105f.png.webp?ect=4g", "description": "Hi, Dengan Niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Gratitude itu aromanya lebih ke fresh floral elegant gitu kak. Untuk notesnya ada White Floral, Amber, Musk, vanilla, sandalwood. Aromanya cocok untuk segala occasion baik indoor atau outdoor 🥰<br><br>Top Note : Green, Fruity, Ozone <br>Middle Note : White Floral, Caramel, Lactone, Violet<br>Bottom Note : Amber, Musk, Vanilla, Sandalwood, Cedarwood<br>General Description : Floral Sweet With Musky Ambery & Woody Base <br><br>Ukuran : 50ml<br>Ketahanan : 6-8 Jam<br>BPOM : NA18220601509<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 4223, "sold": "1rb+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "HELENA", "price": "Rp198.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2022/12/27/27268193-5c54-48f2-8979-7ac94ce81f17.jpg.webp?ect=4g", "description": "Hi, Dengan Niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Helena adalah collaboration done by Onix & Bimo Pd<br>Helena itu agak spicy di awal, tapi begitu udh masuk ke fase middle notes nya dia bisa nge-blend jadi mewah dan nyaman banget notesnya ada Bergamot, Gourmand, Patchouli, Amber. Cocok banget buat acara indoor gitu atau ditempat yg dingin karena bisa kasih kesan mewah tapi tetap bisa ngasih kesan Warm gitu 😎<br><br>Top Notes : Lemon, Bergamot, Ozonic, Gourmand<br>Middle Notes : Violet, Black Pepper, Pink Peppercorn, Cardamom<br>Base Notes : Patchouli, Vetiver Haiti, Dry Wood, Amber<br><br>Ukuran : 50ml<br>Ketahanan : 6-8 Jam<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 4285, "sold": "750+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "ONIX FWB", "price": "Rp179.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2021/9/21/a2c2c5c7-57e9-4858-a83f-2167d4e800ef.jpg.webp?ect=4g", "description": "Hi, Dengan Niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Fwb lebih ke fresh citrus gitu karna ada aroma lemonya tapi nanti dia ada manisnya juga karna campuran aroma vanilla dan caramelnya. Pokoknya ini aromanya unik parah, fresh tapi ada manis-manisnya gitu. Wajib coba sih 🙈<br><br>Top Note : Bergamot, Lemon, Orange, Apple, Green tea<br>Middle Note : Freesia, White Floral, Amber, Peach, Coconut<br>Bottom Note : Amber, Vetiver, Musk, Vanilla, Cedarwood, Caramel<br>General Description : Citrus fruity floral with sweet ambery notes<br><br>Ukuran : 50ml<br>Ketahanan : 6-8 Jam<br>BPOM : NA18210600779<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 741, "sold": "10rb+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "parfum onix senoparty", "price": "Rp167.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/7/13/f8625747-52dd-43e3-a3c8-2858fc57cd36.jpg.webp?ect=4g", "description": "Hi, Dengan Niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Senoparty dia aromanya sensual luxury gitu. Notes aromanya Floral Oudh, caramelic dan ambery. Cocok banget untuk kegiatan indoor, khususnya dating, dinner atau hangout bareng temen 😊<br><br>Top notes : Saffron, fir, bergamot, nagarmotha<br>Middle notes : Oud, white floral, tageta<br>Based notes : Amber, musk, caramel cedar, moss<br>General description : Floral pudh herbal caramelic ambery<br><br>Ukuran : 50ml<br>Ketahanan : 6-8 Jam<br>BPOM : NA18210601056<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 2155, "sold": "6rb+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "ONIX MEXICOLA", "price": "Rp178.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/10/3/cfc62af3-a318-4788-b5ae-161f3fb44fd4.png.webp?ect=4g", "description": "Hi, Dengan Niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>Mexicola ini aromanya bikin nyaman parah, aromanya tuh campuran dari vanilla coconut, pineapple, dan ada musknya. Pokoknya kalo pake mexicola vibesnya berasa lagi liat sunset di Bali sambil minum wine 🍻<br><br>Top notes : Raspberry, apple, pineapple<br>Middle notes : Jasmine, muguet, cyclamen, freesia<br>Based notes : Sandalwood, coconut, musk, tonka, vanilla, caramel<br>General description : Sweet fruity floral woody and musk<br><br>Ukuran : 50ml<br>Ketahanan : 6-8 Jam<br>BPOM : NA18210601055 <br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 2356, "sold": "9rb+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Oh Beauty Fest" }, { "name": "Perfume Unisex Bundling Onix - Mexicola 30ml & Freshbook 30ml", "price": "Rp170.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/7/20/961a7e75-4472-4a6d-a7bf-e5b920b2a8a4.jpg.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia<br><br>PROMO BUNDLING MEXICOLA 30ML & FRESHBOOK PASSION 30ML<br><br>ONIX MEXICOLA EDP 30 ML<br>BPOM : NA18210601055<br>General description : Sweet fruity floral woody and musk<br>Top notes : Raspberry, apple, pineapple<br>Middle notes : Jasmine, muguet, cyclamen, freesia<br>Based notes : Sandalwood, coconut, musk, tonka, vanilla, caramel<br><br>ONIX FRESH BOOK PASSION 30ml<br>BPOM NA18220602090<br>Top notes : Fruity cocktail of blackcurrant, red apple, raspberry and mango<br>Middle notes : Consist of floral bouquet of jasmine, violet, plum and blach fig<br>Based notes : Musk, sandalwood, cedarwood, amber and vanilla<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 775, "sold": "100+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Bundling" }, { "name": "Perfume Unisex Bundling Onix - FWB 30ml & Chillin Baby 30ml", "price": "Rp170.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/7/20/6e7980fe-9a5a-42d5-8941-fe66572a2f72.jpg.webp?ect=4g", "description": " Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia<br><br>PROMO BUNDLING FWB 30ML & CHILLIN BABY 30ML<br><br>ONIX FWB 30 ML<br>BPOM : NA18210600779<br>General Description : Citrus fruity floral with sweet ambery notes<br>Top Note : Bergamot, Lemon, Orange, Apple, Green tea<br>Middle Note : Freesia, White Floral, Amber, Peach, Coconut<br>Bottom Note : Amber, Vetiver, Musk, Vanilla, Cedarwood, Caramel<br> <br>ONIX CHILLIN’ BABY 30ml<br>BPOM NA18210601057<br>Top notes : peach, apple, melony<br>Middle notes : Floral bouquet of mimosa, tuberose, freesia, jasmine and ylang ylang<br>Base notes : sandalwood, musk, oakmoss<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 50, "sold": "100+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Bundling" }, { "name": "PROMO BUNDLING JACK & ROSE", "price": "Rp299.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2023/1/31/4af3486c-26c6-465f-ba3f-ae60950cfe0b.jpg.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>DAPATKAN ONIX JACK & ROSE HANYA 299K<br>DISKON 79.000<br><br>JACK Eau De Parfum 50ml <br>BPOM – NA18210602411<br>General Description : Leathry oriental floral on a woody, musky and powdery base<br>Top Note: Pink paper, cardamon, saffron,coriander, raspberry<br>Middle Note: Jasmine sambac, orange flower, orris, suede, violet, leather<br>Base Note: Amber, moss, patchouli, vanilla, cedar, musk<br><br>ROSE Eau De Perfum 50ml<br>BPOM – NA18210602412<br>General Description : Sweet oriental floral on a woody, musky and powdery base<br>Top Note: mandarin, bergamot, almond, lavender, green<br>Middle Note: ylang, jamine sambac, orris, cyclamen, violet<br>Base Note: sandal, tonka, vanilla, musk, patchouli, caramel<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 130, "sold": "100+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Bundling" }, { "name": "PROMO BUNDLING FWB & MEXICOLA", "price": "Rp367.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2021/10/4/b894b5ff-d7de-4911-a9e2-9995e1f085ea.jpg.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>DAPATKAN ONIX FWB & ONIX MEXICOLA HANYA 367rb<br>DISKON 10.000<br><br>ONIX FWB Eau de parfume 50 ml<br>BPOM : NA18210600779<br>General Description : Citrus fruity floral with sweet ambery notes<br>Top Note : Bergamot, Lemon, Orange, Apple, Green tea<br>Middle Note : Freesia, White Floral, Amber, Peach, Coconut<br>Base Note : Amber, Vetiver, Musk, Vanilla, Cedarwood, Caramel<br><br>ONIX MEXICOLA eau de perfume 50 ML<br>BPOM : NA18210601055 <br>General description : Sweet fruity floral woody and musk<br>Top notes : Raspberry, apple, pineapple<br>Middle notes : Jasmine, muguet, cyclamen, freesia<br>Based notes : Sandalwood, coconut, musk, tonka, vanilla, caramel<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 741, "sold": "1rb+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Bundling" }, { "name": "PROMO BUNDLING FWB & SENOPARTY", "price": "Rp356.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2021/10/4/003d8b6a-198d-4fea-8f42-951cf0526f79.jpg.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>DAPATKAN ONIX FWB & ONIX SENOPARTY HANYA 356rb<br>DISKON 10.000<br><br>Senoparty Eau de parfume 50ml<br>BPOM : NA18210601056 <br>General description : Floral pudh herbal caramelic ambery<br>Top notes : Saffron, fir, bergamot, nagarmotha<br>Middle notes : Oud, white floral, tageta<br>Based notes : Amber, musk, caramel cedar, moss<br><br>ONIX FWB Eau de parfume 50 ml<br>BPOM : NA18210600779<br>General Description : Citrus fruity floral with sweet ambery notes<br>Top Note : Bergamot, Lemon, Orange, Apple, Green tea<br>Middle Note : Freesia, White Floral, Amber, Peach, Coconut<br>Base Note : Amber, Vetiver, Musk, Vanilla, Cedarwood, Caramel<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 741, "sold": "500+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Bundling" }, { "name": "BEST DEAL ! PROMO BUNDLING \"FWB, SENOPARTY & MEXICOLA\"", "price": "Rp524.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2021/10/4/44a45589-db58-4629-9aeb-791b8e3403da.jpg.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>BEST DEAL ! PROMO BUNDLING \"FWB, SENOPARTY & MEXICOLA\"<br>HEMAT SAMPAI Rp 30.000 !!!<br><br>PROMO BUNDLING \"SENOPARTY, MEXICOLA, FWB\"<br><br>FWB Eau de parfume 50 ml<br>BPOM : NA18210600779<br>General Description : Citrus fruity floral with sweet ambery notes<br>Top Note : Bergamot, Lemon, Orange, Apple, Green tea<br>Middle Note : Freesia, White Floral, Amber, Peach, Coconut<br>Bottom Note : Amber, Vetiver, Musk, Vanilla, Cedarwood, Caramel<br><br>MEXICOLA eau de perfume 50 ml<br>BPOM : NA18210601055 <br>General description : Sweet fruity floral woody and musk<br>Top notes : Raspberry, apple, pineapple<br>Middle notes : Jasmine, muguet, cyclamen, freesia<br>Based notes : Sandalwood, coconut, musk, tonka, vanilla, caramel<br><br><br>Senoparty Eau de parfume 50ml<br>BPOM : NA18210601056 <br>General description : Floral pudh herbal caramelic ambery<br>Top notes : Saffron, fir, bergamot, nagarmotha<br>Middle notes : Oud, white floral, tageta<br>Based notes : Amber, musk, caramel cedar, moss<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 741, "sold": "250+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Bundling" }, { "name": "PROMO BUNDLING SENOPARTY & MEXICOLA", "price": "Rp355.000", "images": "https://images.tokopedia.net/img/cache/500-square/VqbcmM/2021/10/4/6d5400eb-36a0-4b12-9ec2-4ded7ec9c55d.jpg.webp?ect=4g", "description": "Hi, Dengan niko disini<br>Ingin wangi sepanjang hari?<br><br>Niko hadir membantu menjawab permasalahan tentang parfume. Ini adalah Official Store resmi onix di tokopedia.<br><br>Sebelum Kakak membeli, yuk kepoin deskripsi produknya. Jangan sampai salah membeli ya :)<br><br>\"SENOPARTY\" & \"MEXICOLA” HANYA 355 rb<br>DISKON 10.000 !!! <br><br>ONIX MEXICOLA eau de perfume 50 ml<br>BPOM : NA18210601055<br>General description : Sweet fruity floral woody and musk<br>Top notes : Raspberry, apple, pineapple<br>Middle notes : Jasmine, muguet, cyclamen, freesia<br>Based notes : Sandalwood, coconut, musk, tonka, vanilla, caramel<br><br>Senoparty Eau de parfume 50ml<br>BPOM : NA18210601056 <br>General description : Floral pudh herbal caramelic ambery<br>Top notes : Saffron, fir, bergamot, nagarmotha<br>Middle notes : Oud, white floral, tageta<br>Based notes : Amber, musk, caramel cedar, moss<br><br>PENTING!!!<br>Setiap komplaint kerusakan barang WAJIB menyertakan vidio unboxing (tanpa cut dan tanpa edit). Komplaint TANPA MENGIRIMKAN VIDEO UNBOXING tidak dapat kami terima dan proses.", "stock": 2155, "sold": "500+", "condition": "Baru", "minimal_order": "1 Buah", "product_group": "Bundling" } ]
We've successfully acquire the dataset for our database. Now, the question I've been wondering is where should I store this dataset?
At first, my initial thought was to store it in my local database. However, I soon realized that this approach wouldn't be ideal and too stupid because it would mean that when other developers try to run my app, their databases would be empty.
So, my current plan is to store the dataset in a cloud database, specifically using AWS as the cloud provider. I'm relatively new to AWS, so this is a great way for me to learn this provider. I will try to create a MongoDB server there, set up an API, and then figure out how to configure everything in my Docker Compose file. This is my task list what I should do:
TASKS
- Setting Up a MongoDB Server on AWS EC2 Here's the plan for this task: First, we'll launch a new EC2 instance and then install MongoDB on it. Following that, we'll populate the database with our dataset.
- Creating an API with Express Once our database is populated with the dataset, we'll develop an API to enable secure communication between our NextJS app and the database.
- Adjusting Docker Compose for Data Integration Since we previously utilized Docker Compose to establish a local MongoDB environment, our goal now is to figure out a way to sync our local database with the data from our AWS database. This way, when someone works with our code and runs 'docker compose up,' their local MongoDB database will already contain our dataset from the AWS database.
Installing MongoDB
Step 1: Import MongoDB GPG Key
To begin, we need to import the MongoDB GPG key for package verification. Run the following command:
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
Step 2: Add MongoDB Repository
Now, let's add the MongoDB repository to our system's package sources list. This is where we'll get the MongoDB packages from. Run the following command:
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
Step 3: Update Package List
After adding the repository, it's essential to update the package list to include the MongoDB packages. Execute the following command:
sudo apt update
Step 4: Install Required Dependencies
Before installing MongoDB, let's ensure we have the necessary dependencies. Run these commands:
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
Step 5: Install MongoDB
Now, we're ready to install MongoDB using the following command:
sudo apt install -y mongodb-org
Step 6: Start MongoDB
To start the MongoDB service, use the following commands:
sudo systemctl start mongod # Start MongoDB sudo systemctl enable mongod # Enable auto-start on boot sudo systemctl status mongod # Check status