Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abhay #101

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Abhay #101

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
.vscode
.env
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parser": "flow",
"printWidth": 120,
"singleQuote": true,
"semi": true,
"trailingComma": "none"
}
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,62 @@ I've collected usernames of amazing stargazers :star: in Github. By using Github

You need to submit Github Token to access Github API.

## Getting Started
##### Pre-Installation Requirements
###### Node
- Download and install latest stable version of [Node](https://nodejs.org/en/download/). This app is tested on Node version v6.10.3

###### MongoDb
- Download and Install [MongoDB Community Edition] (https://docs.mongodb.com/manual/installation/#mongodb-community-edition). This app is tested on MongoDB version v3.4.1

- Create new data directory for mondoDB.
```bash
mkdir -p </path/to/mongodb-data>
```
- Run MongoDB
```bash
mongod --dbpath </path/to/mongodb-data>
```


Now you should have mongoDB server running. If any issue please visit [mongoDB Doc](https://docs.mongodb.com/manual/installation/#tutorials).

Open another terminal/Command Prompt to clone this App.

##### Installing and running curiosity

```bash
# Rest of the guide assumes you already have MongoDB installed and MongoDB server is running.

# Get the latest version
git clone https://github.com/curiositylab/curiosity

# Change directory
cd curiosity

# First time install only
yarn install

# Start the app
yarn run start
```
If installation is successful You should see following message. visit 'http://localhost:3000' to view website.
```
NODE_ENV -> dev
MONGODB_URI -> mongodb://127.0.0.1:27017/curiosity
Starting server on port 3000.
```

Other Scripts for developement and testing.
```bash
# run test for the app
yarn run test-node

# Start app with watch (10s delay)
yarn run watch
```


## Tools I used

* [SweetAlert2](https://limonte.github.io/sweetalert2/)
Expand Down
13 changes: 13 additions & 0 deletions config/.test.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Node ENV for TESTING
# Update PRIVATE section below with correct value
#
#
#


# Public section:-
MONGODB_URI='mongodb://127.0.0.1:27017/curiosityTEST'



# PRIVATE section:-
12 changes: 12 additions & 0 deletions config/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require('dotenv').config();

if (!process.env.NODE_ENV) {
process.env.NODE_ENV = 'dev';
}

const dotenv = require('dotenv').config({
path: `${__dirname}/.${process.env.NODE_ENV}.env`,
});

console.log('NODE_ENV ->', process.env.NODE_ENV);
console.log('MONGODB_URI ->', process.env.MONGODB_URI);
22 changes: 22 additions & 0 deletions config/sample.dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Node ENV for DEVELOPMENT
# Update PRIVATE section below with correct value
# Rename this file to ".dev.env"
#
#


# Public section:-
MONGODB_URI='mongodb://127.0.0.1:27017/curiosity'


# PRIVATE section:-

# Before using passport-github, you must register an application with GitHub.
# If you have not already done so, a new application can be created at developer applications within GitHub's settings panel.
# https://github.com/settings/applications/new
# 'Homepage URL' -> 'http://localhost:3000'
# 'Authorization callback URL' -> 'http://localhost:3000/auth/github/callback'
# Your application will be issued a client ID and client secret. please update following with correct value.

GITHUB_CLIENT_ID='--insert-github-client-id-here--'
GITHUB_CLIENT_SECRET='--insert-github-client-secret-here--'
Loading