-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6dd0d24
Showing
9 changed files
with
2,369 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = LF | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
HUB_URL=https://snapshot.org |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Build and Run Tests | ||
on: [push] | ||
jobs: | ||
build-test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: 'yarn' | ||
- run: yarn install | ||
- run: yarn build | ||
- run: yarn lint | ||
- run: yarn typecheck |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.DS_Store | ||
node_modules | ||
dist | ||
build | ||
.env | ||
coverage | ||
|
||
# Remove some common IDE working directories | ||
.idea | ||
.vscode | ||
*.log |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Snapshot/Sidekick | ||
|
||
Sidekick is the service serving all proposals' votes CSV report | ||
|
||
<hr> | ||
|
||
This service is exposing an API endpoint expecting a closed proposal ID, and will | ||
return a CSV file with all the given proposal's votes. | ||
|
||
NOTE: CSV files are generated only once, then cached, making this service a cache middleware | ||
for snapshot-hub, for proposals' votes. | ||
|
||
## Project Setup | ||
|
||
> yarn | ||
Set the hub API url in the `.env` file | ||
|
||
``` | ||
HUB_URL= | ||
``` | ||
|
||
## Compiles and hot-reloads for development | ||
|
||
``` | ||
yarn dev | ||
``` | ||
|
||
## Linting and typecheck | ||
|
||
``` | ||
yarn lint | ||
yarn typecheck | ||
``` | ||
|
||
## License | ||
|
||
[MIT](https://github.com/snapshot-labs/envelop-ui/blob/bootstrap-app/LICENSE) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "snapshot-sidekick", | ||
"version": "0.0.1", | ||
"main": "index.js", | ||
"repository": "snapshot-labs/snapshot-sidekick", | ||
"license": "MIT", | ||
"scripts": { | ||
"lint": "eslint src/ --ext .ts", | ||
"lint:fix": "eslint src/ --ext .ts --fix", | ||
"build": "tsc -p tsconfig.json", | ||
"dev": "nodemon src/index.ts -e js,ts", | ||
"start": "node dist/src/index.js", | ||
"typecheck": "tsc" | ||
}, | ||
"eslintConfig": { | ||
"extends": "@snapshot-labs" | ||
}, | ||
"prettier": "@snapshot-labs/prettier-config", | ||
"dependencies": { | ||
"cors": "^2.8.5", | ||
"express": "^4.18.2" | ||
}, | ||
"devDependencies": { | ||
"@snapshot-labs/eslint-config": "^0.1.0-beta.0", | ||
"@snapshot-labs/prettier-config": "^0.1.0-beta.7", | ||
"@types/cors": "^2.8.13", | ||
"@types/express": "^4.17.17", | ||
"@types/node": "^18.15.11", | ||
"@typescript-eslint/eslint-plugin": "^5.59.0", | ||
"dotenv": "^16.0.3", | ||
"eslint": "^8.38.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"nodemon": "^2.0.22", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.0.4" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'dotenv/config'; | ||
import express from 'express'; | ||
import cors from 'cors'; | ||
|
||
const app = express(); | ||
const PORT = process.env.PORT || 3000; | ||
|
||
app.use(cors({ maxAge: 86400 })); | ||
|
||
app.listen(PORT, () => console.log(`Listening at http://localhost:${PORT}`)); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "commonjs", | ||
"rootDir": "./", | ||
"outDir": "./dist", | ||
"esModuleInterop": true, | ||
"strict": true, | ||
"noImplicitAny": true, | ||
"resolveJsonModule": true, | ||
"moduleResolution": "Node" | ||
} | ||
} |
Oops, something went wrong.