DELI APP Challenge

Description

Simple fullstack app for signup and verify accounts for the clients of Deli

Installation

  1. Clone the repository

  2. You need to set the environment variables in a .env file. You can use the .env.example file as a guide.

backend

PORT= # Port for the server
MAILGUN_API_KEY= # Mailgun API key for sending emails (Optional you also can use a SMTP server)
MAILGUN_DOMAIN= # Mailgun domain for sending emails (Optional you also can use a SMTP server)
SECRET_KEY= # Secret key for Auth token

# SMTP server
EMAIL_USER= # Email user for sending emails
EMAIL_PASSWORD= # Email password for sending emails
EMAIL_HOST= # Email host for sending emails
EMAIL_SERVICE= # Email service for sending emails

# Database
DB_TYPE= # Database type | mysql, postgres, sqlite, etc
DB_HOST= # Database host
DB_PORT= # Database port
DB_USERNAME= # Database username
DB_PASSWORD= # Database password
DB_DATABASE= # Database name

FRONTEND_URI= # Frontend URI for communication with the frontend
BASE_URI= # Base URI for the server
CORS_ORIGIN= # CORS origin for the server, also can be the frontend URI

frontend

VITE_API_URL= # API URL of the server
  1. Install the dependencies

backend

cd backend && npm install

frontend

cd frontend && npm install
  1. Run the server

backend

npm run dev

frontend

npm run dev

Note: Before running the server, you need to create the database and run the migrations.

the file it's in the backend folder, in the migrations folder.

With docker

You can also run the app using docker-compose. Go to the docker folder and run the following command:

docker-compose up

Note: Dont forget to set the environment variables in the .env files and run the migrations.

Run migration with docker

docker exec -it deli-db psql -U root -d deli-db -f /docker-entrypoint-initdb.d/initDb.sql

Screenshots

Sign Up

alt text

Verifying email

alt text

Email Verified

alt text

Live Demo

Live Demo