The principal function for this server is manage the SigIn/LogIn, provide service about tarot cards.
- Clone the repository
after continue configure your variables take the
.env.example
and rename for.env
. Then edit.env
whit your enviroment variables
before you continue you need mongodb you can install manually in your computer or you can dockerize your mongodb
see the next steps
first install docker
second create a container whit mongo image in the link explain how run a docker container in local
third, you can use docker compose file in repositorie just need type before you laun the server
yarn db-start
this function run a container whit mongo in dettached mode
if you test this repo in local you need have a account in cloudinar
once you are registered, go to dashboard and check the next values
- cloud name
- api Key
- api secret
whit this you can change the next enviroment variables
CLOUD_NAME= your clod CLOUD_API_KEY= your api key CLOUD_SECRET= your api secret
- in the root of the project run a terminal and execute the next command:
yarn
set enviroment variables
- wake up the backend app
yarn start
if you have any problem please take a look to your enviroment variables, check your database is running.
we have 3 principal services in this backen
- authenticate
- Tarot card Rest-Api
- upload images to cloudinary
in the first iteration of tarot dev back we implement a basic auth
- create or autenthicate a user
- send a token for upcoming request
- validate all request whit the previous token sended
in tarot card we have a usual crud but the application count whit another methods to manage the associate images of tarot cards
- the middlewares
- save image in server
- upload to cloudinary, in this method we receive an url whit image direction
- delete image in localhost
In this case we get different method to check some things about the user or update some fields
- check by email
- setVote
- setUploadImage
The core of the app is build in nodejs, but the project use some libraries like:
- express, framework to create API-REST
- mongodb, non relational DB
- dotenv, manage our enviroment variables in a simple file
- multer, manage incoming files,
- jsonwebtoken and bcrypt to manage security
automate how reset the fields isVoted and isTarotCardSend in user implement Rest-API for tarot card puntuation
made whit ๐ by Adriel Arocha Oronoz