Internal Document for Developers
I personally recommend using JetBrains' Goland IDE for the project.
We have free educational licenses to the JetBrains' IDEs as Yale students.
After Goland is installed, open this project in Goland and it will automatically install the necessary dependencies.
Create three files: .env
, .env.local
, and .env.dev
environments.
The content of these files are in this google doc
Please request access to the document if you are a developer of the project.
Install a version no older than 8.0
.
You don't need to install Redis if you don't need to work with the log-in/sign-up workflows.
Refer to .env
file for the database name (DB_NAME
) and the user name (BD_USERNAME
).
You'll need to manually create the database and the user in MySQL.
Remember to grant the user all privileges to the database. (GRANT ALL ON DB_NAME.* TO 'DB_USERNAME'@'localhost';
)
Run the main.go
program.
Specify the environment variable GIN_ENV_MODE=dev
.
You can do this in Goland as:
Download the full_stack_project.pem
file and find the ip address of the AWS EC2 instance from our internal document provided at the top.
SSH into the EC2 server:
ssh -i full_stack_project.pem ec2-user@OUR_SERVER_IP
View the logs:
sudo less /var/log/web.stdout.log
I would strongly recommend starting the application in local mode first if you are creating new tables.
- Create a new file and a new struct in the
models
package. (Refer to the existing files for the format) - Add the new struct to
models/setup.go
after the block in around line 27, so that the new table will be created and migrated automatically.