尚未检测到更新。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!