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.
- Register, get and update user data;
- User authentication (JWT Token);
- Register, delete, get and update thoughts cards;
To run and view the project in development mode, you will need to follow the next steps.
The tools necessary for the project to work will be listed below.
- NodeJS versão 14
NodeJS installation Guide.
Run the command to install the project dependencies.
npm install
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
⚠ 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
npm sequelize db:seed:all
The scripts below run the project build.
npm run server
npm run watch
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
Sequelize:
Sequelize docs
Datatypes
Express:
Express docs
Rest API
JWT:
JSON Web Tokens docs
JWT NodeJS
This project is licensed under the [MIT] license - see the LICENSE.md file for details