Giter Site home page Giter Site logo

social-network-api's Introduction

Social Network Project

This is a mini social media project that I created to learn more about the FastAPI and React frameworks. It is a simple social media site that allows users to create accounts and make posts. It is a work in progress and I plan to add more features in the future.

Technologies

FastAPI PostgreSQL Docker

About

This repo contains the backend code of the project made with FastAPI.
The frontend code can be found here.

Features

  • Create accounts
  • User posts

Getting Started

Prerequisites

  • Docker
  • Docker Compose
  • Python >= 3.10
  • Pipenv
  • Traefik (optional)

Installation

  1. Clone the repo
    git clone https://github.com/fhilipecrash/social-network-api
  2. Run the project
    1. Without Docker python container
      docker-compose up -d pgsql # Run the postgres container
      pipenv shell # Activate the virtual environment
      pipenv install # Install the dependencies
      pipenv run dev # Run the project
    2. With Docker python container
      docker-compose up -d # Run the postgres and python container
    3. With Devcontainer If you have Devcontainer extension just open the project in VSCode and it will automatically create the container for you.

Usage

When you enter the project for the first time you will need to run the migrations to create the database tables.

pipenv run migrate

Checkout the Swagger documentation at http://localhost:8000/docs

You can use traefik to use a basic proxy to the project. If you have trakif binary on your PATH, you can run the following command to start the proxy:

Note: Traefik is started automatically when you run the project with docker-compose.

Note: This command will use your current terminal session to run the proxy and you don't be able to use the terminal while the proxy is running. So open a new terminal session to run the project.

pipenv run proxy # Run the proxy

Now you can access the documentation at http://localhost:9999/api/v1/docs just like any other application route and it is recommended to use the same url and port to test the endpoints.

social-network-api's People

Contributors

fhilipecrash avatar

Stargazers

 avatar

Watchers

 avatar  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.