🕶️ An anonymous ask & answer box
📬My box is at http://tape.thungghuan.xyz, welcome to ask me anything and star this repository.
Since I'm too lazy to download the app to make my own question box, I decide to make one myself...
-
Install mongodb and run it first
mongod
git clone https://github.com/Thungghuan/tape.git
cd tape
npm install
-
-
Default configuration will be used
-
Use your own configuration
cp config/config.default.js config/config.js # use any editor to change configuration vim config/config.js
server_port: back-end port, default 3000, request_url: base url for front-end requests, default "http://localhost:3000", mongodb_url: the url of mongodb in your server, default "mongodb://localhost:27017", cross_resource_origin: your front-end address to set cros, default "http://localhost:8000", session_secret: secret to create session in back-end server, default "keyboard cat", user: { username: your admin username, default "admin", profile_url: your admin profile pic url, default "http://cdn.thungghuan.xyz/lzh-68888866.jpg", background_url: your page background image url, default
"https://pic1.zhimg.com/80/v2-6c5e3fcffd92c1149c28e1d075881043_720w.jpg?source=1940ef5c" }
-
npm run server
npm run serve
npm run build
Since the project use Vue Router's history mode, for this single page client side app, without a proper server configuration, the users will get a 404 error if they access a child route directly in their browser.
To fix the issue, all you need to do is add a simple catch-all fallback route to your server. See this.
- Everyone can visit the root page
/
to check all public questions - To ask a question, click the button in the home page or visit
/ask
- To check the answer of a question, click the tape of the question
- Visit admin page
/admin
for admin management. For the first time, it will redirect to a register page/register
, and then will redirect to the login page/login
- After signing up and signing in, it will finally redirect to admin page
/admin
and will show all questions, including those are not public and haven't answered yet - To answer one question or to update the answer of on question, click the tape of the question
For further developing, maybe I'll add some more features.
I call these 'To-do', but maybe I will never ever come back to achieve them :)
- Make it to be used by more users, not just one admin.
- Add a sub-question for every question, then someone can ask more about one topic.
- Inform the asker when the question is answered.
- Maybe Wechat Mini Program?