The ideia is to study and practice about Javascript applications and Node's REST APIs.
The structure of src directory (Old image):
- Visual Studio Code
- Postman
- Node.js
- NPM
- PostgreSQL
- Express.js
- Nodemon
- Knex.js
- Celebrate
- BCrypt
- JWT
- Axios
- Nodemailer
- Nerds
- Jest
- express-fileupload
- Commitlint | Husky | Commitizen
Installing all the packages
npm install
Running on http://localhost:3000
npm start
Here are some features made to apply my personal studies.
Migrations and Seeds for products and users using Knex.js Query Builder and PostgreSQL. I applied mostly random types and OneToMany relationship at the database.
🎁 You can access the files at the database directory and see the configs at knexfile.js.
Raw SQL procedure and trigger to update the timestamp updated_at in the database products and users. Just read the comments at the database files and knexfile.js.
To validate the requests made with Postman was used the Celebrate package which is basically a middleware using Joi. Very simple! You can find it at routes.
I used the NodeMailer package along the Ethereal Service to test some fake emails.
JSON Web Token (JWT) to autenticate and authorize users. To apply in the Controllers was made a middleware for autorize the user.
🎁 If you want to see all the auth stuffs, you'll have to seach for the "auth" files.
Usage of Jest package for unit testing at test directory. So far, my tests are a little bit simple and for the utils functions on src/utils directory.
❓ to run the tests
npm test
Using the express-fileupload package to upload a single file (so far). Take a look at the FileController.js and the post route at the index.js at routes directory.
Using the Axios package to consume my personal Fake Data API
Made with