CS 361 was Oregon State University's Software Engineering I course.
A team of five OSU students worked together to build this task management system.
-
Clone this repository to your local machine:
git clone REPO-URL NEW-PROJECTS-NAME
-
cd
into the cloned repository -
Make a fresh start of the git history for this project:
rm -rf .git && git init
-
Install dependencies:
npm install
-
Setup a MySql database for this project
-
Prepare environment file:
cp example.env .env
-
Replace values in
.env
with your custom values
-
Log in to your MySql database and run the SQL queries in
EC3_DDL.sql
file -
Or, if you have installed MySql on your local machine, execute with command:
$ mysql --host=HOST_NAME --user=USER_NAME --password=PASSWORD --reconnect DATABASE_NAME < MIGRATION_FILE
-
Sample data included in the SQL queries
-
Start application:
npm start
-
Start application for development:
npm run dev
-
Prerequisites: Install Git and the Heroku CLI
-
Creating a Heroku remote:
heroku create
-
Renaming remotes:
git remote rename heroku heroku-staging
-
Deploying code:
git push heroku master
-
Prerequisite: Deploy application to Heroku
-
Add ClearDB to the application:
$ heroku addons:create cleardb:ignite
-
Use
heroku config
to get theCLEARDB_DATABASE_URL
value -
Copy the
CLEARDB_DATABASE_URL
value and assign it to the db connection variables in.env
-
Setup database with migration:
$ mysql --host=HOST_NAME --user=USER_NAME --password=PASSWORD --reconnect DATABASE_NAME < MIGRATION_FILE
-
When successfully registered or logged in, creates an auth token (JWT) containing user id and stores it in session. (Session will preserve across multiple pages.)
-
For protected endpoints that require authentication, use middleware
requireAuth
that verifies the auth token in session.-
If the auth token is verified, the user data (id, name, email) will be stored in
req.user
. -
Otherwise redirects to homepage.
-
-
Example:
const { requireAuth } = require('./middleware.js'); app.get('/projects', requireAuth, function(req, res) { console.log(req.user); /* more code here */ });
Output:
{ id: 1, name: 'Test', email: '[email protected]' }
-
Navigate to the jsdoc folder.
mkdir jsdoc && cd $_
if it does not exist -
Running the documentation generator on the command line
../node_modules/jsdoc/jsdoc.js ../index.js
(path to jsdoc.js) (path to yourFile.js) -
This command will create a directory named out/ in the current working directory
-
Within that directory, you will find the generated HTML pages (e.g. yourFile.html)