This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"install": "yarn install:backend && yarn install:frontend", | |
"install:backend": "cd backend && yarn install", | |
"install:frontend": "cd frontend && yarn install", | |
"build": "yarn build:backend && yarn build:frontend", | |
"build:backend": "cd backend && yarn build", | |
"build:frontend": "cd frontend && yarn build", | |
"start": "concurrently \"yarn start:backend\" \"yarn start:frontend\"", | |
"start:db": "sudo mongod --dbpath /data/test/ --port 27017", | |
"start:backend": "cd backend && yarn start", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dependencies | |
node_modules | |
# build | |
dist | |
build | |
# testing | |
coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
express-react-ts | |
├── backend/ | |
├── frontend/ | |
├── .gitignore | |
└── package.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const AWS = require('aws-sdk'); | |
const fs = require('fs'); | |
const fileType = require('file-type'); | |
const multiparty = require('multiparty'); | |
// configure the keys for accessing AWS | |
AWS.config.update({ | |
accessKeyId: process.env.AWS_ACCESS_KEY_ID, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import axios from 'axios'; | |
const FileUpload = () => { | |
// If you are using TypeScript the state will be | |
// const [file, setFile] = useState<FileList | null>(null); | |
const [file, setFile] = useState(null); | |
const submitFile = async () => { | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export S3_BUCKET="my-bucket-name" | |
export AWS_ACCESS_KEY_ID="ALOTOFCHARACTERS" | |
export AWS_SECRET_ACCESS_KEY="aLotMORErandomCHARACTERSformingAhash" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<div class="wrapper"> | |
<div class="header"> | |
header | |
</div> | |
<div class="content"> | |
CONTENT CONTENT CONTENT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rails_12factor', group: :production | |
gem 'puma' | |
ruby "2.3.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: &default | |
adapter: postgresql | |
encoding: unicode | |
# For details on connection pooling, see rails configuration guide | |
# http://guides.rubyonrails.org/configuring.html#database-pooling | |
pool: 5 | |
username: <%= ENV['USERNAME'] %> | |
password: <%= ENV['PASSWORD'] %> | |
host: <%= ENV['IP'] %> |
NewerOlder