Wikinexus is an open-source project seeking to explore cognitive and cultural associations within our shared world of knowledge. We aim to find and map patterns emergent in the way humans draw connections across concepts, using Wikipedia as a vehicle for research.
Check out the WIP application deployed on Heroku: https://wikinexus.herokuapp.com/
Stage 1 (current implementation) focuses on collecting and aggregating data. It features a "game play" mode for visitors to connect otherwise unrelated concepts through Wikipedia links alone, as well as a mode to view visualizations and metrics of aggregated data contributed by all visitors.
Stage 2 (after enough data has been collected) will focus on exploring the data and looking for patterns. This remains open-ended but aims to test ML models to look for patterns with additional extracted metadata (e.g. article category classifications).
The project is deployed as a single-page application using the MERN stack:
- React + Redux client on the front end
- Express and Node.js running the back end server
- MongoDB (Cloud Atlas) database
Additional front end libraries of note:
- D3 (interactive network visualizations)
- wikijs (API wrapper to interact with Wikimedia/Wikipedia)
- Bootstrap (layout styling)
NPM entry point is placed at the root folder for compatibility with Heroku's Node buildpack. Thus the server
lives in the root of the project directory, while the client
lives in a sub-folder.
The client
folder follows basic folder structure from create-react-app
and organizes React components, Redux store actions/reducers, and other utilities.
The root server
follows MV* style organization, separating concerns of models, routes, controllers in respective folders.
βββ client # React front end
β βββ build # Built, static content served by Node server
β βββ public # SPA entry point (index.html)
β βββ src # React development source files
βββ config # Environment variable config (including DB URI)
βββ controllers # Handles interactions with database models
βββ models # Defines database schemas
βββ routes # Handles HTTP REST endpoints
βββ Procfile # Declare process for Heroku dyno to run Node web server
βββ server.js # Application entry point, defines Express application
Feel free to fork this repository, submit pull requests, or suggest other features or improvements.
Install server packages:
npm install
Install client packages:
cd client
yarn install
Create a config.env
file under the config/
folder:
NODE_ENV=development
PORT=5000
MONGODB_URI=mongodb+srv://<USERNAME>:<PASSWORD>@<HOST:PORT>/<DB_NAMESPACE>?retryWrites=true&w=majority
Make sure to replace all the <...>
placeholders with actual account/cluster data.
Run client (React) (port 3000) and server (port 5000) concurrently, with hot-reload functionality:
npm run dev
Run client only (port 3000):
cd client
yarn start
Run server only (port 5000):
npm run server
Mimic the Heroku server by serving the built react app using the local server (port 5000):
First make sure the React app is built:
cd client
yarn build
Then serve the app from the root directory:
npm start
Set MongoDB URI (if needed/updated):
heroku config:set MONGODB_URI=<enter_uri_here>
Push git changes to app after committing to master:
git push heroku master
A "postbuild"
npm script will have Heroku build the client upon deployment.