an simple REST API boilerplate with ACL and JWT Auth feature to build backend with Express framework using TypeScript language.
-
to run application
-
to run database PostgreSQL
-
to migrating the
.sqlfile in/migrationsdirectory -
to run the
yarn start:devornpm run start:devwith hot reload
-
here to put your database blueprint for your application in
.sqlfiletype for run withyarn start:docker-dbornpm run start:docker-db, please write the patern of file like this[seq].[action].sqlfor complete guide see in here -
an every response and request interface DTOs
-
group of every endpoint APIs
-
general interface should in here
-
all of endpoint handler function to handle
/routesresponse or request getted -
all of CRUD to process data or gathering from database
-
all of miscellaneous function such as utility function can be re-used in anywhere
-
where unit test file in here for running the
yarn testornpm run testusing jest -
connection to database function and the root of database function interface
- copy file named
env-sampleand rename it to.env. - edit the
.envfile value as your desired such as DB_USERNAME, DB_PASSWORD, DB_DATABASE, and etc. - make sure
.postgratorrc.jsonconfig is same with.env - run
yarn start:init-dbornpm run start:init-db - run
yarn start:devornpm run start:dev