VagnerNerves / api-rest-with-nodejs-ignitenode

Developed the project in Node.js with Fastify and Knex, where routes for transactions and sessions were created.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node Project for credit and debit transactions.

Developed the project in Node.js with Fastify and Knex, where routes for transactions and sessions were created.

Rules:

  • Functional Requirements:

    • The user must be able to create a new transaction.
    • The user must be able to get an account summary.
    • The user must be able to list all transactions that have occurred.
    • The user must be able to view a single transaction.
  • Business Rules:

    • The transaction can be of type credit, which will add to the total value, or debit, which will subtract.
    • It should be possible to identify the user between requests.
    • The user can only view transactions that they have created.

🧭 Table of contents

πŸ‘ Learning and more Implementations

  • Learned to use Fastify and Knex.
  • Learned to create migrations with Knex.
  • Learned to create tests with Vitest.
  • Learned to build the project and publish it.

πŸ’‘ Technologies Used

πŸ“‚ Folder Structure

Back-end
.
β”œβ”€β”€ db                          # Contains Migrations Knex and DB.
β”œβ”€β”€ src                         # Source files
β”‚   β”œβ”€β”€ @types                  # Contains all global definitions of types and interfaces
β”‚   β”œβ”€β”€ env                     # Contains configuration use env
β”‚   β”œβ”€β”€ middlewares
β”‚   β”œβ”€β”€ routes
β”‚   β”œβ”€β”€ server                  # Aplication entry
.
.
β”œβ”€β”€ test                        # Contains Test the route
.
.
└── README.md

πŸš€ Running the Project

Back-end

Clone the project

  git clone https://github.com/VagnerNerves/api-rest-with-nodejs-ignitenode.git

Enter the project directory

  cd api-rest-with-nodejs-ignitenode

Install with dependencies

  npm install

Create the .env and .env.test files according to the examples in the folder.

Run the Knex migrations to create the database.

  npm run knex migrate:latest

Start the server

  npm run dev

πŸ“ Routes

Run in Insomnia

🌎 License

This project is under the MIT license. See the LICENSE file for more details.

βœ’ Author

Author Vagner Nerves

Vagner Nerves

Made with love and hate πŸ˜…, get in touch!

Linkedin Badge Gmail Badge GitHub Badge

About

Developed the project in Node.js with Fastify and Knex, where routes for transactions and sessions were created.

License:MIT License


Languages

Language:TypeScript 100.0%