{"id":13553582,"url":"https://github.com/iamraphson/adonisjs-hackathon-starter","last_synced_at":"2025-03-16T08:32:20.047Z","repository":{"id":14706403,"uuid":"76903488","full_name":"iamraphson/adonisjs-hackathon-starter","owner":"iamraphson","description":"A boilerplate for AdonisJS web framework ","archived":false,"fork":false,"pushed_at":"2023-01-12T08:47:04.000Z","size":1570,"stargazers_count":149,"open_issues_count":18,"forks_count":42,"subscribers_count":13,"default_branch":"AdonisJS-4.0","last_synced_at":"2024-04-14T12:36:49.048Z","etag":null,"topics":["adonisjs","hackathon","nodejs","oath","oauth2"],"latest_commit_sha":null,"homepage":"http://adonisjs-hackathonstarter.herokuapp.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamraphson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-19T22:49:09.000Z","updated_at":"2024-04-11T14:42:12.000Z","dependencies_parsed_at":"2023-01-16T21:15:34.625Z","dependency_job_id":null,"html_url":"https://github.com/iamraphson/adonisjs-hackathon-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamraphson%2Fadonisjs-hackathon-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamraphson%2Fadonisjs-hackathon-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamraphson%2Fadonisjs-hackathon-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamraphson%2Fadonisjs-hackathon-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamraphson","download_url":"https://codeload.github.com/iamraphson/adonisjs-hackathon-starter/tar.gz/refs/heads/AdonisJS-4.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806070,"owners_count":20350775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adonisjs","hackathon","nodejs","oath","oauth2"],"created_at":"2024-08-01T12:02:28.736Z","updated_at":"2025-03-16T08:32:19.487Z","avatar_url":"https://github.com/iamraphson.png","language":"JavaScript","funding_links":["https://developer.paypal.com/"],"categories":["JavaScript","AdonisJS"],"sub_categories":[],"readme":"**Live Demo**: http://adonisjs-hackathonstarter.herokuapp.com/\n\nA boilerplate for **AdonisJS 4.1** web applications.\n\nIf you have attended any hackathons in the past, then you know how much time it takes to\nget a project started: decide on what to build, pick a programming language, pick a web framework,\npick a CSS framework. A while later, you might have an initial project up on GitHub and only then\ncan other team members start contributing. Or how about doing something as simple as *Sign in with Facebook*\nauthentication? You can spend hours on it if you are not familiar with how OAuth 2.0 works.\n\nWhen I started this project using *AdonisJs*, my primary focus was on **simplicity** and **ease of use** and also integrate as many API as Possible.\nI also tried to make it as **generic** and **reusable** as possible to cover most use cases of hackathon web apps,\nwithout being too specific. In the worst case you can use this as a learning guide for your projects,\nif for example you are only interested in **Sign in with Google** authentication and nothing else.\n\nAdonisJS Hackathon Starter is a boilerplate application developed with AdonisJS 4.0 (This Branch) to keep you ahead in hackathons.\n\nAdonisJS is a free, open-source Node.js web framework, created by Aman Virk and intended for the development of web applications following the model–view–controller (MVC) architectural pattern\n\n\u003ch4 align=\"center\"\u003eHome Example\u003c/h4\u003e\n\n![](https://user-images.githubusercontent.com/3502724/30498074-43154190-9a4d-11e7-9c66-00d58f29f682.png)\n\n\u003ch4 align=\"center\"\u003eLogin Example\u003c/h4\u003e\n\n![](https://user-images.githubusercontent.com/3502724/30498075-432c77f2-9a4d-11e7-9731-78af5f9d7875.png)\n\n\u003ch4 align=\"center\"\u003eAPI Examples\u003c/h4\u003e\n\n![](https://user-images.githubusercontent.com/3502724/30498072-42f190f6-9a4d-11e7-8e0a-25086d75c0b2.png)\n\nTable of Contents\n-----------------\n\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\n- [Obtaining API Keys](#obtaining-api-keys)\n- [Project Structure](#project-structure)\n- [List of Packages](#list-of-packages)\n- [Useful Tools and Resources](#useful-tools-and-resources)\n- [Recommended Design Resources](#recommended-design-resources)\n- [Recommended Node.js Libraries](#recommended-nodejs-libraries)\n- [Pro Tips](#pro-tips)\n- [FAQ](#faq)\n- [How It Works](#how-it-works-mini-guides)\n- [Deployment](#deployment)\n- [Changelog](#changelog)\n- [Contributing](#contributing)\n- [License](#license)\n\nFeatures\n--------\n\n- **Local Authentication** using Email and Password\n- **OAuth 1.0a Authentication** via Twitter\n- **OAuth 2.0 Authentication** via Facebook, Google, GitHub, LinkedIn, Instagram, Foursquare, Bitbucket\n- Flash notifications\n- MVC Project Structure\n- Bootstrap 4\n- Contact Form (powered by Mailgun or Mandrill or Sendgrid)\n- **Account Management**\n\t- Gravatar\n \t- Profile Details\n \t- Change Password\n \t- Forgot Password\n \t- Reset Password\n \t- Delete Account\n \t- CSRF protection\n \t- Link to Social Accounts\n \t- **API Examples**: Facebook, Foursquare, Last.fm, Instagram, Tumblr, Twitter, Stripe, LinkedIn, Google Map, Github e.t.c.\n\nPrerequisites\n-------------\n- [Mysql](http://www.mysql.com) or [Postgresql](http://www.postgresql.org/)\n- [NodeJS 8.0.0+](https://nodejs.org/en/)\n- [NPM 4.0.0+](https://www.npmjs.com/)\n- [AdonisJS 4.1](http://adonisjs.com/)\n- Command Line Tools\n    - \u003cimg src=\"http://deluge-torrent.org/images/apple-logo.gif\" height=\"17\"\u003e\u0026nbsp;**Mac OS X:** [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) (or **OS X 10.9+**: `xcode-select --install`)\n    - \u003cimg src=\"http://dc942d419843af05523b-ff74ae13537a01be6cfec5927837dcfe.r14.cf1.rackcdn.com/wp-content/uploads/windows-8-50x50.jpg\" height=\"17\"\u003e\u0026nbsp;**Windows:** [Visual Studio](https://www.visualstudio.com/products/visual-studio-community-vs)\n    - \u003cimg src=\"https://lh5.googleusercontent.com/-2YS1ceHWyys/AAAAAAAAAAI/AAAAAAAAAAc/0LCb_tsTvmU/s46-c-k/photo.jpg\" height=\"17\"\u003e\u0026nbsp;**Ubuntu** / \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/3/3f/Logo_Linux_Mint.png\" height=\"17\"\u003e\u0026nbsp;**Linux Mint:** `sudo apt-get install build-essential`\n    - \u003cimg src=\"http://i1-news.softpedia-static.com/images/extra/LINUX/small/slw218news1.png\" height=\"17\"\u003e\u0026nbsp;**Fedora**: `sudo dnf groupinstall \"Development Tools\"`\n    - \u003cimg src=\"https://en.opensuse.org/images/b/be/Logo-geeko_head.png\" height=\"17\"\u003e\u0026nbsp;**OpenSUSE:** `sudo zypper install --type pattern devel_basis` \t\n   \n**Note:** If you are new to AdonisJS, I recommend to watch\n[Getting Started With AdonisJs](https://www.youtube.com/playlist?list=PLWmIA5YpCsizOMoM3tH5NSp1sHmdzVLvW) screencast by tutlage that teaches AdonisJS 3.2 from scratch. Alternatively,\nhere is another great tutorial for building a project management app for beginners/intermediate developers by Ayeni Olusegun - [Build A Contact Management web Application with AdonisJS Framework](http://goodheads.io/2017/08/04/build-contact-management-web-application-adonisjs-framework-part-1/) . Since this branch is written with AdonisJS v4.1, Please follow [Upgrade Note](http://adonisjs.com/docs/4.1/upgrade-guide) and follow [Upgrade Note](http://adonisjs.com/docs/4.0/upgrade-guide) for v4.0\n\nGetting Started\n---------------\n\n#### Via Cloning The Repository:\n\n```bash\n\n# if you don't have nodemon\nnpm install -g nodemon\n\n# if you don't have AdonisJS CLI\nnpm i -g @adonisjs/cli\n\n# To make use of this blueprint\nadonis new starter --blueprint=iamraphson/adonisjs-hackathon-starter\n\n# Change directory\ncd starter\n\n# Run your migrations\nadonis migration:run\n\nadonis serve --dev\n```\n\nObtaining API Keys\n------------------\n\nTo use any of the included APIs or OAuth authentication methods, you will need\nto obtain appropriate credentials: Client ID, Client Secret, API Key, or\nUsername \u0026 Password. You will need to go through each provider to generate new\ncredentials.\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/1000px-Google_2015_logo.svg.png\" width=\"200\"\u003e\n\n- Visit [Google Cloud Console](https://cloud.google.com/console/project)\n- Click on the **Create Project** button\n- Enter *Project Name*, then click on **Create** button\n- Then click on *APIs \u0026 auth* in the sidebar and select *API* tab\n- Click on **Google+ API** under *Social APIs*, then click **Enable API**\n- Next, under *APIs \u0026 auth* in the sidebar click on *Credentials* tab\n- Click on **Create new Client ID** button\n- Select *Web Application* and click on **Configure Consent Screen**\n- Fill out the required fields then click on **Save**\n- In the *Create Client ID* modal dialog:\n - **Application Type**: Web Application\n - **Authorized Javascript origins**: http://localhost:3333\n - **Authorized redirect URI**: http://localhost:3333/auth/google/callback\n- Click on **Create Client ID** button\n- Copy and paste *Client ID* and *Client secret* keys into `.env`\n\n\u003chr\u003e\n\n\u003cimg src=\"http://www.doit.ba/img/facebook.jpg\" width=\"200\"\u003e\n\n\n- Visit [Facebook Developers](https://developers.facebook.com/)\n- Click **My Apps**, then select **Add a New App* from the dropdown menu\n- Select **Website** platform and enter a new name for your app\n- Click on the **Create New Facebook App ID** button\n- Choose a **Category** that best describes your app\n- Click on **Create App ID** button\n- In the upper right corner click on **Skip Quick Star**\n- Copy and paste *App ID* and *App Secret* keys into `.env`\n - **Note:** *App ID* is **clientID**, *App Secret* is **clientSecret**\n- Click on the *Settings* tab in the left nav, then click on **+ Add Platform**\n- Select **Website**\n- Enter `http://localhost:3333` under *Site URL*\n\n**Note:** After a successful sign in with Facebook, a user will be redirected back to home page with appended hash `#_=_` in the URL. It is *not* a bug. See this [Stack Overflow](https://stackoverflow.com/questions/7131909/facebook-callback-appends-to-return-url) discussion for ways to handle it.\n\n\u003chr\u003e\n\n\u003cimg src=\"https://github.global.ssl.fastly.net/images/modules/logos_page/GitHub-Logo.png\" width=\"200\"\u003e\n\n\n- Go to [Account Settings](https://github.com/settings/profile)\n- Select **Applications** from the sidebar\n- Then inside **Developer applications** click on **Register new application**\n- Enter *Application Name* and *Homepage URL*\n- For *Authorization Callback URL*: http://localhost:3333/auth/github/callback\n- Click **Register application**\n- Now copy and paste *Client ID* and *Client Secret* keys into `.env` file\n\n\u003chr\u003e\n\n\n\u003cimg src=\"https://g.twimg.com/ios_homescreen_icon.png\" width=\"90\"\u003e\n\n\n- Sign in at [https://apps.twitter.com/](https://apps.twitter.com/)\n- Click **Create a new application**\n- Enter your application name, website and description\n- For **Callback URL**: http://127.0.0.1:3333/auth/twitter/callback\n- Go to **Settings** tab\n- Under *Application Type* select **Read and Write** access\n- Check the box **Allow this application to be used to Sign in with Twitter**\n- Click **Update this Twitter's applications settings**\n- Copy and paste *Consumer Key* and *Consumer Secret* keys into `.env` file\n\n\u003chr\u003e\n\n\u003cimg src=\"http://www.danpontefract.com/wp-content/uploads/2014/02/logo-linkedin.png\" width=\"200\"\u003e\n\n\n- Sign in at [LinkedIn Developer Network](https://developer.linkedin.com/)\n- From the account name dropdown menu select **API Keys**\n - *It may ask you to sign in once again*\n- Click **+ Add New Application** button\n- Fill out all the *required* fields\n - **OAuth 2.0 Redirect URLs**: http://localhost:3333/auth/linkedin/callback\n - **JavaScript API Domains**: http://localhost:3333\n- For **Default Application Permissions** make sure at least the following is checked: `r_basicprofile`\n- Finish by clicking **Add Application** button\n- Copy and paste *API Key* and *Secret Key* keys into `.env` file\n - *API Key* is your **clientID**\n - *Secret Key* is your **clientSecret**\n\n\u003chr\u003e\n\n\n\u003cimg src=\"https://s3.amazonaws.com/venmo/venmo_logo_blue.png\" width=\"200\"\u003e\n\n\n- Visit the **Account** section of your Venmo profile after logging in\n- Click on the **Developers** tab\n- Then click on the [new](https://venmo.com/account/app/new) link next to **Your Applications (0)**\n- Fill in the required fields: *App Name* and *What Will The App Be Used For?*\n- For **Web Redirect URL** enter: http://localhost:3333/auth/venmo/callback\n- Hit **Create** button\n- Back on the **Developers** tab click on **view** link next to **Your Applications (1) new**\n- Copy and paste **ID** and **Secret** keys into `.env` file\n\n\u003chr\u003e\n\n\u003cimg src=\"https://stripe.com/img/about/logos/logos/black@2x.png\" width=\"200\"\u003e\n\n\n- [Sign up](https://stripe.com/) or log into your [dashboard](https://manage.stripe.com)\n- Click on your profile and click on Account Settings\n- Then click on [API Keys](https://manage.stripe.com/account/apikeys)\n- Copy the **Secret Key**. and add this into `.env` file\n\u003chr\u003e\n\n\u003cimg src=\"https://pixabay.com/static/uploads/photo/2015/05/26/09/37/paypal-784404_960_720.png\" width=\"200\"\u003e\n\n\n- Visit [PayPal Developer](https://developer.paypal.com/)\n- Log in to your PayPal account\n- Click **Applications \u003e Create App** in the navigation bar\n- Enter *Application Name*, then click **Create app**\n- Copy and paste *Client ID* and *Secret* keys into `.env` file\n- *App ID* is **client_id**, *App Secret* is **client_secret**\n- Change **host** to api.paypal.com if you want to test against production and use the live credentials\n\n\u003chr\u003e\n\n\u003cimg src=\"http://33.media.tumblr.com/ffaf0075be879b3ab0b87f0b8bcc6814/tumblr_inline_n965bkOymr1qzxhga.png\" width=\"200\"\u003e\n\n\n- Go to [foursquare for Developers](https://developer.foursquare.com/)\n- Click on **My Apps** in the top menu\n- Click the **Create A New App** button\n- Enter *App Name*, *Welcome page url*,\n- For **Redirect URI**: http://localhost:3333/auth/foursquare/callback\n- Click **Save Changes**\n- Copy and paste *Client ID* and *Client Secret* keys into `.env` file\n\n\u003chr\u003e\n\n\u003cimg src=\"http://img4.wikia.nocookie.net/__cb20130520163346/logopedia/images/8/8d/Tumblr_logo_by_x_1337_x-d5ikwpp.png\" width=\"200\"\u003e\n\n\n- Go to http://www.tumblr.com/oauth/apps\n- Once signed in, click **+Register application**\n- Fill in all the details\n- For **Default Callback URL**: http://localhost:3333/auth/tumblr/callback\n- Click **✔Register**\n- Copy and paste *OAuth consumer key* and *OAuth consumer secret* keys into `.env` file\n\n\u003chr\u003e\n\n\u003cimg src=\"http://iandouglas.com/presentations/pyconca2012/logos/sendgrid_logo.png\" width=\"200\"\u003e\n\n\n- Go to https://sendgrid.com/user/signup\n- Sign up and **confirm** your account via the *activation email*\n- Then enter your SendGrid *Username* and *Password* into `.env` file\n\n\u003chr\u003e\n\n\u003cimg src=\"https://raw.github.com/mailgun/media/master/Mailgun_Primary.png\" width=\"200\"\u003e\n\n\n- Go to http://www.mailgun.com\n- Sign up and add your *Domain Name*\n- From the domain overview, copy and paste the default SMTP *Login* and *Password* into `.env` file\n\n\u003chr\u003e\n\n\n\u003cimg src=\"https://s3.amazonaws.com/ahoy-assets.twilio.com/global/images/wordmark.svg\" width=\"200\"\u003e\n\n\n- Go to https://www.twilio.com/try-twilio\n- Sign up for an account.\n- Once logged into the dashboard, expand the link 'show api credentials'\n- Copy your Account Sid and Auth Token\n\nProject Structure\n-----------------\n\n| Name                               | Description                                                  |\n| ---------------------------------- | ------------------------------------------------------------ |\n| **app/Models**/User.js                 | Mysql/Postgresql schema and model for User.                          |\n| **app/Models**/UserProfile.js                 | Mysql/Postgresql schema and model for User Profile.                          |\n| **app/Controllers/Http**/AccountController.js                 | Controller for Account management                          |\n| **app/Controllers/Http**/ClockworkController.js                 | Controller for Clockwork API functionality                           |\n| **app/Controllers/Http**/FacebookController.js                 | Controller for Facebook API functionality                            |\n| **app/Controllers/Http**/ContactController.js                 | Controller for Contact page                            |\n| **app/Controllers/Http**/FoursquareController.js                 | Controller for Foursquare API functionality                           |\n| **app/Controllers/Https**/GithubController1.js                 | Controller for Github API functionality                           |\n| **app/Controllers/Http**/GoogleMapsController.js                 | Controller for Google Maps API functionality                           |\n| **app/Controllers/Http**/HomeController.js                 | Controller for Home Page                           |\n| **app/Controllers/Http**/InstagramController.js                 | Controller for Instagram API functionality                           |\n| **app/Controllers/Http**/LastFmController.js                 | Controller for LastFM API functionality                           |\n| **app/Controllers/Http**/LinkedinController.js                 | Controller for Linkedin API functionality                           |\n| **app/Controllers/Http**/LobController.js                 | Controller for Lob API functionality                           |\n| **app/Controllers/Http**/NewYorkTimesController.js                 | Controller for New York Times API functionality                  |\n| **app/Controllers/Http**/PayPal.js                 | Controller for Paypal API functionality               |\n| **app/Controllers/Http**/ScrapingController.js                 | Controller for Web Scraping API functionality              |\n| **app/Controllers/Http**/SlackController.js                 | Controller for Slack API functionality              |\n| **app/Controllers/Http**/StripeController.js                 | Controller for Stripe API functionality                |\n| **app/Controllers/Http**/TumbirController.js                 | Controller for Tumblr API functionality                |\n| **app/Controllers/Http**/TwitterController.js                 | Controller for Twitter API functionality                |\n| **app/Controllers/Http**/UploadController.js                 | Controller for Upload functionality               |\n| **app/Controllers/Http**/YahooController.js                 | Controller for Yahoo functionality               |\n| **app/Controllers/Http/Auth**/AuthController.js                 | Controller for login and signup functionality               |\n| **app/Controllers/Http/Auth**/PasswordController.js                 | Controller for password reset functionality               |\n| **public**/                        | Static assets (fonts, css, js, img).                         |\n| **Config**/                        | configurations for your application.                         |\n| **database**/                        | All database related files like migration and seed files.                          |\n| **public**/style.css       | Main stylesheet for your app.                                |\n| **resources/views/account**/                 | Template for *account*.      |\n| **resources/views/auth**/                 | Templates for *login, password reset, signup, profile*.      |\n| **resources/views/api**/                     | Templates for API Examples.                                  |\n| **resources/views/contact**/                     | Template for *Contact*                                 |\n| **resources/views/mail**/                     | Templates for *Mail*                                 |\n| **resources/views/layout**/alerts.edge                    | Template for error, info and success flash notifications.                               |\n| **resources/views/layout**/master.edge                    | Base template.                               |\n| **resources/views**/welcome.edge                    | Home page template.                                |\n| **resources/views**/api.edge                    | API dashboard template.                               |\n| .env.example                       | Your API keys, tokens, passwords and database URI.           |\n| server.js                             | The main application file.                                   |\n| package.json                       | NPM dependencies.                                            |\n| package-lock.lock                          | Contains exact versions of NPM dependencies in package.json. |\n| ace                         | File for enabling commands to run     |\n\nList of Packages\n----------------\n\n| Package                         | Description                                                           |\n| ------------------------------- | --------------------------------------------------------------------- |\n| adonis-ally                           | AdonisJs social authentication provider              |\n| @slack/client                           | Slack Package              |\n| async                           | Utility library that provides asynchronous control flow.              |\n| bcrypt-nodejs                   | Library for hashing and salting user passwords.                       |\n| cheerio                         | Scrape web pages using jQuery-style syntax.                           |\n| clockwork                       | Clockwork SMS API library.                                            |\n| mysql                            | MySql ODM                                  |\n| pg                            | Postgresql ODM                                  |\n| dotenv                          | Loads environment variables from .env file.                           |\n| @adonisjs/framework                | Node.js web framework.                                                |\n| cloudinary                        | Upload images/videos to Cloudinary                                             |\n| serve-favicon                   | Express 4 middleware offering favicon serving and caching.            |\n| fbgraph                         | Facebook Graph API library.                                           |\n| @octokit/rest                   | GitHub API library.                                                   |\n| lastfm                          | Last.fm API library.                                                  |\n| instagram-node                  | Instagram API library.                                                |\n| lob                             | Lob API library                                                       |\n| node-foursquare                 | Foursquare API library.                                               |\n| node-linkedin                   | LinkedIn API library.                                                 |\n| Instagram                       | Instagram API library.                                                 |\n| Moment                           | Date / Time Library.                                        |\n| nodemailer                      | Node.js library for sending emails.                                   |\n| paypal-rest-sdk                 | PayPal APIs library.                                                  |\n| request                         | Simplified HTTP request library.                                      |\n| stripe                          | Offical Stripe API library.                                           |\n| tumblr.js                       | Tumblr API library.                                                   |\n| twilio                          | Twilio API library.                                                   |\n| twit                            | Twitter API library.                                                  |\n| lodash                          | Handy JavaScript utlities library.                                    |\n| @adonisjs/validator       | Validate form in adonisJS |\n| @adonisjs/auth            | Authentication provider in AdonisJS  |\n| @adonisjs/lucid            | ORM provider in AdonisJS  |\n| @adonisjs/mail            | Mail provider in AdonisJS  |\n| @adonisjs/session            | Session provider in AdonisJS  |\n| mocha                           | Test framework.                                                       |\n|standard                       | JavaScript Standard Style            |\n\nUseful Tools and Resources\n--------------------------\n- [JavaScripting](http://www.javascripting.com/) - The Database of JavaScript Libraries\n- [JS Recipes](http://sahatyalkabov.com/jsrecipes/) - JavaScript tutorials for backend and frontend development.\n- [Jade Syntax Documentation by Example](http://naltatis.github.io/jade-syntax-docs/#attributes) - Even better than official Jade docs.\n- [HTML to Jade converter](http://html2jade.aaron-powell.com) - Extremely valuable when you need to quickly copy and paste HTML snippets from the web.\n- [JavascriptOO](http://www.javascriptoo.com/) - A directory of JavaScript libraries with examples, CDN links, statistics, and videos.\n- [Favicon Generator](http://realfavicongenerator.net/) - Generate favicons for PC, Android, iOS, Windows 8.\n- [Goodheads](http://goodheads.io) - Laravel, PHP, Node.js and JS tutorials\n- [Favicon Generator](http://realfavicongenerator.net/) - Generate favicons for PC, Android, iOS, Windows 8.\n-\n\nRecommended Design Resources\n----------------------------\n- [Code Guide](http://codeguide.co/) - Standards for developing flexible, durable, and sustainable HTML and CSS.\n- [Bootsnipp](http://bootsnipp.com/) - Code snippets for Bootstrap.\n- [UIBox](http://www.uibox.in) - Curated HTML, CSS, JS, UI components.\n- [Bootstrap Zero](https://www.bootstrapzero.com) - Free Bootstrap templates themes.\n- [Google Bootstrap](http://todc.github.io/todc-bootstrap/) - Google-styled theme for Bootstrap.\n- [Font Awesome Icons](http://fortawesome.github.io/Font-Awesome/icons/) - It's already part of the Hackathon Starter, so use this page as a reference.\n- [Colors](http://clrs.cc) - A nicer color palette for the web.\n- [Creative Button Styles](http://tympanus.net/Development/CreativeButtons/) - awesome button styles.\n- [Creative Link Effects](http://tympanus.net/Development/CreativeLinkEffects/) - Beautiful link effects in CSS.\n- [Medium Scroll Effect](http://codepen.io/andreasstorm/pen/pyjEh) - Fade in/out header background image as you scroll.\n- [GeoPattern](https://github.com/btmills/geopattern) - SVG background pattern generator.\n- [Trianglify](https://github.com/qrohlf/trianglify) - SVG low-poly background pattern generator.\n\n\nRecommended Node.js Libraries\n-----------------------------\n\n- [Nodemon](https://github.com/remy/nodemon) - Automatically restart Node.js server on code changes.\n- [geoip-lite](https://github.com/bluesmoon/node-geoip) - Geolocation coordinates from IP address.\n- [Filesize.js](http://filesizejs.com/) - Pretty file sizes, e.g. `filesize(265318); // \"265.32 kB\"`.\n- [Numeral.js](http://numeraljs.com) - Library for formatting and manipulating numbers.\n- [Node Inspector](https://github.com/node-inspector/node-inspector) - Node.js debugger based on Chrome Developer Tools.\n- [node-taglib](https://github.com/nikhilm/node-taglib) - Library for reading the meta-data of several popular audio formats.\n- [sharp](https://github.com/lovell/sharp) - Node.js module for resizing JPEG, PNG, WebP and TIFF images.\n\nFAQ\n---\n\n### Why do I get `csrf token mismatch` when submitting a form?\nYou need to add the following code to your form. This has been\nadded in the existing codebase as part of the CSRF protection.\n\n```\n{{ csrfField() }}\n```\n### I get a whoops error when I deploy my app, why?\nChances are you haven't generated the app key, so run `adonis key:generate`.\nChances are you haven't put your credentials in your .env file.\n\nHow It Works (mini guides)\n--------------------------\n\nThis section is intended for giving you a detailed explanation about\nhow a particular functionality works. Maybe you are just curious about\nhow it works, or maybe you are lost and confused while reading the code,\nI hope it provides some guidance to you.\n\n\u003chr\u003e\n\n### How do flash messages work in this project?\nFlash messages allow you to display a message at the end of the request and access\nit on next request and only next request. For instance, on a failed login attempt, you would\ndisplay an alert with some error message, but as soon as you refresh that page or visit a different\npage and come back to the login page, that error message will be gone. It is only displayed once. All flash messages are available in your views via adonisJS sessions.\nTo send a flash message to the view, you need to add the following code \n```js\nsession.flash{error: \"Eroor due to 1.2.3 ..\"})\n```\nTo display the flash message,you need to add the following code.\n```twig\n@if(old('error'))\n    \u003cdiv class=\"alert alert-danger\"\u003e\n        {{ old('error') }}\n    \u003c/div\u003e\n@endif\n```\n\n\u003chr\u003e\n\n### How do I create a new page?\nA more correct way to be to say \"How do I create a new route\". The main file `routes.js` contains all the routes. It's located in the **start** directory\nEach route has a callback function associated with it. You will see 2 arguments\nto routes. In cases like that, the first argument is still a URL string, while the second argument is a callback function.  Example is a route that requires authentication.\n\n```js\nconst Route = use('Route')\nRoute::get('/account', 'AccountController.getAccount').middleware('auth')\n```\nIt always goes from left to right. A user visits `/account` page. Then `auth` middleware checks if you are authenticated:\n\nHere is a typical workflow for adding new routes to your application. Let's say we are building a page that lists all books from database.\n\n**Step 1.** Start by defining a route.\n\n```js\nconst Route = use('Route')\nRoute::get('/books', 'BookController.getBooks');\n```\n---\n\n**Step 2.** Create a new model `Book.js` inside the *app/Models* directory. You can simply run `adonis make:model Book`\n\n```js\n'use strict'\n\nconst Model = use('Model')\n\nclass Book extends Model {\n  \n}\n\nmodule.exports = Book\n```\n\n**Step 3.** Create a migration file like so: `adonis make:migration create_books_table` and it will ask you `choose an action ` select `Create table`\n\n```js\n'use strict'\n\nconst Schema = use('Schema')\n\nclass CreateBooksTableTableSchema extends Schema {\n\n  up () {\n    this.table('books', (table) =\u003e {\n    \ttable.increments()\n        table.string('name').nullable()\n        table.string('isbn').nullable()\n        table.timestamps()\n    });\n  }\n\n  down () {\n    this.drop('books');\n  }\n}\n\nmodule.exports = CreateBooksTableTableSchema\n```\n\n**Step 4.** Create a new controller file called `BookController.js` inside the *app/Controllers/Http* directory. You can simply run `adonis make:controller BookController` and it will ask you `Generating a controller for ?` select `Http Request`\n\n```js\n'use strict'\n\nconst Book = use('App/Models/Book')\n\nclass BookController {\n\n    /**\n     * Return all books\n     * @return View\n     */\n  async getBooks({view}) {\n    let books = await Book.all();\n\n    return view.render('books', { books: books.toJSON() })\n  }\n  \n}\n\nmodule.exports = BookController\n```\n\n**Step 5.** Create `books.edge` template in *resources/views* directory\n\n```js\n@layout('layout.master')\n\n@section('content')\n    @include('layout.nav')\n    \u003cdiv class=\"main-container\"\u003e\n        @include('layout.alerts')\n\n        \u003cdiv class=\"page-header\"\u003e\n            \u003ch2\u003e\u003ci style=\"color: #f00\" class=\"fa fa-book\"\u003e\u003c/i\u003eAll Books\u003c/h2\u003e\n        \u003c/div\u003e\n\n        \u003cul\u003e\n        @each(book in books)\n            \u003cli\u003e {{ book.name }} \u003c/li\u003e\n        @endeach\n        \u003c/div\u003e\n    \u003c/div\u003e\n@endsection\n```\n\nThat's it!\n\u003chr\u003e\n\nDeployment\n----------\n\nOnce you are ready to deploy your app, you will need to create an account with a cloud platform to host it. These are not the only choices, but they are my top\npicks. From my experience, **Heroku** is the easiest to get started with,  deployments and custom domain support on free accounts.\n\n### 1-Step Deployment with Heroku\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/en/a/a9/Heroku_logo.png\" width=\"200\"\u003e\n\n- Download and install [Heroku Toolbelt](https://toolbelt.heroku.com/)\n- In terminal, run `heroku login` and enter your Heroku credentials\n- From *your app* directory run `heroku create`\n- Create a Procfile in your app root. All this file needs to contain is `web: ENV_SILENT=true node server.js` \n- Run `heroku addons:add heroku-postgresql:dev  ` to add a Postgres database to your heroku app from your terminal\n- Since AdonisJS v4 uses Node version 8 or greater and NPM version 3 or greater, we need to state which Node and NPM engine in package.JSON by adding this to the JSON\n```JSON\n \"engines\": {\n    \"node\": \"8.1.x\",\n    \"npm\": \"5.4.X\"\n  }\n```\n- Lastly, do `git push heroku master`.  Done!\n- Run artisan commands on heroku like so `heroku run node ace migration:run`\n\n**Note:** To install Heroku add-ons your account must be verified.\n\n---\n\u003cimg src=\"http://www.opencloudconf.com/images/openshift_logo.png\" width=\"200\"\u003e\n\n- First, install this Ruby gem: `sudo gem install rhc` :gem:\n- Run `rhc login` and enter your OpenShift credentials\n- From your app directory run `rhc app create MyApp nodejs-0.10`\n - **Note:** *MyApp* is the name of your app (no spaces)\n- Once that is done, you will be provided with **URL**, **SSH** and **Git Remote** links\n- Visit provided **URL** and you should see the *Welcome to your Node.js application on OpenShift* page\n- Copy and and paste **Git Remote** into `git remote add openshift YOUR_GIT_REMOTE`\n- Before you push your app, you need to do a few modifications to your code\n\ngo to `htpp.js` in *bootstrap* directory, \n\nThen change `Server.listen(Env.get('HOST'), Env.get('PORT'))` to:\n```js\nServer.listen(Env.get('OPENSHIFT_NODEJS_IP') || '127.0.0.1', Env.get('OPENSHIFT_NODEJS_PORT') || 3333)\n```\nAdd this to `package.json`, after *name* and *version*. This is necessary because, by default, OpenShift looks for `server.js` file. And by specifying `ENV_SILENT=true supervisor server.js` it will automatically restart the server when node.js process crashes.\n\n```js\n\"main\": \"server.js\",\n\"scripts\": {\n  \"start\": \"ENV_SILENT=true supervisor server.js\"\n},\n```\n\n- Finally, you can now push your code to OpenShift by running `git push -f openshift master`\n - **Note:** The first time you run this command, you have to pass `-f` (force) flag because OpenShift creates a dummy server with the welcome page when you create a new Node.js app. Passing `-f` flag will override everything with your *Hackathon Starter* project repository. **Do not** run `git pull` as it will create unnecessary merge conflicts.\n- And you are done!\n\n## Contributing\n\nThank you for considering contributing to AdonisJS Hackathon Starter.\n\n## Security Vulnerabilities\n\nIf you discover a security vulnerability within Hackathon Starter, please send an e-mail to Ayeni Olusegun at nsegun5@gmail.com. All security vulnerabilities will be promptly addressed.\n\n## Credits\n* [Sahat Yalkabov](https://github.com/sahat/hackathon-starter)\n\n## How can I thank you?\n\nWhy not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!\n\nDon't forget to [follow me on twitter](https://twitter.com/iamraphson)!\n\nThanks!\nAyeni Olusegun.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamraphson%2Fadonisjs-hackathon-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamraphson%2Fadonisjs-hackathon-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamraphson%2Fadonisjs-hackathon-starter/lists"}