This is my bachelor thesis, which I wrote in 2015. I finally came around to adjust some small things to open source it. Because this project used some internal backend services, the application shown here is not complete, but you should get an idea. When I have time I will try to replicate the internal backend services with reddit.
Currently not working:
- No authentication, you can simply login with every username you want
- Favouriting and voting are not persisted
Nice things for the future:
- Update the used packages
- Typescript
- Build the assets on the server instead of commiting them
- CI
For more information, you can read my BA which can be found in tex/thesis.pdf. It's in german though.
- install node.js and npm. on osx with brew via:
brew install npm
- (install mysql, this is not required but recommended)
In the infoboard/frontend
directory:
npm install
npm start
This will make the site available at http://localhost:3000
.
The optimized production-build can be created like this:
- first make sure
settings.js
is configured correctly, normally you have to change theSERVER_URL
, everytime you want to change a setting you have to rebuild npm install
(if not done previously)node webpack-build
rm -rf dist
mkdir dist && cp index.html ./dist && mv build ./dist/build
This will create a folder named dist
where all relevant files are put into.
Currently the backend is able to serve the static-files, if you haven't changed the project-structure it should
work if you start the backend. To deploy it independently, simple copy the dist-directory
onto a file server.
Before building for production, you must set settings.SERVER_URL
.
It can be found in infoboard/frontend/scripts/settings.js
.
This settings specifies how the frontend will communicate with the backend.
In the infoboard/backend
directory:
npm install
- if you use mysql you must create a user and a database:
mysql -uroot
CREATE DATABASE infoboard;
CREATE USER 'infoboarduser'@'localhost' IDENTIFIED BY 'dai2015';
GRANT ALL PRIVILEGES ON infoboard.* To 'infoboarduser'@'localhost' IDENTIFIED BY 'dai2015';
FLUSH PRIVILEGES;
infoboard
, infoboarduser
and dai2015
are the current default settings.
And can be changed as needed in the config
-directory.
3. Execute node commands/sync.js
to create the tables based on the specified model (to be found in /models
) and delete all data.
4. additionally fill the database with mock-data: node commands/fill.js
5. npm start
Configuration of the backend is done via the files in the config
-directory.
The server will locally listen to port 4000
. You need to make it public
available using servers like apache or nginx. The public-URL must conform with settings.SERVER_URL
set in infoboard/frontend/scripts/settings.js
.