Skip to content

Commit

Permalink
initial start on build process
Browse files Browse the repository at this point in the history
  • Loading branch information
agracey committed Jul 14, 2021
1 parent 991d82b commit 98f59dc
Show file tree
Hide file tree
Showing 11 changed files with 3,342 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
3,053 changes: 3,053 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "personal-raci",
"version": "1.0.0",
"description": "A simple tool to keep track of different projects and how involved I am in them.",
"main": "server/index.js",
"scripts": {
"start": "node server/index.mjs",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/agracey/personal-raci.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/agracey/personal-raci/issues"
},
"homepage": "https://github.com/agracey/personal-raci#readme",
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/preset-env": "^7.14.7",
"babel-loader": "^8.2.2",
"webpack": "^5.44.0",
"webpack-cli": "^4.7.2"
},
"dependencies": {
"@babel/preset-react": "^7.14.5",
"express": "^4.17.1",
"express-graphql": "^0.12.0",
"graphql": "^15.5.1",
"preact": "^10.5.14"
}
}
11 changes: 11 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Getting Started</title>
<script src="https://unpkg.com/[email protected]"></script>
</head>
<body>
<script src="./index.js"></script>
</body>
</html>
96 changes: 96 additions & 0 deletions public/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions server/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

// import { readFileSync } from 'fs'

// const postgresql_uri = readFileSync('/services/mypsql/uri', 'utf8')

import express from 'express'
import expressGraphQL from 'express-graphql'
import schema from './schema'
import root from './resolvers'


const app = express()

app.use(express.static('public'))

app.use('/graphql', expressGraphQL({
schema,
rootValue: root,
graphiql: true
}))

app.listen(8080, () => {
console.log(`personal-raci listening`)
})




Empty file added server/resolvers.js
Empty file.
33 changes: 33 additions & 0 deletions server/schema.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
buildSchema
} from 'graphql'



export default buildSchema(`
type Project {
name: String!
description: String!
}
type Task {
name: String!
description: String!
}
type Query {
getTasks: [Task]
getProjects: [Project]
}
type Mutation {
addTask(name: String!, description: String): String
editTask(id: ID!, name: String, description: String): String
editProject: String
}
`)
32 changes: 32 additions & 0 deletions sql/tasks.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
DROP TABLE IF EXISTS TaskItems;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";


CREATE TYPE involvement AS ENUM ('R', 'A', 'C', 'I');



CREATE TABLE Projects (
id uuid DEFAULT uuid_generate_v4 (),
name VARCHAR NOT NULL,
description VARCHAR NOT NULL,


PRIMARY KEY (id)
)

CREATE TABLE TaskItems (
id uuid DEFAULT uuid_generate_v4 (),
name VARCHAR NOT NULL,
description VARCHAR NOT NULL,
level involvement,
project_id uuid,


PRIMARY KEY (id),

CONSTRAINT fk_project
FOREIGN KEY(project_id)
REFERENCES Projects(id)
)

10 changes: 10 additions & 0 deletions ui/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { h, render, Component } from 'preact';
/** @jsx h */


render((
<div id="foo">
<span>Hello, world!</span>
<button onClick={ e => alert("hi!") }>Click Me</button>
</div>
), document.body);
42 changes: 42 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// var HtmlWebpackPlugin = require('html-webpack-plugin')
// var CopyWebpackPlugin = require('copy-webpack-plugin');

const webpack = require('webpack')

module.exports = {
entry: './ui/index.jsx',
mode: 'development',
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
}
]
},
resolve: {
extensions: ['*', '.js', '.jsx'],
alias: {
"react": "preact/compat",
"react-dom": "preact/compat"
}
},
output: {
path: __dirname + '/public',
publicPath: '/',
filename: 'index.js'
},
// plugins: [
// new HtmlWebpackPlugin({
// title: 'Volunteer Checkin',
// inject: true,
// template: 'src/index.html',
// filename: './index.html'
// }),
// new webpack.HotModuleReplacementPlugin(),
// new CopyWebpackPlugin([
// {from:'src/images',to:'images'}
// ])
// ]
}

0 comments on commit 98f59dc

Please sign in to comment.