Coder Social home page Coder Social logo

petma's Introduction

Petma

Petma is a social network for animal lovers. This first version is incomplete for a real social network, and so it will be further developed afterwards.

The repo consist of two main directories, the server and the client. The first one is an express server (a simple backend) which can be called as a REST API, fetching data from a Postgres Database. On the other hand we have the client ((the frontend), which is designed and developed in Next.js for mobile devices. The idea is making it responsive in the future for more devices.

Server

To run the server, the first thing you'll need is to install it's dependencies with npm install. Then you should create a .env file to store some environment variables for the project to run. These are the environment variables you will need:

VARIABLE EXAMPLE
PORT 8000
ORIGIN http://localhost:3000
SESS_SECRET secret-string
TOKEN_SECRET secret-string
PGDATABASE railway
PGHOST database-host.railway.app
PGPASSWORD database-password
PGPORT database-port
PGUSER database-usesr

After all of them are set, you can run npm run dev to start the server on your local.


The server is working as a REST API, and so it has several endpoints to get some json data from the backend. These are the ones you have to care about!

API Endpoints METHOD Description
/api/users GET Fetches all users
/api/users/:id GET Fetches the user with the specified id
/api/users/:id/pets GET Fetches the pets of the user with the specified id
/api/users/:id/friends GET Fetches the friends of the user with the specified id
/api/users POST Creates a new user in the database with the body of the request
/api/users/:id PUT Updates a specified by id user with the body of the request
/api/users/:id DELETE Deletes an user specified by it's id

Client

In order to run the client you have to install it's dependencies with npm install and then create a .env.local file with a single environment variable for the URI or domain of the REST API (you may also hardcode it...). This environment variable is NEXT_PUBLIC_REST_API_URI.

To see the frontend client on your local, simply run npm run dev!

Future features

  • Fully responsive for multiple devices
  • User authentication
  • User profile
  • Pet management from user profile
  • Option to send friend requests
  • Option to remove friends from user profile
  • Pet pages for cuteness and details

petma's People

Contributors

bitterbaitbite avatar

Watchers

James Cloos 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.