尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
For the past 3 years, mymizu has been harnessing the power of technology and community to tackle single-use plastic waste and encourage people to think and act on the environment in their everyday lives. Now we would like to open up the building of the mymizu platform to the global tech community to see what magic that brings.檢視完整 README ↗mymizu Open-Source Web App
For the past 3 years, mymizu has been harnessing the power of technology and community to tackle single-use plastic waste and encourage people to think and act on the environment in their everyday lives. Now we would like to open up the building of the mymizu platform to the global tech community to see what magic that brings.
We are launching an open-source web app for mymizu that is enabling anyone to search our global, 200,000-strong refill spot network from their browser, but also - we hope - to develop and test out new ideas and features (e.g. filtering refill spots, live community stats, etc).
And we need YOUR HELP to build it.
Each line of code you write has the potential to drastically reduce plastic in Japan. For more information see details below!
pre-requisites:
You will need to get someone from the mymizu team to generate an API key for you.
Simply run:
curl -l 'https://api.mymizu.co/api/start?api_key=$INSERT_API_KEY&platform=ios&client_version=1.0.0&client_build=12345&uuid=UNIQUEUSERID'
# Your response should look like this:
{"new_token":$YOUR_USER_TOKEN} # Use the `new_token` value for user token.
Running the project locally
This repo uses Yarn 1 (classic). If your global yarn is v2 or later, use
npx yarn@1 in place of yarn below.
All commands should be run in the project root directory.
# Create an .env file & insert the appropriate values. Be sure to include your api key and user token from the previous steps.
cp .env.sample .env
# Install dependencies
yarn
# Start the dev loop
yarn dev
Then open http://localhost:3000. yarn dev builds the client and server with
esbuild in watch mode, restarts the server when server code changes, and reloads
open browser tabs after each successful rebuild, so edits show up on save. Build
errors are printed without stopping the watcher. PORT and LIVE_RELOAD_PORT
(default 35729) can be overridden in the environment. Ctrl+C stops everything.
Testing a production build
# Compile both backend & client code (unminified)
yarn build
# Compile for prod. This minifies the compiled files for production
yarn build:prod
# Run the compiled server
yarn start
# Or run it with nodemon, restarting when build/server.js changes
yarn start:reload
Feature flags
Flags live in server/config.js and are read from the environment, so changing
one is a variable and a restart — no code change and no rebuild.
| Variable | Default | What it controls |
|---|---|---|
COOLING_SHELTERS | off | The cooling-shelter layer: whether the API is asked for shelters at all, whether the category filter is shown, and whether shelters count towards cluster totals. Set to 1, true, yes or on to enable. |
The server stamps each flag into the page (window.__COOLING_SHELTERS__) and
passes it to <App>, so the server-rendered markup and the hydrated tree agree.
Routing / Adding Pages
You can add routes to server/server.jsx, and be sure to import the component in which you'd like to inject into the html page, like so:
import { YourCustomComponent } from "path/to/your/component"
//...
app.get("/a-new-page", (req, res) => {
fs.readFile(path.resolve("./public/path/to/your/html/file.html"), "utf8", (err, data) => {
if (err) {
console.error(err);
return res.status(500).send("An error occurred");
}
return res.send(
data.replace(
'<div id="root"></div>',
`<div id="root">${ReactDOMServer.renderToString(<YourCustomComponent />)}</div>`
)
);
});
});
Please see CONTRIBUTING file for information about how to contribute, and report bugs or suggest new features.
Please feel free to join our Slack community You can introduce yourself and share any questions. If you have any ideas for features and / or issues you can also reach out to us here! Or reach out to us directly if you have any questions [email protected]
Thank you to all participants in our Summer 2022 Hackathon for their contributions
and many others!