Skip to content

Commit e55b0d8

Browse files
author
Brian Genisio
committed
importing from existing tasks
0 parents  commit e55b0d8

File tree

11 files changed

+1442
-0
lines changed

11 files changed

+1442
-0
lines changed

.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
# Populated by configuration
3+
ORIGINAL_SPREADSHEET_URL=
4+
GOOGLE_API_KEY=
5+
COPY_ENDPOINT=
6+
7+
# Populated via setup.js
8+
GENERATED_TAG=
9+
GOOGLE_SHEET_ID=
10+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
.env
3+
spreadsheet.json

LICENSE

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Elastic License 2.0
2+
3+
URL: https://www.elastic.co/licensing/elastic-license
4+
5+
## Acceptance
6+
7+
By using the software, you agree to all of the terms and conditions below.
8+
9+
## Copyright License
10+
11+
The licensor grants you a non-exclusive, royalty-free, worldwide,
12+
non-sublicensable, non-transferable license to use, copy, distribute, make
13+
available, and prepare derivative works of the software, in each case subject to
14+
the limitations and conditions below.
15+
16+
## Limitations
17+
18+
You may not provide the software to third parties as a hosted or managed
19+
service, where the service provides users with access to any substantial set of
20+
the features or functionality of the software.
21+
22+
You may not move, change, disable, or circumvent the license key functionality
23+
in the software, and you may not remove or obscure any functionality in the
24+
software that is protected by the license key.
25+
26+
You may not alter, remove, or obscure any licensing, copyright, or other notices
27+
of the licensor in the software. Any use of the licensor’s trademarks is subject
28+
to applicable law.
29+
30+
## Patents
31+
32+
The licensor grants you a license, under any patent claims the licensor can
33+
license, or becomes able to license, to make, have made, use, sell, offer for
34+
sale, import and have imported the software, in each case subject to the
35+
limitations and conditions in this license. This license does not cover any
36+
patent claims that you cause to be infringed by modifications or additions to
37+
the software. If you or your company make any written claim that the software
38+
infringes or contributes to infringement of any patent, your patent license for
39+
the software granted under these terms ends immediately. If your company makes
40+
such a claim, your patent license ends immediately for work on behalf of your
41+
company.
42+
43+
## Notices
44+
45+
You must ensure that anyone who gets a copy of any part of the software from you
46+
also gets a copy of these terms.
47+
48+
If you modify the software, you must include in any modified copies of the
49+
software prominent notices stating that you have modified the software.
50+
51+
## No Other Rights
52+
53+
These terms do not imply any licenses other than those expressly granted in
54+
these terms.
55+
56+
## Termination
57+
58+
If you use the software in violation of these terms, such use is not licensed,
59+
and your licenses will automatically terminate. If the licensor provides you
60+
with a notice of your violation, and you cease all violation of this license no
61+
later than 30 days after you receive that notice, your licenses will be
62+
reinstated retroactively. However, if you violate these terms after such
63+
reinstatement, any additional violation of these terms will cause your licenses
64+
to terminate automatically and permanently.
65+
66+
## No Liability
67+
68+
*As far as the law allows, the software comes as is, without any warranty or
69+
condition, and the licensor will not be liable to you for any damages arising
70+
out of these terms or the use or nature of the software, under any kind of
71+
legal claim.*
72+
73+
## Definitions
74+
75+
The **licensor** is the entity offering these terms, and the **software** is the
76+
software the licensor makes available under these terms, including any portion
77+
of it.
78+
79+
**you** refers to the individual or entity agreeing to these terms.
80+
81+
**your company** is any legal entity, sole proprietorship, or other kind of
82+
organization that you work for, plus all organizations that have control over,
83+
are under the control of, or are under common control with that
84+
organization. **control** means ownership of substantially all the assets of an
85+
entity, or the power to direct its management and policies by vote, contract, or
86+
otherwise. Control can be direct or indirect.
87+
88+
**your licenses** are all the licenses granted to you for the software under
89+
these terms.
90+
91+
**use** means anything you do with the software requiring one of your licenses.
92+
93+
**trademark** means trademarks, service marks, and similar rights.

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Spreadsheet Simulator
2+
3+
Spreadsheet simulation for CodeSignal
4+
5+
## Quick Start
6+
7+
### Prerequisites
8+
9+
- Node.js (v14 or higher)
10+
- npm or yarn
11+
- Google Sheets API access (for JSON export functionality)
12+
13+
### Installation & Setup
14+
15+
1. **Clone the repository:**
16+
```bash
17+
git clone <repository-url>
18+
cd learn_spreadsheet-sim
19+
```
20+
21+
2. **Create environment configuration:**
22+
Create a `.env` file in the project root:
23+
```env
24+
ORIGINAL_SPREADSHEET_URL=https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/
25+
GOOGLE_API_KEY=your_google_docs_api_key
26+
GOOGLE_SHEET_ID=your_sheet_id
27+
GENERATED_TAG=your_generated_tag
28+
COPY_ENDPOINT=http://146.190.40.43:3000/getSpreadsheet
29+
```
30+
31+
3. **Run the automated setup:**
32+
```bash
33+
chmod +x start_spreadsheet.sh
34+
./start_spreadsheet.sh
35+
```
36+
37+
This script will:
38+
- Install required dependencies (`dotenv`, `express`, `axios`)
39+
- Install PM2 globally for process management
40+
- Start the proxy server
41+
- Run the initial setup
42+
43+
## Components
44+
45+
46+
### 🔧 Configuration
47+
48+
The application uses environment variables for configuration:
49+
50+
- `ORIGINAL_SPREADSHEET_URL` - The source Google Sheet URL to copy
51+
- `GOOGLE_API_KEY` - Google Sheets API key for data export
52+
- `COPY_ENDPOINT` - External service endpoint for creating sheet copies
53+
54+
## Usage
55+
56+
### Basic Operation
57+
58+
1. **Start the system:**
59+
```bash
60+
./start_spreadsheet.sh
61+
```
62+
63+
2. **Access the proxy:**
64+
Navigate to `http://localhost:3000` in your browser
65+
66+
3. **Automatic redirection:**
67+
The proxy will show a loading page while preparing the sheet, then automatically redirect to the temporary copy

check_spreadsheet.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
rm spreadsheet.json
4+
node spreadsheetToJson.js
5+
cat spreadsheet.json

0 commit comments

Comments
 (0)