Skip to content

imricky/shicishuo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

228 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Welcome to shicishuo ๐Ÿ‘‹

Version License: MIT

A poem website based on Vue, Element, Express, MongoDB and ElasticSearch

๐Ÿ  Demo

Client

Directory Structure

.
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ babel.config.js
โ”œโ”€โ”€ dist 
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ postcss.config.js
โ”œโ”€โ”€ public
โ”‚ย ย  โ”œโ”€โ”€ beyond.jpg  
โ”‚ย ย  โ”œโ”€โ”€ beyond.mp3  
โ”‚ย ย  โ”œโ”€โ”€ favicon.ico 
โ”‚ย ย  โ””โ”€โ”€ index.html  
โ”œโ”€โ”€ src
โ”‚ย ย  โ”œโ”€โ”€ App.vue
โ”‚ย ย  โ”œโ”€โ”€ api
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ http.js 
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ url.js  
โ”‚ย ย  โ”œโ”€โ”€ assets  
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 404.png
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ bg1.jpg
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ bg2.jpg
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ bg404.jpg
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ bg5.jpg
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ logo.png
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ mylogo.png
โ”‚ย ย  โ”œโ”€โ”€ common
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ js
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ poemMethods.js  
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ webcam.js   
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ style
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ index.scss  
โ”‚ย ย  โ”‚ย ย      โ””โ”€โ”€ normalize.css
โ”‚ย ย  โ”œโ”€โ”€ components
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ CoolExplorationCard.vue 
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Footer.vue  
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ HelloWorld.vue
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ PoemCard.vue    
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ TagButton.vue   
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ TopBar.vue  
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ musicPlayer.vue 
โ”‚ย ย  โ”œโ”€โ”€ element-variables.scss  
โ”‚ย ย  โ”œโ”€โ”€ main.js 
โ”‚ย ย  โ”œโ”€โ”€ plugins
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ element.js
โ”‚ย ย  โ”œโ”€โ”€ router
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ index.js    
โ”‚ย ย  โ”œโ”€โ”€ store
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ index.js    
โ”‚ย ย  โ”œโ”€โ”€ utils
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ axios.js    
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ websiteConfig.js    
โ”‚ย ย  โ””โ”€โ”€ views
โ”‚ย ย      โ”œโ”€โ”€ About.vue
โ”‚ย ย      โ”œโ”€โ”€ CoolFeature
โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ FlyingOrder.vue 
โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ shishuo_fm
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ HomePage.vue    
โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ you_draw_i_guess    
โ”‚ย ย      โ”‚ย ย      โ”œโ”€โ”€ Room.vue
โ”‚ย ย      โ”‚ย ย      โ”œโ”€โ”€ RoomList.vue
โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ YouDrawIGuess.vue
โ”‚ย ย      โ”œโ”€โ”€ Home.vue
โ”‚ย ย      โ”œโ”€โ”€ NotFound.vue    
โ”‚ย ย      โ”œโ”€โ”€ Search.vue  
โ”‚ย ย      โ”œโ”€โ”€ poem
โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ CoolExploration.vue 
โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ DailyPoem.vue   
โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ ExploreGoodPoetry.vue   
โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Library.vue 
โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Tag.vue 
โ”‚ย ย      โ””โ”€โ”€ user
โ”‚ย ย          โ”œโ”€โ”€ Login.vue   
โ”‚ย ย          โ”œโ”€โ”€ Profile.vue 
โ”‚ย ย          โ””โ”€โ”€ Register.vue    
โ”œโ”€โ”€ tests
โ”‚ย ย  โ””โ”€โ”€ unit
โ”‚ย ย      โ””โ”€โ”€ example.spec.js
โ””โ”€โ”€ yarn.lock

Install

git clone git@github.com:imricky/shicishuo.git

cd client

yarn install
Add client profile

cd src/utils

touch websiteConfig.js
const websiteConfig = {
  apiUrl: 'http://localhost:3000', // NodeJS Service Address
  websocketUrl: 'http://localhost:1234', // websocket Service Address
};
export default websiteConfig;

Usage

yarn server

// It will start the localhost:8080 port

Package

yarn build

Server

Directory Structure

.
โ”œโ”€โ”€ app.js 
โ”œโ”€โ”€ bin
โ”‚ย ย  โ””โ”€โ”€ www 
โ”œโ”€โ”€ config
โ”‚ย ย  โ”œโ”€โ”€ db.js   
โ”‚ย ย  โ””โ”€โ”€ jwtSecret.js    There is no backend configuration file on GIT. You need to add it yourself
โ”œโ”€โ”€ dao 
โ”‚ย ย  โ”œโ”€โ”€ commonDao.js    
โ”‚ย ย  โ”œโ”€โ”€ faceMusicDao.js 
โ”‚ย ย  โ”œโ”€โ”€ poemsDao.js 
โ”‚ย ย  โ”œโ”€โ”€ userDao.js  
โ”‚ย ย  โ””โ”€โ”€ youDrawIGuessDao.js
โ”œโ”€โ”€ logs    
โ”‚ย ย  โ”œโ”€โ”€ error-2020-03-02.log
โ”‚ย ย  โ”œโ”€โ”€ exceptions.log
โ”œโ”€โ”€ models  
โ”‚ย ย  โ”œโ”€โ”€ commonModel.js
โ”‚ย ย  โ”œโ”€โ”€ faceMusicModel.js
โ”‚ย ย  โ”œโ”€โ”€ poemsModel.js
โ”‚ย ย  โ”œโ”€โ”€ userModel.js
โ”‚ย ย  โ””โ”€โ”€ youDrawIGuessModel.js
โ”œโ”€โ”€ package-lock.json
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ public
โ”‚ย ย  โ”œโ”€โ”€ images
โ”‚ย ย  โ”œโ”€โ”€ javascripts
โ”‚ย ย  โ””โ”€โ”€ stylesheets
โ”‚ย ย      โ””โ”€โ”€ style.css
โ”œโ”€โ”€ routes  
โ”‚ย ย  โ”œโ”€โ”€ faceMusic.js
โ”‚ย ย  โ”œโ”€โ”€ index.js
โ”‚ย ย  โ”œโ”€โ”€ poems.js
โ”‚ย ย  โ”œโ”€โ”€ users.js
โ”‚ย ย  โ””โ”€โ”€ youDrawIGuess.js
โ”œโ”€โ”€ utils   
โ”‚ย ย  โ”œโ”€โ”€ auth.js 
โ”‚ย ย  โ”œโ”€โ”€ elasticsearch.js    
โ”‚ย ย  โ”œโ”€โ”€ handledata.js   
โ”‚ย ย  โ”œโ”€โ”€ logger.js   
โ”‚ย ย  โ”œโ”€โ”€ mongo.js    
โ”‚ย ย  โ”œโ”€โ”€ socketio.js 
โ”‚ย ย  โ”œโ”€โ”€ spiderFlyingOrder.js    
โ”‚ย ย  โ””โ”€โ”€ tools.js    
โ”œโ”€โ”€ views
โ”‚ย ย  โ”œโ”€โ”€ error.ejs
โ”‚ย ย  โ””โ”€โ”€ index.ejs
โ””โ”€โ”€ yarn.lock

Install

cd server

yarn install
Add server profile

cd config/

touch jwtSecret.js
const crypto = require('crypto');

module.exports = {
  MD5_SUFFIX: 'xxx', 
  md5: (pwd) => {
    const md5 = crypto.createHash('md5');
    return md5.update(pwd).digest('hex');
  },
  secretKey: 'xxx',
  sha1Salt: 'xxx',

  faceApiSecretKey: 'xxx', // face++ Secret key
  elasticUrl: 'http://localhost:9200', // ElasticSearch
  neteaseUrl: 'http://localhost:5000', // Service of Netease cloud music๏ผŒI deploy on port 5000.
  baseImageUrl: 'http://localhost:3000/image/', // static image 
};

Usage

npm i -g pm2

pm2 start bin/www --watch  // It will start the localhost:3000 port

MongoDB

Version

MongoDB shell version v4.2.2

Import Data

MongoDB files are relatively large, I don't put it on GitHub. 

If you need the files, Please email me.


//mongorestore --db database_name path_to_bson_file
//You don't need to create a new database first, just enter the command at the command line
mongorestore --db poets databaseBackup/poets

ElasticSearch

Tips

Elasticsearch is used in the project for full-text retrieval, so you need to deploy elasticsearch, The latest version is 7.x, but I use 6.2.4 which has a big gap.

If your installation is version 6.2.4, I can directly use the elasticdump tool to directly send you files (The files are relatively large, I don't put it on GitHub), you can send email to me to receive the files

But if you are installing version 7.x, you need to import mongodb data into elasticsearch. Please refer to one of my blogs for details

On normal startup, you will see the console print out 'all is well'. If the console is not started normally, 'elasticsearch cluster is down!' will be printed out

It only affect the use of search function

Netease Api(music)

Install

https://binaryify.github.io/NeteaseCloudMusicApi/#/

TODO:

  • ๆ‰พๅ›žๅฏ†็ 
  • ไธชไบบ่ฎพ็ฝฎ้กต้ข๏ผŒ้‡็ฝฎๅฏ†็ ๏ผŒ่ฎพ็ฝฎไธชๆ€ง็ญพๅๅ’Œๅคดๅƒ
  • ่ฏ—่ฏๆณจ้‡ŠๅŠŸ่ƒฝ
  • ่ฏ—่ฏๅฏ่ง†ๅŒ–
  • ็งป้™คๆ”ถ่—
  • ๆˆ‘็š„ๅˆ›ไฝœๅˆ—่กจ
  • ๅˆ›ไฝœไธญๅฟƒ
  • ๅˆ›ไฝœ็‚น่ตžๆŒ‰้’ฎๅ’Œ็ปŸ่ฎก

Thanks

Author

๐Ÿ‘ค imricky

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a โญ๏ธ if this project helped you!


๐Ÿ”” If you have any questions, please email me๏ผ

About

โœจ ๐ŸŽ‰ A poem website based on Vue, Express, MongoDB and Elastic

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages