The backend api which powers Tymonial.
git clone https://github.com/Benrobo/tymonail-api.git
// if npm is default package manager
npm install
// if yarn is default package manager
yarn add
DATABASE_URL="postgresql://postgres:1234@localhost:5432/tymonial?schema=public&connect-timeout=300"
JWT_SECRET="some-secret-here"
MAX_API_REQUEST_COUNT = 500
NODE_ENV="development"
Tymonial kit uses Prisma ORM
for managing Postgresql Database
. So it compulsory you have postgresql installed, if not follow the link below on setting up postgresql and prisma orm on your pc
npm run prisma-migrate
-
It creates a new SQL migration file for this migration
-
It runs the SQL migration file against the database
# start api development server
documents/projects/trakka/api~$ npm run dev
Here are some API endpoint which could be called localy
on your computer.
-
Registeration:
/api/auth/register
.method
:POST
.Body
:username
,email
,password
.Headers
:Authorization
:NONE
-
Login:
/api/auth/login
.method
:POST
.Body
:email
,password
.Headers
:Authorization
:NONE
-
getUsers:
/api/users
.method
:GET
.Body
:NONE
Headers
:Authorization
:NONE
-
getUser:
/api/user
.method
:GET
.Body
:userId
Headers
:Authorization
:AccessToken
-
getTemplates:
/api/templates/get
.method
:POST
.Body
:userId
Headers
:Authorization
:AccessToken
-
createTemplate:
/api/templates/create
.method
:POST
.Body
:userId
,name
Headers
:Authorization
:AccessToken
-
deleteTemplate:
/api/templates/delete
.method
:DELETE
.Body
:userId
,name
Headers
:Authorization
:AccessToken
NOTE , If any issue were encountered when setting up the backend API, kindly create an ISSUE HERE. your feedback is highly appreciated.