Skip to content

Commit

Permalink
Merge pull request #67 from consensusnetworks/develop
Browse files Browse the repository at this point in the history
Promote develop to master
  • Loading branch information
shanejearley authored Jul 14, 2022
2 parents 98ac1d0 + c66dd36 commit 8d0f160
Show file tree
Hide file tree
Showing 19 changed files with 1,165 additions and 291 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ Make sure your development environment has these prerequisites.

3. [SAM CLI (v1.x)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-mac.html) - tool for mocking backend services locally.

### Scripts and dependencies

We are using [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) to simplify monorepo development workflows while keeping project-wide resources accessible.

### Setup

Clone the repository, checkout a new branch from develop, and install all dependencies.
Clone the repository, checkout a new branch from develop, and install all workspace dependencies.

```zsh
git clone https://github.com/consensusnetworks/casimir.git
Expand All @@ -54,7 +58,7 @@ git checkout -b feature/stake-button develop
npm install
```

> 🚩 This will install all workspace dependencies for this monorepo.
> 🚩 'All workspace dependencies' includes `package.json` dependencies listed in the project root and any workspace subdirectories. See [Scripts and dependencies](#-scripts-and-dependencies).
### Serve

Expand Down Expand Up @@ -85,15 +89,16 @@ PROFILE="some-other-aws-name"
STAGE="sandbox"
```

*Supported variables*
#### Supported variables

| Name | Description | Default |
| --- | --- | --- |
| `PROFILE` | AWS profile name | `"consensus-networks-dev"` |
| `STAGE` | Environment stage name | `"dev"` |

## Layout

Code is organized into work directories (apps, services, infrastructure – and more listed below). Individual packages are managed from the project root with [workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces).
Code is organized into work directories (apps, services, infrastructure – and more listed below).

```tree
├── .github/ (workflows and issue templates)
Expand All @@ -110,10 +115,10 @@ Code is organized into work directories (apps, services, infrastructure – and
| └── local/ (mock and serve tasks)
├── services/ (backend services)
| └── users/ (users lambda api)
└── package.json (project npm scripts)
└── package.json (project-wide npm dependencies and scripts)
```

> 🚩 While developing, most likely, you shouldn't have to change into any subdirectories to run commands.
> 🚩 While developing, most likely, you shouldn't have to change into any subdirectories to run commands. Individual **npm packages** (directories with a `package.json`) are managed from the project root with [workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces). See [Scripts and dependencies](#-scripts-and-dependencies).
## Editor
Expand Down
2 changes: 0 additions & 2 deletions apps/website/src/composables/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export default function useUsers() {
},
body: JSON.stringify({ email })
}

console.log(requestOptions)
const usersBaseUrl = getUsersBaseUrl()
return await fetch(`${usersBaseUrl}/users/signup`, requestOptions)
}
Expand Down
84 changes: 64 additions & 20 deletions apps/website/src/pages/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ async function onSubmit() {
const newEmail = email.value
email.value = ''
successMessage.value.style.display = 'block'
await signupUser(newEmail)
const res = await signupUser(newEmail)
console.log('Signup result', await res.json())
} catch (err) {
console.log('err with onSubmit :>> ', err)
console.log('Signup error', err)
}
}
Expand Down Expand Up @@ -84,35 +85,44 @@ function checkForBot(): boolean {
<ArrowRightIcon class="w-[15px] h-[20px] mx-2" />
</button>
<h1 class="header-text text-[#101828] mt-4 pb-0">
<span class="text-[#F36F38]" @click="$router.push('/')">
<span
class="text-[#F36F38]"
@click="$router.push('/')"
>
Your
</span>
digital assets
</h1>
<h1 class="header-text text-[#101828] mb-4">
<span class=" text-[#c4c4c4]" @click="$router.push('/')">
<span
class=" text-[#c4c4c4]"
@click="$router.push('/')"
>
All
</span>
in one place
</h1>
<h1 class="body-text text-[#667085] py-[40px]">
Non-custodial digital asset management and staking
</h1>
<form novalidate @submit.prevent="onSubmit">
<form
novalidate
@submit.prevent="onSubmit"
>
<div class="mt-10 grid grid-cols-5 gap-2 ">
<input
v-model="email"
type="text"
placeholder="Sign up for early access"
class="border border-[#D0D5DD] rounded-md px-4 py-2 col-span-3 input-text text-[#F36F38]"
@click="hideMessages"
/>
>
<input
v-model="botTrapInput"
class="bot-trap"
type="text"
placeholder="Bot Trap"
/>
>
<button
type="submit"
class="bg-[#F36F38] button-text text-white py-2 px-4 rounded-md w-[130px] hover:bg-[#F36F38]/[.75]"
Expand Down Expand Up @@ -148,13 +158,16 @@ function checkForBot(): boolean {
<div
class="border w-full p-[50px] bg-[#c4c4c4]/[.5] mt-[100px] min-w-[395px]"
>
<div v-if="currentSlide === 0" class="flex flex-wrap slideshow">
<div
v-if="currentSlide === 0"
class="flex flex-wrap slideshow"
>
<div class="min-w-[375px] w-1/2 pl-[50px] pt-[50px] slideshow">
<img
src="/Dashboard.png"
class="p-[5%] h-[90%] object-cover"
alt=""
/>
>
</div>
<div class="min-w-[375px] w-1/2 pt-[50px] pr-[50px]">
<h1 class="text-[42px] text-left ">
Expand All @@ -164,9 +177,16 @@ function checkForBot(): boolean {
</h1>
</div>
</div>
<div v-if="currentSlide === 1" class="flex flex-wrap slideshow">
<div
v-if="currentSlide === 1"
class="flex flex-wrap slideshow"
>
<div class="min-w-[375px] w-1/2 pl-[50px] pt-[50px]">
<img src="/earn.png" class="p-[5%] h-[90%] object-cover" alt="" />
<img
src="/earn.png"
class="p-[5%] h-[90%] object-cover"
alt=""
>
</div>
<div class="min-w-[375px] w-1/2 pt-[50px] pr-[50px]">
<h1 class="text-[42px] text-left ">
Expand All @@ -177,9 +197,16 @@ function checkForBot(): boolean {
</h1>
</div>
</div>
<div v-if="currentSlide === 2" class="flex flex-wrap slideshow">
<div
v-if="currentSlide === 2"
class="flex flex-wrap slideshow"
>
<div class="min-w-[375px] w-1/2 pl-[50px] pt-[50px]">
<img src="/earn3.png" class="p-[5%] h-[90%] object-cover" alt="" />
<img
src="/earn3.png"
class="p-[5%] h-[90%] object-cover"
alt=""
>
</div>
<div class="min-w-[375px] w-1/2 pt-[50px] pr-[50px]">
<h1 class="text-[42px] text-left ">
Expand All @@ -204,29 +231,46 @@ function checkForBot(): boolean {
target="_blank"
class="w-[25px]"
>
<img src="/twitter.svg" alt="" class="border" />
<img
src="/twitter.svg"
alt=""
class="border"
>
</a>
<a href="https://discord.gg/hkJD9gnN" target="_blank" class="w-[25px]">
<img src="/discord.svg" alt="" />
<a
href="https://discord.gg/hkJD9gnN"
target="_blank"
class="w-[25px]"
>
<img
src="/discord.svg"
alt=""
>
</a>

<a
href="https://github.com/consensusnetworks/casimir"
target="_blank"
class="w-[25px]"
>
<img src="/github.svg" alt="" />
<img
src="/github.svg"
alt=""
>
</a>
</div>
</div>
<div class="flex flex-wrap justify-center">
<img src="/CopyrightIcon.svg" alt="" class="w-[20px]" />
<img
src="/CopyrightIcon.svg"
alt=""
class="w-[20px]"
>
<a
href="https://consensusnetworks.com/"
target="_blank"
class="text-[#F36F38] mx-4"
>Consensus Networks</a
>
>Consensus Networks</a>
<span> | All Right Reserved</span>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions common/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@casimir/lib",
"private": true,
"main": "index.ts",
"main": "src/index.ts",
"scripts": {
"dev": "npx esno index.ts",
"build": "esbuild index.ts --bundle --minify --sourcemap --platform=node --target=es2020 --outfile=dist/index.js",
"dev": "npx esno src/index.ts",
"build": "esbuild src/index.ts --bundle --minify --sourcemap --platform=node --target=es2020 --outfile=dist/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
Expand Down
File renamed without changes.
52 changes: 22 additions & 30 deletions common/lib/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"lib": [
"es2018"
],
"declaration": true,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": false,
"inlineSourceMap": true,
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"typeRoots": [
"./node_modules/@types"
],
"outDir": "dist"
},
"exclude": [
"node_modules",
"dist"
]
}
"compilerOptions": {
"target": "es2020",
"strict": true,
"preserveConstEnums": true,
"noEmit": true,
"sourceMap": false,
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
},
"exclude": [
"node_modules",
"build.js"
],
"include": [
"./src/*",
"env.d.ts"
]
}
4 changes: 2 additions & 2 deletions infrastructure/cdk/lib/etl/etl-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class EtlStack extends Stack {
},
{
name: 'datestring',
type: glue.Schema.TIMESTAMP,
type: glue.Schema.DATE,
comment: 'The datestring (MM-DD-YYYY) of the event'
},
{
Expand Down Expand Up @@ -98,7 +98,7 @@ export class EtlStack extends Stack {
},
{
name: 'first_staked_at',
type: glue.Schema.TIMESTAMP,
type: glue.Schema.DATE,
comment: 'The first datestring (MM-DD-YYYY) that a wallet staked'
},
{
Expand Down
8 changes: 3 additions & 5 deletions infrastructure/cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@
"scripts": {
"pretest": "export PROJECT=casimir && export STAGE=test",
"test": "jest",
"cdk": "npx cdk",
"cdklocal": "npx cdklocal"
"cdk:bootstrap": "npx cdk bootstrap",
"cdk:synth": "npx cdk synth --no-staging"
},
"devDependencies": {
"@types/jest": "^27.5.2",
"@types/mocha": "^9.1.1",
"@types/node": "^17.0.35",
"aws-cdk": "^2.26.0",
"aws-cdk-local": "^2.15.0",
"esno": "^0.16.3",
"jest": "^26.4.2",
"ts-jest": "^26.2.0",
"typescript": "~3.9.7"
"ts-jest": "^26.2.0"
},
"dependencies": {
"@aws-cdk/aws-glue-alpha": "^2.31.0-alpha.0",
Expand Down
Loading

0 comments on commit 8d0f160

Please sign in to comment.