Giter Site home page Giter Site logo

frontend-guy / react-mesto-api-full-gha Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 84.29 MB

Mesto App: An Instagram-inspired photo-sharing platform with React, integrated user authentication, and backend via Node/Express.js.

JavaScript 67.87% HTML 3.59% CSS 28.53%
authorization express full-stack react jwt mongodb nginx

react-mesto-api-full-gha's Introduction

React Mesto API Full

About

This repository houses the full stack application for the Mesto project.

Mesto is an Instagram-like content-sharing app. This is a responsive single page React app with router navigation. Server-side API is powered by Express.js server and hosted on Yandex Cloud. The app features user profile registration and login. Authenticated users are redirected to the main page and can add pictures to the gallery and see the cards created by other users. Additionally, the users can like/dislike or remove pictures.

🛠 Technology Stack

  • Frontend: React.js, CSS, HTML
  • Backend: Express.js, MongoDB
  • Authentication: JWT
  • Deployment: Nginx on Yandex Cloud

💻 Local Development Setup

🔍 Prerequisites

  • Node.js
  • NPM (comes bundled with Node.js)
  • MongoDB (for the backend)

📥 Cloning the Repository

git clone https://github.com/FrontEnd-Guy/react-mesto-api-full-gha.git

💻 Frontend

  1. Navigate to the frontend directory:
cd react-mesto-api-full-gha/frontend
  1. Install the required dependencies:
npm install
  1. Set up environment variables:

Create a .env file in the frontend folder and add the following line:

REACT_APP_API_URL=http://localhost:3001
  1. Start the frontend development server:
npm start

The frontend application should now be running on http://localhost:3000.

☁️ Backend

  1. Navigate to the backend directory:
cd ../backend
  1. Install the required dependencies:
npm install
  1. Set up environment variables:

Create a .env file in the backend folder and add the following lines:

NODE_ENV=production
JWT_SECRET=eb28135ebcfc17578f96d4d65b6c7871f2c803be4180c165061d5c2db621c51b
PORT=3001
MONGO_URI=mongodb://127.0.0.1:27017/mestodb
CORS_WHITELIST=http://localhost:3000
  1. Start the backend server:
npm start

The API server should now be up and running on http://localhost:3001 or your chosen port. Note: Before starting the backend, ensure MongoDB is running locally and the connection string is set appropriately in your backend configurations.

react-mesto-api-full-gha's People

Contributors

frontend-guy avatar

Stargazers

Danila Legkobytov avatar Vladimir Albrekht avatar Tatiana avatar Дмитрий Ледовских avatar Zelenova Mariya avatar Anastasia Povarkova avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.