|
1 | 1 | # Develoment & Contributions
|
| 2 | + |
2 | 3 | This will be the getting started guide if you want to contribute or try out some stuff with SheetAble yourself!
|
3 | 4 |
|
4 | 5 | ## Setting up the environment
|
| 6 | + |
5 | 7 | ### Prerequisites
|
6 |
| -* [GoLang](https://golang.org/) v1.6 |
7 |
| -* [Node](https://nodejs.org/en/) v14, [npm](https://www.npmjs.com/) |
| 8 | + |
| 9 | +- [GoLang](https://golang.org/) v1.6 |
| 10 | +- [Node](https://nodejs.org/en/) v14, [npm](https://www.npmjs.com/) |
8 | 11 |
|
9 | 12 | ### Setup the backend server
|
| 13 | + |
10 | 14 | #### Set dev mode
|
| 15 | + |
11 | 16 | To setup the backend server for development you firstly have to add an ENV var to make sure CORS are activated so you can make requests from different domains. To do that simply set `DEV=1`. ([How to set env vars?](https://www.schrodinger.com/kb/1842))
|
| 17 | + |
12 | 18 | #### Run server
|
13 |
| -After that you can start running the server by going in the `backend` directory and execute |
| 19 | + |
| 20 | +After that you can start running the server by going in the `backend` directory and execute |
| 21 | + |
14 | 22 | ```
|
15 | 23 | go run main.go
|
16 | 24 | ```
|
17 | 25 |
|
18 |
| -### Setup the frontend |
19 |
| -The frontend is written in React and accordingly created with [create-react-app](https://github.com/facebook/create-react-app). |
| 26 | +#### Running into errors? If you see: |
| 27 | + |
| 28 | +``` |
| 29 | +go : The term 'go' is not recognized as the name of a cmdlet, function, script file, or operable program. |
| 30 | +Check the spelling of the name, or if a path was included, verify that the path is correct and try again. |
| 31 | +``` |
| 32 | + |
| 33 | +- You likely do not have 'go' installed, please install it from the link in the Prerequisites above |
| 34 | +- If you installed it and still have the error, close your development environment, then open it and try again |
| 35 | + |
| 36 | +``` |
| 37 | +[current date] [current time] error conencting to sqlite database: Binary was compiled with 'CGO_ENABLED=0', |
| 38 | +go-sqlite3 requires cgo to work. This is |
| 39 | +a stub |
| 40 | +exit status 1 |
| 41 | +``` |
| 42 | + |
| 43 | +- You need to add and set the ENV variable 'CGO_ENABLED' to 1 |
| 44 | + |
| 45 | +``` |
| 46 | +# runtime/cgo |
| 47 | +cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%" |
| 48 | +``` |
| 49 | + |
| 50 | +- You likely do not have 'gcc' in your development environment. |
| 51 | +- If you are using VSCode, follow [this guide](https://code.visualstudio.com/docs/cpp/config-mingw) |
| 52 | +- Otherwise, look for how to install c/c++ and gcc on your machine, and update the PATH ENV variable |
| 53 | +- Be sure to restart your environment after installing the proper extensions |
| 54 | + |
| 55 | +### Setup the frontend |
| 56 | + |
| 57 | +The frontend is written in React and accordingly created with [create-react-app](https://github.com/facebook/create-react-app). |
| 58 | + |
20 | 59 | 1. Go into the `frontend` directory with your terminal/command line
|
21 | 60 | 2. Install the npm packages
|
22 |
| - ``` |
23 |
| - npm install |
24 |
| - ``` |
| 61 | + ``` |
| 62 | + npm install |
| 63 | + ``` |
25 | 64 | 3. Start the project
|
26 | 65 | ```
|
27 | 66 | npm start
|
28 | 67 | ```
|
29 | 68 |
|
30 | 69 | ### Conclusion
|
| 70 | + |
31 | 71 | If you followed all the steps you should now have a development version of SheetAble running on your machine. Any changes in the frontend should automatically refresh your browser and the app. However if you make changes in the backend it will **not** automatically refresh the backend you have to restart the go process to take change.
|
32 | 72 |
|
33 |
| -Have fun developing 🎉 |
| 73 | +Have fun developing 🎉 |
0 commit comments