![Logo](/TiagoRibeiro25/Only-Foods-BE/raw/main/images/logo.png)
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
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.
To get a local copy up and running follow these simple steps.
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
-
Clone the repo
git clone https://github.com/TiagoRibeiro25/Only-Foods-BE.git
-
Install NPM packages
npm install
-
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
-
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
-
Run the migrations
npx prisma migrate dev --name init
-
Generate the prisma client
npx prisma generate
-
Run the project
npm run dev
-
Install NPM packages (if you haven't already)
npm install
-
Build the project
npm run build
-
Set the NODE_ENV variable to production and the rest of the variables in the .env file
-
Generate the prisma client
npx prisma generate
-
Run the project
npm start
All the documentation can be found here.
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".
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Contact through my personal website.