Skip to content

Back end of the Only Foods project, a web application that allows users to share thoughts, recipes and chat with each other about food.

License

Notifications You must be signed in to change notification settings

TiagoRibeiro25/Only-Foods-BE

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

Only Foods - Back End

This is the back end of the Only Foods project, a web application that allows users to share thoughts, recipes, and chat with each other about food.
Status: Production-Ready
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Documentation
  4. Contributing
  5. License
  6. Contact

About The Project

Product Name Screen Shot

Only Foods is a web application that allows users to share thoughts, recipes, and chat with each other about food.

This project was made as a side project to elevate my skills in Prisma and Typescript. It was made fully alone, from the design to the deployment.

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

In order to run this project, you need to have installed

  • Nodejs
  • npm

You also need to have access to the a:

  • PostgreSQL database (or use the provided docker-compose file)
  • Redis database (or use the provided docker-compose file)
  • Cloudinary account
  • Mailjet account

Installation

  1. Clone the repo

    git clone https://github.com/TiagoRibeiro25/Only-Foods-BE.git
  2. Install NPM packages

    npm install
  3. Create a .env file, add the variables in the .env.sample file and fill them with your own values. The .env file should have the following variables:

    PORT
    JWT_SECRET
    MAILJET_URL
    MAILJET_PUBLIC_KEY
    MAILJET_SECRET_KEY
    MAILJET_FROM_EMAIL
    CLOUDINARY_CLOUD_NAME
    CLOUDINARY_API_KEY
    CLOUDINARY_API_SECRET
    DATABASE_URL
    REDIS_HOST
    REDIS_PORT
    REDIS_DB
    FRONTEND_URL
    DOMAIN
  4. Have a PostgreSQL database and Redis database running (or use the provided docker-compose file) and update the DATABASE_URL and REDIS_URL variables in the .env file

  5. Run the migrations

    npx prisma migrate dev --name init
  6. Generate the prisma client

    npx prisma generate
  7. Run the project

    npm run dev

Prepare for production

  1. Install NPM packages (if you haven't already)

    npm install
  2. Build the project

    npm run build
  3. Set the NODE_ENV variable to production and the rest of the variables in the .env file

  4. Generate the prisma client

    npx prisma generate
  5. Run the project

    npm start

Documentation

All the documentation can be found here.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Contact through my personal website.

About

Back end of the Only Foods project, a web application that allows users to share thoughts, recipes and chat with each other about food.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published