Express-Portfolio serves my portfolio website. It includes a project gallery, a blog, and an email contact form.
CHANGELOG.md for version history.
Knex migration files are included to create three tables in the database:
users. Run these with
A Knex seed file is included to populate the
projects table with my portfolio project data. Run this with
Contact form setup
server.js is set up to use Gmail to send mail using Nodemailer. To create your own instance of this app, you would need to add your Gmail account and an application-specific password to the environment:
export GMAIL_USERfirstname.lastname@example.org export GMAIL_PASS=YourGoogleAppSpecificPassword
You can alternatively place the
GMAIL_PASS variables in a
.env file, as detailed below.
Environment variables using .env
.env.example file can be used to create a
.env file to hold environment variables in an easily accessible place in the project directory.
server.js contains a reference to an environment variable that can be used to hold a Google Analytics tracking ID, which gets used in the
The route file
routes/resume.js contains a reference to the environment variable
RESUME_LINK, which can be set in your
.env file to create a short, easily-remembered link to an external resume file.
The included Knex migration files are used for creating tables of blog
posts and portfolio
projects in a Postgres database. These variables in the
.env file can be used to configure your database:
DB_HOST= DB_USER= DB_PASS= DB_NAME= DB_SSL= DB_PORT=
npm test will run StandardJS linting (failing and exiting if there any errors) followed by Mocha/SuperTest unit and integration tests.
npm start to run on port 3000.
- compression gzips resources for speedy transmission
- dotenv loads environment variables from the
- express-minify-html-2 minifies HTML in the Express response object for speedy transmission
- Helmet for HTTP header security
- Knex.js builds SQL queries
- moment formats dates in the blog
- Nodemailer sends email from the contact form
- node-sass-middleware compiles SCSS into CSS
- OpenType.js as a TrueType parser in
- pg as a Postgres client
- ejs-lint for linting EJS templates
- Mocha for testing
- Nodemon for hot reloading in development
- SuperTest for testing HTTP routes
Contact the Author
Tyler Krys made this.