Code Monkey home page Code Monkey logo

backend's Introduction

backend

Tamiat CMS backend

Development instructions

  • 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.

Running instructions

  • To test the endpoints, import the collection in Postman, you can check how to import it from here.
  • After every pull you can run soda migrate to update your local database structure if there are any updates.

Database on local

  1. Create postgresql database from terminal by doing:

     sudo -i -u postgres
    
    psql  
    
    CREATE DATABSE db_name;  
    
  2. 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.
    1

  3. 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:

  1. In linux:
  • open .profile
    nano .profile  
    
  • add this at the end of the file: <\br>
    export PATH=$HOME/go/bin:$PATH  
    
    source .profile  
    
  1. In mac:
    same instructions as linux but open .zprofile

  2. 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

Send verification code feature

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.

backend's People

Contributors

rahmayasser avatar marwangalal746 avatar mahnouman avatar odetolakehinde avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.