Tamiat CMS backend
- You should rename .env.example with .env and put all environment values ex: HOST=localhost.
- If you want to add a new type of errors, You can add it in errs package.
- To test the endpoints, import the collection in Postman, you can check how to import it from here.
- After every
pull
you can runsoda migrate
to update your local database structure if there are any updates.
-
Create postgresql database from terminal by doing:
sudo -i -u postgres
psql
CREATE DATABSE db_name;
-
Add datasource to goland (optional, you can use pgadmin4 or dbeaver or you can use postgres from command line)
leave all settings and just add the postgres username as shown in the picture.
-
Environment variables: There are 5 environment variables related to database connection
-
PASS=< value_for_password_of_postgres_database >
-
HOST=localhost
-
DBNAME=<db_name> ; // the same name of database that was created in postgres as shown above
-
DBPORT=5432 ;
-
PORT=8080 ;
4. Install soda migration tool:
- In linux:
- open .profile
nano .profile
- add this at the end of the file: <\br>
export PATH=$HOME/go/bin:$PATH
source .profile
-
In mac:
same instructions as linux but open .zprofile -
In windows:
add this environment variable:C:\Users\<your_username>\go\bin
- then in the working directory of the project:
soda migrate
- for more info about soda migration and how it works you can check this link
We use sendgrid api, so to test this feature you have to:
- create an account in sendgrid
- create api key
- create a template and replace TEMPLATE_ID env variable with your own template id.