Git Product home page Git Product logo

j1.io-v1's Introduction

j1.io

This is the repository for my personal website, which I've made to look like a standard terminal. This site has multiple pages including an automatic resume grabber, and Spotify playlist integration. It uses Typed.js to accomplish this, along with my own custom styling. j1.io is built using Node.js, a JavaScript runtime built on the V8 engine.

Components

  • NPM modules
    • express - j1.io uses Express as it's web application framework. Express does the routing, request handling, and serving of pages for my website.
    • nib - Stylus CSS mixins.
    • pug - Formerly Jade, Pug is a templating engine which makes it easy to write simple, readable layouts for HTML and pass data into them.
    • request - Request library which makes it easy to send HTTP requests. j1.io uses this library to work with my resume on Google Docs.
    • spotify-web-api-node - Spotify API wrapper used to obtain playlist data from Spotify.
    • stylus - A fantastic CSS generator which allows for very simple CSS files.
  • Dockerfile - Docker script for creating a container for j1.io to deploy.
  • /bin - Contains processing and other functions to keep clutter out of server files including custom Spotify API processing functions.
  • /public - Favicon files, Stylus files, compiled CSS, and additional JavaScript libraries (Typed.js and jQuery).
  • /views - Contains view files which are used by Pug to render HTML pages for clients.
  • package.json - Package information including dependencies for NPM.
  • server.js - Main server file which starts Express, compiles necessary files, and handles requests.

Test Environment

  • CentOS 7
  • Node.js 4.0.0
  • NPM 2.14.2
  • Docker 1.9.1
  • Nginx 1.6.3

Deployment

Docker (Recommended)

To deploy j1.io using Docker, you must first have docker installed for your system.

  1. Clone this repository: $ git clone https://github.com/jswny/j1.io.git

  2. If you would like to connect j1.io to your Spotify account, you must first generate a client ID and client secret for your application (do not share these).

  3. Create a directory called config in the root of the repository that you have cloned.

  4. Create a file config.js in that directory and structure it as follows using your client ID, and client secret: ``` var clientId = '' var clientSecret = ''

module.exports = {
  clientId: clientId,
  clientSecret: clientSecret
}
```
  1. If you do not want to use spotify, simply comment out the following line in server.js which is var s = require('./bin/spotify.js')
  2. Change your working directory so that you are inside the cloned repository: $ cd j1.io
  3. Build the Docker image like so: docker build -t <your username>/j1.io .
  4. Run the application and map it's internal port to any public port you would like, I'll be using the default web server port (port 80): docker run -p 80:3000 -d --name j1.io /j1.io`
  5. If you would like to use an automatic deployment script, you can try the one I've created here however you may want to configure the script before running it.

Manual Deployment

This method is not recommended because it is highly dependent on your system configuration. For example some versions of Node may not support the HEREDOC syntax used in bin/functions.js.

  1. Ensure that you have Node.js, NPM, and Nginx installed on your system (see testing environment).

  2. Clone this repository: $ git clone https://github.com/jswny/j1.io.git

  3. If you would like to connect j1.io to your Spotify account, you must first generate a client ID and client secret for your application (do not share these).

  4. Create a directory called config in the root of the repository that you have cloned.

  5. Create a file config.js in that directory and structure it as follows using your client ID, and client secret: ``` var clientId = '' var clientSecret = ''

module.exports = {
  clientId: clientId,
  clientSecret: clientSecret
}
```
  1. If you do not want to use spotify, simply comment out the following line in server.js which is var s = require('./bin/spotify.js')
  2. Inside the cloned repository, install the required modules with $npm install
  3. Place the following configuration file j1.io.conf inside your Nginx configuration directory (for CentOS that is /etc/nginx/conf.d):
server {
  listen 80; # you can change this to any port you would like your server to respond to
  server_name <your domain>;
  location / {
    proxy_pass http://127.0.0.1:3000;
  }
}
  1. Restart Nginx ($ systemctl restart nginx), or start it if you have not yet: $ systemctl start nginx
  2. Start your j1.io server using your preferred method.
  3. If you would like to start it the normal way, use $ npm start
  4. If you would like to use a process manager like forever (recommended), do the following: 1. $ npm install forever -g 2. forever start server.js

j1.io-v1's People

Contributors

jswny avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

jwne germankingyt

j1.io-v1's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.