This repository represents a backend developed for the app "Cartoleiros".
This backend is responsible for the management of app users, register new users, and so on. Basicly, this repository is a CRUD (create, read, update and delete) for the app.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
What things you need to install the software and how to install them
node
npm
Open up the file database.js on the path src/config and replace where we had "<>" with your values. In this project was used a platform called ElephantSQL, where we can host a postgres database for free. Below there is an example to configure your own postgres database.
- Replace url for the "URL" contained on ElephantSQL;
- Replace host for the "Server" contained on ElephantSQL;
- Replace username and database for the "User & Default database" contained on ElephantSQL, and finally
- Replace password for "password" contained on ElephantSQL
module.exports = {
dialect: 'postgres',
url: "<YOUR URL HERE>",
host: '<YOUR HOST HERE>',
username: '<YOUR USER NAME HERE>',
password: '<YOUR PASSWORD HERE>',
database: '<YOUR DATABASE HERE>',
ssl: true,
define: {
timestamps: true,
underscored: true
}
}
A step by step series of examples that tell you how to get a development env running
To install node and npm, go to the link below and download the LTS version
https://nodejs.org/en/download/
Clone this repository, open up on your favorite code editor and then run the command line below to install all needed packages to run in your local machine
npm install
After install all needed packages, we need to run the migrations to create the tables, so we run the command line:
npx sequelize db:migrate
After that, run de command:
npm run dev
End with an example of getting some data out of the system or using it for a little demo
Explain how to run the automated tests for this system (WIP)
Explain what these tests test and why
Give an example
WIP
- NodeJS - The JS framework used
- Express - Framework NodeJS responsible for management the routes of the API
- Sequelize - ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server
- Md5 - a JavaScript function for hashing messages with MD5.
- Postgres - Open Source object-relational database.
- Azure Storage - Azure Storage.
- JWT - An implementation of JSON Web Tokens.
- Jest - Jest is a delightful JavaScript Testing Framework with a focus on simplicity.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
WIP
- André Macena - Initial work - Cartoleiros
See also the list of contributors who participated in this project.
This project is licensed under the ISC License - see the LICENSE.md file for details
- Inspiration in classes of Rocketseat and Balta.io