該網絡應用程序是為了搜索和可視化英格蘭和威爾士的房地產銷售。
它使用Next.js,MongoDB和公開可用的HM土地註冊表數據,該數據已根據公開政府許可證v3.0許可。
©OpenSteetMap貢獻者提供的地圖數據
CSV數據的批量導入需要使用以下命令使用Mongoimport工具(取決於使用的CSV文件中的數據形狀):
// Requires following headertypes in first row of the csv file: id.string(),propertyClassification.string(),saleDate.date(2006-01-02),saleValue.int32(),lon.double(),lat.double(),postcode.string(),line1.string(),line2.string(),city.string(),county.string()
mongoimport --uri "mongodb+srv://USER:[email protected]/DB_NAME?retryWrites=true&w=majority" --collection COLLECTION_NAME --type csv --file FILE_NAME --headerline --columnsHaveTypes
npm install
npm run dev
# or
yarn install
yarn dev
您的應用應該在http:// localhost:3000上啟動並運行。如果它不起作用,請在GitHub討論中發布。
您會看到一條消息,說明“您已連接到MongoDB”,或者“您沒有連接到MongoDB”。確保您提供了正確的MONGODB_URI
環境變量。
成功連接後,您可以參考mongodb node.js驅動程序文檔,以獲取有關如何查詢數據庫的更多說明。
您可以使用Vercel(文檔)將此應用程序部署到雲中。
要將您的本地項目部署到Vercel,請將其推到GitHub/Gitlab/Bitbucket並導入到Vercel。
重要的是:當您在Vercel上導入項目時,請確保單擊環境變量並將其設置以匹配您的.env.local
文件。
另外,您可以通過單擊下面的部署按鈕來使用我們的模板部署。