About • Database • How It Works • Pre-requisites • Tech Stack • How to contribute • Author
FullStack Overflow API was designed to facilitate the flow of questions and answers from your group of friends and co-workers in the tech world!
The database was designed at https://www.dbdesigner.net/ for PostgreSQL.
/* In your psql terminal */
CREATE DATABASE fsoverflow;
/* Access the database */
\c fsoverflow
Now, just run the commands listed in dump.sql
POST /questions
{
"question": "How it works?",
"student": "Bob",
"classname": "T3",
"tags": "typescript, lifestyle, javascript, java?"
}
400: 'The request body contains invalid elements';
201: 'Created';
404: 'The student name does not belong to any registered user';
404: 'The class name does not belong to any registered class';
500: 'Internal Server Error - error details'
POST /questions/:id
{
"answer": "Just look at the README file :)"
}
400: 'The request body contains invalid elements';
200: 'OK';
404: 'Question not found';
409: 'Question already answered';
500: 'Internal Server Error - error details'
POST /users
{
"name": "John",
"classname": "T4"
}
400: 'The request body contains invalid elements';
201: 'Created';
404: 'The class name does not belong to any registered class';
409: 'User already registered';
500: 'Internal Server Error - error details'
GET /questions
[
{
"id": 11,
"question": "We gonna learn TS?",
"student": "Zoru",
"class": "T3",
"submitedAt": "2021-11-20 10:12"
},
{
"id": 15,
"question": "New here, should I learn JS or Python first?",
"student": "Zoru",
"class": "T4",
"submitedAt": "2021-11-19 07:12"
}
]
200: 'OK'
404: 'Unanswered questions not found';
500: 'Internal Server Error - error details'
GET /questions/:id
// Answered Question
{
"question": "How It Works?",
"student": "Bob",
"class": "T3",
"tags": "typescript, lifestyle, javascript, java?"
"answered": true,
"submitedAt": "2021-11-16 08:35"
"answeredAt": "2021-11-16 13:30"
"answeredBy": "Dylan",
"answer": "Just look at the README file :)"
}
//Unanswered Question
{
"question": "We gonna learn TS?",
"student": "Zoru",
"class": "T3",
"tags": "typescript, bootcamp",
"answered": false,
"submitedAt": "2021-11-20 10:12"
}
200: 'OK'
404: 'Question not found';
500: 'Internal Server Error - error details'
Before you begin, you will need to have the following tools installed on your machine: Git, Node.js, VSCode.
// Clone this repository
$ git clone git@github.com:okitauehara/fsoverflow-developer-api.git
// Access the project folder cmd/terminal
$ cd fsoverflow-developer-api
// Install the dependencies
$ npm install
// Create a .env.dev file and fill it using your environment variables following the .env.example
// Run the application in development mode
$ ntl -> start:dev
// The server will start at port: 4000
You can find the .env.example here
The following tools were used in the construction of the project-api:
Server (NodeJS)
See the file package.json
Utilitários
- Editor: Visual Studio Code
- API Test: Insomnia
- Fork the project.
- Create a new branch with your changes:
git checkout -b feat/myFeatureName
- For each feature implemented, make a commit specifying what was done
- Submit your changes:
git push -u origin feat/myFeatureName
Developed by Marcos Okita Uehara.