Quicki-Wiki is a fully-functioning site that allows public and private users to create wikis. It was built as a back-end project to utilize full RESTful API architecture primarily by using Node.js and Express. It is built with usability in mind and a minimal, responsive design to showcase bootstrap (which was used for styling).
Quicki-Wiki was a project that was part of my Bloc Mentorship Program curriculum. We were tasked with building a functioning wiki site using the Agile process and with only user stories given to us.
- API is modular to allow for easy scaling and feature addition. Separation of concerns was carefully thought out in the build process.
- Databases for wikis and users use PostgreSQL with Sequelize as the ORM.
- Two user classifications are built in for standard (free) and premium users who can access extra features.
- Premium users can add private wikis that are only available to other premium users. They also can add and edit the collaborators of private wikis.
- Passport implemented for user sign-up and authentication.
- Stripe payment api was utilized to upgrade users.
- Integration and unit testing was done using Jasmine.
Free user login:
Email: [email protected] Password: testuser
Make sure you have Node.js, PostgreSQL, and the Heroku CLI installed.
Download and install dependencies. If you are unsure just check the package.json.
git clone [email protected]:darccide/Quicki-Wiki # or clone your own fork
cd wiki-what
npm install
Check that src/db/config/config.json
is setup like below (You may need to change your "username" and "password" depending upon your local setup) and make sure that Postgres is running:
{
"development": {
"username": "postgres",
"password": null,
"database": "quicki-wiki-dev",
"host": "127.0.0.1",
"dialect": "postgres",
"logging": false,
"operatorsAliases": false
},
"test": {
...
},
"production": {
...
}
}
You will need to create a .env
file in order for the application to run smoothly on your computer. Make sure this file is included in your .gitignore
file. If you want the full functionality of the site you will need to set up your own stripe and sendgrid accounts and set up the .env
file with your own STRIPE_API_KEY
and SENDGRID_API_KEY
. Also you will need to set your own cookieSecret
for express sessions.
Note: If you follow the instructions from Sendgrid they will have you create a sendgrid.env file which is where your api key for sendgrid will go.
sequelize db:migrate
sequelize db:seed:all
npm start
Your app should now be running on [localhost:3000].
For Heroku, head over to Heroku and log in (or open an account if you don’t have one).
Create a new app and give it a name
Click the Deploy tab and there you will find instructions how to deploy the app
Check that src/db/config/config.json
is setup like below (make sure the "dialect" is set to postgres)
{
"development": {
...
},
"test": {
...
},
"production": {
"username": "root",
"password": null,
"database": "database_production",
"host": "127.0.0.1",
"dialect": "postgres",
"logging": false,
"operatorsAliases": false,
"use_env_variable": "DATABASE_URL"
}
}
Click the Resources tab and you will see a search field for "add-ons". Click inside of the field and type "Heroku Postgres". Once it appears you can click it.
After clicking Heroku Postgres you will have a modal appear on your screen telling you about the add-on provision you selected. Click the provision button and now Heroku Postgres has been added to you application.
Now you will need to migrate and seed all your data to Heroku
heroku run sequelize db:migrate
heroku run sequelize db:seed:all
Click the Settings tab and you will see a button that says "real config vars". You will need to click that and add the following values.
Note: The only value that should match what you see on the screen is the NODE_ENV
value of production
. This lets Heroku know to execute code related to production so that way your deployment will work properly after being built. All other values should be your own values and the DATABASE_URL
should be provided by Heroku after setting up Heroku Postgres.
Once you have done all of this your version should be deployed an work properly. If for some reason you have decided to use another database then you will need to see if Heroku supports it and also you will need to figure out what must be included for your environment variables.
Steven Thomson is a Fullstack Developer who recently transistioned back to the U.S. If you would like to contact him: