Tree-Thoughts (Back-end) 🌲
A study project on NodeJS with Express
Idea: 💡
Here will be concentrated the API from Tree-Thoughts (Front-end) project. In it will be the integration between the thoughts cards and the database.
This project will be using NodeJs with the library Express.js following REST Design Pattern.
Functionalities:
- Register, get and update user data;
- User authentication (JWT Token);
- Register, delete, get and update thoughts cards;
Running the project: 🚀
To run and view the project in development mode, you will need to follow the next steps.
Prerequisites:
The tools necessary for the project to work will be listed below.
- NodeJS versão 14
NodeJS installation Guide.
Installing dependencies:
Run the command to install the project dependencies.
npm install
Configuring env file:
To configure the project's environment variable file, follow the steps below:
- Step 1- Create an
.env
file at the root of the project; - Step 2- Copy the contents of the
.env.example
file to your new .env file; - Step 3- Change the content informing your database connection data and TCP port for project execution
After the env setup, proceed with the steps below ✌
Running database structure:
⚠ Database structure commands should only be executed at the initial project setup or when its structure is changed ⚠
The scripts below build the database structure
npx sequelize db:migrate
Command to create structure
npm sequelize db:seed:all
Command to upload standard data in defined tables
Running the project:
The scripts below run the project build.
npm run server
Command to run the project in development mode
npm run watch
Command to run the project in watch development mode
Conclusion: 👍
After the first configuration of the project following the steps above, the next few times, it will only be necessary to run the command to start the server in development mode
Links: 🌐
Sequelize:
Sequelize docs
Datatypes
Express:
Express docs
Rest API
JWT:
JSON Web Tokens docs
JWT NodeJS
License
This project is licensed under the [MIT] license - see the LICENSE.md file for details